============================= Primitives (hwx.inspire.core) ============================= Utilites to create parts with primitive shapes. The supported primitive shapes are block, cone, polygon, ellipsoid, prism, sphere, torus and etc. -------------- Public Methods -------------- +--------------------------------------------------------------------------------+ | createCurves_ (self, points, **kwds) | +--------------------------------------------------------------------------------+ | createEmptyPart_ (self, **kwds) | +--------------------------------------------------------------------------------+ | createPointPart_ (self, **kwds) | +--------------------------------------------------------------------------------+ | createPolylines_ (self, points, **kwds) | +--------------------------------------------------------------------------------+ | createSheetCircle_ (self, radius=1, **kwds) | +--------------------------------------------------------------------------------+ | createSheetPolygon_ (self, radius=1, nsides=3, **kwds) | +--------------------------------------------------------------------------------+ | createSheetRectangle_ (self, x=1, y=1, **kwds) | +--------------------------------------------------------------------------------+ | createSolidBlock_ (self, x=1, y=1, z=1, **kwds) | +--------------------------------------------------------------------------------+ | createSolidCone_ (self, radius=1, height=1, semiangle=0, **kwds) | +--------------------------------------------------------------------------------+ | createSolidCylinder_ (self, radius=1, height=1, **kwds) | +--------------------------------------------------------------------------------+ | createSolidEllipsoid_ (self, xRadius=1, yRadius=0.5, zRadius=0.25, **kwds) | +--------------------------------------------------------------------------------+ | createSolidPrism_ (self, radius=1, height=1, nsides=20, blendradius=0, **kwds) | +--------------------------------------------------------------------------------+ | createSolidSphere_ (self, radius=1, **kwds) | +--------------------------------------------------------------------------------+ | createSolidTorus_ (self, majorRadius=1, minorRadius=0.5, **kwds) | +--------------------------------------------------------------------------------+ -------------- Method Details -------------- .. _createCurves: .. method:: createCurves(self, points, **kwds) Creates a list of SplineCurve parts that connect the points. If the points don't have intersections, creates one SplineCurve part. Otherwise, creates one SplineCurve part for each section. :param points: List of points used to create the SplineCurve part. :type points: list[math.Point] :param \*\*kwds: Part attributes like name, position, color... :returns: List of created parts. :rtype: list [Part] .. _createEmptyPart: .. method:: createEmptyPart(self, **kwds) Creates an empty part. :param \*\*kwds: Part attributes like name, position, color... :returns: Part .. _createPointPart: .. method:: createPointPart(self, **kwds) Creates a point part. :param \*\*kwds: Part attributes like name, location, color... :returns: Part .. _createPolylines: .. method:: createPolylines(self, points, **kwds) Creates a list of Polyline parts that connect the points. If the points don't have intersections, creates one Polyline part. Otherwise, creates one Polyline part for each section. :param points: List of points to create the Polyline part. :type points: list[math.Point] :param \*\*kwds: Part attributes like name, position, color... :returns: List of created parts. :rtype: list[Part] .. _createSheetCircle: .. method:: createSheetCircle(self, radius=1, **kwds) Creates a circle centered at the origin in the XY plane. :param radius: :type radius: float :param \*\*kwds: Part attributes like name, position, color... :returns: Part .. _createSheetPolygon: .. method:: createSheetPolygon(self, radius=1, nsides=3, **kwds) Creates a regular polygon centered at the origin in the XY-plane. :param radius: The distance from the center to a vertex. :type radius: float :param nsides: The number of sides. Must be > 2. :type nsides: int :param \*\*kwds: Part attributes like name, position, color... :returns: Part .. _createSheetRectangle: .. method:: createSheetRectangle(self, x=1, y=1, **kwds) Creates a rectangle centered at the origin. :param x: The length. :type x: float :param y: The width. :type y: float :param \*\*kwds: Part attributes like name, position, color... :returns: Part .. _createSolidBlock: .. method:: createSolidBlock(self, x=1, y=1, z=1, **kwds) Creates a solid block with the center of the base at the origin. :param x: The length. :type x: float :param y: The width. :type y: float :param z: The height. :type z: float :param \*\*kwds: Part attributes like name, position, color... :returns: Part .. _createSolidCone: .. method:: createSolidCone(self, radius=1, height=1, semiangle=0, **kwds) Creates a a solid cone with the base centered at the origin in the XY plane and the height extending along the z-axis. :param radius: The radius in the XY-plane. :type radius: float :param height: The height along z-axis. :type height: float :param semiangle: The angle the cone makes with the z-axis. Must be > 0 < pi/2. :type semiangle: float :param \*\*kwds: Part attributes like name, position, color... :returns: Part .. _createSolidCylinder: .. method:: createSolidCylinder(self, radius=1, height=1, **kwds) Creates a solid cylinder with the base centered at the origin in the XY plane and the height extending along the z-axis. :param radius: The radius in the XY-plane. :type radius: float :param height: The height along z-axis. :type height: float :param \*\*kwds: Part attributes like name, position, color... :returns: Part .. _createSolidEllipsoid: .. method:: createSolidEllipsoid(self, xRadius=1, yRadius=0.5, zRadius=0.25, **kwds) Creates a solid ellipsoid centered at the origin. :param xRadius: The radius in x-axis. :type xRadius: float :param yRadius: The radius in y-axis. :type yRadius: float :param zRadius: The radius in z-axis. :type zRadius: float :param \*\*kwds: Part attributes like name, position, color... :returns: Part .. _createSolidPrism: .. method:: createSolidPrism(self, radius=1, height=1, nsides=20, blendradius=0, **kwds) Creates a solid prism with the base centered at the origin in the XY plane and the height extending along the z-axis. :param radius: The radius in the XY-plane. :type radius: float :param height: The height along z-axis. :type height: float :param nsides: The number of facets. Must be > 2. :type nsides: int :param blendradius: The radius used to round the corners. :type blendradius: float :param \*\*kwds: Part attributes like name, position, color... :returns: Part .. _createSolidSphere: .. method:: createSolidSphere(self, radius=1, **kwds) Creates a solid sphere with centre at origin. :param radius: :type radius: float :param \*\*kwds: Part attributes like name, location, color... :returns: Part .. _createSolidTorus: .. method:: createSolidTorus(self, majorRadius=1, minorRadius=0.5, **kwds) Creates a solid torus centered at the origin, located in the XY-plane with the z-axis sticking through the hole. :param majorRadius: The radius from the hole's center to the rim's midline. :type majorRadius: float :param minorRadius: The radius of the cross section of the rim. Must be less than majorRadius. :type minorRadius: float :param \*\*kwds: Part attributes like name, position, color... :returns: Part