m3sh.obj.

CSType#

class CSType(parm, inds, degree, type='bspline', rational=False)#

Wrapper class for cstype statements.

Represents a subset of the freeform curve and surface statements found in the Alias/Wavefront OBJ specification, see here or Appendix B of the Advanced Visualizer Manual for details. This class serves as a link between Wavefront OBJ files and application code. Supports import and export of curves and surfaces in Bézier and B-spline representation.

Parameters:
parmtuple[list[float]]

Knot vector(s).

indslist[ndarray]

Control points indices (absolute, 0-based).

degreetuple[int]

Degree.

typestring

Either

rationalbool

Indicates that the last entry of control point coordinates serves as a weight.

Raises:
ValueError

If invalid values for cstype are given.

Notes

Control points of rational curves and surface are of the form \((x, y, z, w)\) where \((x, y, z)\) are Euclidian coordinates and \(w\) acts as a weight. The Wavefront OBJ specification does not prohibit the use of negative or zero weights.

Attributes

Methods

bezier(b, *args)

Initialize Bézier curve/surface.

bspline(t, c, k, *args)

Initialize B-spline curve/surface.

cparray(points)

Control point array.