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(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(self, **kwds)¶
 
Creates an empty part.
- param **kwds
 Part attributes like name, position, color…
- returns
 Part
- createPointPart(self, **kwds)¶
 
Creates a point part.
- param **kwds
 Part attributes like name, location, color…
- returns
 Part
- 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(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(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(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(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(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(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(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(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(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(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