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

Creates a circle centered at the origin in the XY plane.

float

param **kwds

Part attributes like name, position, color…

returns

Part

Creates a regular polygon centered at the origin in the XY-plane.

The distance from the center to a vertex.

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

Creates a a solid cone with the base centered at the origin in the XY plane and the height extending along the z-axis.

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

Creates a solid cylinder with the base centered at the origin in the XY plane and the height extending along the z-axis.

float

param height

The height along z-axis.

type height

float

param **kwds

Part attributes like name, position, color…

returns

Part

Creates a solid ellipsoid centered at the origin.

float

float

float

param **kwds

Part attributes like name, position, color…

returns

Part

Creates a solid prism with the base centered at the origin in the XY plane and the height extending along the z-axis.

float

param height

The height along z-axis.

type height

float

param nsides

The number of facets. Must be > 2.

type nsides

int

The radius used to round the corners.

float

param **kwds

Part attributes like name, position, color…

returns

Part

Creates a solid sphere with centre at origin.

float

param **kwds

Part attributes like name, location, color…

returns

Part

Creates a solid torus centered at the origin, located in the XY-plane with the z-axis sticking through the hole.

The radius from the hole’s center to the rim’s midline.

float

The radius of the cross section of the rim. Must be less than majorRadius.