| |
- Crv
-
- Arc
- Line
- Polyline
- UnitCircle
-
- Circle
class Arc(Crv) |
|
NURBS representation of a arc in the xy plan
with given radius (default = 1.) and optional center,
start angle (default = 0) and end angle. (default = 2*pi) |
|
- __call__(self, *args) from Crv
- __init__(self, radius=1.0, center=None, sang=0.0, eang=6.2831853071795862)
- __repr__(self) from Crv
- bezier(self, update=None) from Crv
- bounds(self) from Crv
- degelev(self, degree) from Crv
- kntins(self, uknots) from Crv
- plot(self, n=25) from Crv
- pnt3D(self, ut) from Crv
- pnt4D(self, ut) from Crv
- reverse(self) from Crv
- trans(self, mat) from Crv
|
class Circle(UnitCircle) |
|
NURBS representation of a circle in the xy plan
with given radius (default = .5) and optional center. |
|
- __call__(self, *args) from Crv
- __init__(self, radius=0.5, center=None)
- __repr__(self) from Crv
- bezier(self, update=None) from Crv
- bounds(self) from Crv
- degelev(self, degree) from Crv
- kntins(self, uknots) from Crv
- plot(self, n=25) from Crv
- pnt3D(self, ut) from Crv
- pnt4D(self, ut) from Crv
- reverse(self) from Crv
- trans(self, mat) from Crv
|
class Crv |
|
Construct a NURB curve and check the format.
The NURB curve is represented by a 4 dimensional b-spline.
INPUT:
cntrl - Control points, homogeneous coordinates (wx,wy,wz,w)
[dim,nu] matrix
dim is the dimension valid options are:
2 .... (x,y) 2D cartesian coordinates
3 .... (x,y,z) 3D cartesian coordinates
4 .... (wx,wy,wz,w) 4D homogeneous coordinates
uknots - Knot sequence along the parametric u direction.
NOTES:
Its assumed that the input knot sequences span the
interval [0.0,1.0] and are clamped to the control
points at the end by a knot multiplicity equal to
the spline order. |
|
- __call__(self, *args)
- __init__(self, cntrl, uknots)
- __repr__(self)
- bezier(self, update=None)
- Decompose curve to bezier segments and return overlaping control points
- bounds(self)
- Return the boundingbox for the curve
- degelev(self, degree)
- Degree elevate the curve
- kntins(self, uknots)
- Insert new knots into the curve
NOTE: No knot multiplicity will be increased beyond the order of the spline
- plot(self, n=25)
- A simple plotting function for debugging purpose
n = number of subdivisions.
Depends on the dislin plotting library.
- pnt3D(self, ut)
- Evaluate parametric point[s] and return 3D cartesian coordinate[s]
- pnt4D(self, ut)
- Evaluate parametric point[s] and return 4D homogeneous coordinates
- reverse(self)
- Reverse evaluation direction
- trans(self, mat)
- Apply the 4D transform matrix to the NURB control points.
|
class Line(Crv) |
|
A straight line segment
Example: c = Line([0,0],[1,1]) |
|
- __call__(self, *args) from Crv
- __init__(self, p1=(0, 0, 0), p2=(1, 0, 0))
- __repr__(self) from Crv
- bezier(self, update=None) from Crv
- bounds(self) from Crv
- degelev(self, degree) from Crv
- kntins(self, uknots) from Crv
- plot(self, n=25) from Crv
- pnt3D(self, ut) from Crv
- pnt4D(self, ut) from Crv
- reverse(self) from Crv
- trans(self, mat) from Crv
|
class Polyline(Crv) |
|
A polyline
Example: c = Polyline([[0,0],[5,2],[10,8]]) |
|
- __call__(self, *args) from Crv
- __init__(self, pnts)
- __repr__(self) from Crv
- bezier(self, update=None) from Crv
- bounds(self) from Crv
- degelev(self, degree) from Crv
- kntins(self, uknots) from Crv
- plot(self, n=25) from Crv
- pnt3D(self, ut) from Crv
- pnt4D(self, ut) from Crv
- reverse(self) from Crv
- trans(self, mat) from Crv
|
|