# 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.

## Method Details¶

createCurves(self, points, **kwds)

Creates and returns a list of parts containing curve connecting the points.

If curve doesn’t self-intersect, will return a curve part.

If line does self-intersect, will return a curve part for each section.

param points: list of points to create curve. list[Point],list[tuple],list[list] Part properties like material, color, name… Created curve part. list [Part]
createEmptyPart(self, **kwds)

Creates an empty part.

param **kwds: To set part properties like material, color, mass, name … Created empty part. Part
createPointPart(self, **kwds)

Creates and returns a point part with a vertex feature.

Used to create a concentrated mass.

param **kwds: Part properties like material, color, name … Created point part. Part
createPolylines(self, points, **kwds)

Creates and returns a list of parts containing line that connects the points.

If the line doesn’t self-intersect, will returns a polyline part.

If the line does self-intersect, will contain a line part for each section.

param points: List of points to create line. list[Point], list[tuple], list[list] Part properties like material, color, name … Created poly lines. list[Part]
createSheetCircle(self, radius=1, **kwds)

Create a new part containing a circle with centre at the origin in the xy plane.

param radius: Size in xy plane. Must be > 0. int, float Part properties like material, color, name … Created sheet part. Part
createSheetPolygon(self, radius=1, nsides=3, **kwds)

Create a new part containing a regular polygon with centre at the origin in the XY plane.

param radius: Size in xy plane. Must be > 0. int, float Number of sides. Must be > 2. int Part properties like material, color, name … Created sheet polygon part. Part
createSheetRectangle(self, x=1, y=1, excludeFromConstructionHistory=False, **kwds)

Create a new part containing a rectangle with centre at the origin.

param x: Size in x. Must be > 0. int, float Size in y. Must be > 0. int, float Part properties like material, color, name … Created sheet rectangle part. Part
createSolidBlock(self, x=1, y=1, z=1, **kwds)

Creates a new part containing a solid block with centre of the base at origin.

param x: Provide length. int,float Provide width. int,float Provide depth. int, float Part properties like material, color, name… Created solid block. Part
createSolidCone(self, radius=1, height=1, semiangle=0, **kwds)

Create a new part containing a solid cone with centre of the base at origin.

param radius: type radius: Radius in xy plane. Must be > 0. int, float Height in +z direction. Must be > 0. int, float Semiangle in +z axis. Must be > 0 < pi/2. float Part properties like material, color, name … Created solid cone. Part
createSolidCylinder(self, radius=1, height=1, **kwds)

Create a new part containing a solid cylinder with centre of the base at origin.

param radius: Radius to cylinder. Radius in the xy plane. Must be > 0. int,float Height to cylinder. Height in the +z direction. Must be > 0. int, float Part properties like material, color, name … Created solid cylinder. Part
createSolidEllipsoid(self, xRadius=1, yRadius=0.5, zRadius=0.25, **kwds)

Create a new part containing a solid ellipsoid with centre at the origin.

param xRadius: Size in x direction. Must be > 0. int, float Size in y direction. Must be > 0. int, float Size in z direction. Must be > 0. int, float Part properties like material, color, name … Created solid ellipsoid. Part
createSolidPrism(self, radius=1, height=1, nsides=20, blendradius=0, **kwds)

Create a new part containing a solid prism with centre of the base at origin.

param radius: type radius: Radius to solid prism in the xy plane. Must be > 0. int, float Height to solid prism in the +z direction. int, float Number of facets. Must be > 2. int Radius to round the corners. int, float Part properties like material, color, name … Created solid prism. Part
createSolidSphere(self, radius=1, **kwds)

Create a new part containing a solid sphere with centre at origin.

param radius: Radius in the xy plane. Must be > 0. int, float Part properties like material, color, name … Created solid sphere. Part
createSolidTorus(self, majorRadius=1, minorRadius=0.5, **kwds)

Create a new part containing a solid torus with centre at the origin.