CSPrimCurve

class CSXCAD.CSPrimitives.CSPrimCurve

Bases: CSPrimitives

Curve Primitive

A curve is a set of consequtive 3D coordinates.

Parameters:
points(3, N) array

Array of 3D coordinates.

Examples

>>> x = np.array([0, 0, 1, 1]) + 1.5
>>> y = np.array([0, 1, 1, 0]) + 2.5
>>> z = np.array([0, 1, 3, 4])
>>> curve = CSPrimitives.CSPrimCurve(pset, metal, points=[x,y,z])
>>> curve.AddPoint([2, 0, 5])
AddPoint(point)

Add a single point to the list.

Parameters:

point – (3,) array – Add a single 3D point

ClearPoints()

Clear all points.

GetNumberOfPoints()

Get the number of points.

Return num:

int – Get the number of points.

GetPoint(idx)

Get a point with a given index.

Parameters:

idx – int – Index of point requested.

Return point:

(3,) array – Point coordinate at index idx

SetPoints(x, y, z)

Set an array of 3D coordinates

Parameters:

x,y,z – each (N,) array – Array of 3D point components