/// <summary>
        /// Creates a revolved surface from a list of wireframe.
        /// </summary>
        /// <param name="rotationAxis">The axis around which to revolve the surface.</param>
        /// <param name="angleOfRevolution">The angle round which to revolve.</param>
        /// <param name="wireframe">The wireframe representing the profile of the surface.</param>
        /// <returns>A revolved surface.</returns>
        public PSSurfaceRevolution CreateRevolvedSurface(
            Axes rotationAxis,
            Geometry.Degree angleOfRevolution,
            PSWireframe wireframe)
        {
            // Set the principal plane
            _powerSHAPE.SetActivePlane(rotationAxis.AxisToPlane());

            // Select the wireframe
            wireframe.AddToSelection(true);

            // Create revolved surface
            _powerSHAPE.DoCommand("CREATE SURFACE REVOLUTION");

            // Check that surface has been created
            PSSurfaceRevolution createdSurface = null;

            if (_powerSHAPE.ActiveModel.SelectedItems.Count == 0)
            {
                throw new ApplicationException("No surface was created from the revolution");
            }
            createdSurface = (PSSurfaceRevolution)_powerSHAPE.ActiveModel.SelectedItems[0];

            // Change the revolution angle if required
            if (angleOfRevolution != 360)
            {
                createdSurface.Angle = angleOfRevolution;
            }

            return(createdSurface);
        }
Beispiel #2
0
 /// <summary>
 /// Rotates a single curve by a specified angle around a specified axis
 /// </summary>
 /// <param name="rotationAxis">Axis around which the curve is are to be rotated</param>
 /// <param name="rotationAngle">Angle by which the curve is to be rotated</param>
 /// <param name="copiesToCreate">Number of copies to create of the original curve</param>
 /// <param name="rotationOrigin">Origin of the rotation axis</param>
 /// <returns>List of curves created by the operation.  If numberOfCopies is 0, an empty list is returned</returns>
 public List <PSEntity> Rotate(
     Axes rotationAxis,
     Geometry.Degree rotationAngle,
     int copiesToCreate,
     Geometry.Point rotationOrigin = null)
 {
     return(PSEntityRotater.RotateEntity(this, rotationAxis, rotationAngle, copiesToCreate, rotationOrigin));
 }
        /// <summary>
        /// Creates a new surface block at the specified origin, with the specified height, width, length
        /// and draft angle for all walls.
        /// </summary>
        /// <param name="origin">The origin at which to create the block.</param>
        /// <param name="width">The width of the block.</param>
        /// <param name="length">The length of the block.</param>
        /// <param name="height">The height of the block.</param>
        /// <param name="draftAngle">The draft angle to use for all walls.</param>
        /// <returns>The created block.</returns>
        public PSSurfaceBlock CreateBlock(
            Geometry.Point origin,
            Geometry.MM width,
            Geometry.MM length,
            Geometry.MM height,
            Geometry.Degree draftAngle)
        {
            PSSurfaceBlock block = new PSSurfaceBlock(_powerSHAPE, origin);

            block.Width       = width;
            block.Length      = length;
            block.Height      = height;
            block.DraftAngle1 = draftAngle;
            block.DraftAngle2 = draftAngle;
            block.DraftAngle3 = draftAngle;
            block.DraftAngle4 = draftAngle;
            Add(block);
            return(block);
        }
Beispiel #4
0
        /// <summary>
        /// Creates an arc from the start point, with the specified radius,
        /// and with the specified span.
        /// </summary>
        /// <param name="centre">Centre point for arc</param>
        /// <param name="start">Start point for arc</param>
        /// <param name="radius">Radius for arc</param>
        /// <param name="span">Span for arc</param>
        /// <returns>Arc created by the operation</returns>
        public PSArc CreateArcSpanExplicit(Geometry.Point centre, Geometry.Point start, double radius, Geometry.Degree span)
        {
            PSArc arc = new PSArc(_powerSHAPE, centre, start, radius, span);

            Add(arc);
            return(arc);
        }