Make
verb.eval.Make
CLASS
Make
provides algorithms for generating NURBS representations of various special surfaces and curves. One of the very
desirable properties of NURBS is the ability to represent common curve types like conics in NURBS. As a result, verb
is able to represent many curve types with exceptional economy as many of the algorithms (for example, for intersection)
can be reused.
This class includes methods for building:
- conics
- polylines
- lofts
- swept surfaces
Many of these algorithms owe their implementation to Piegl & Tiller's "The NURBS Book"
rationalTranslationalSurface
STATIC METHOD
rationalTranslationalSurface(profile : NurbsCurveData, rail : NurbsCurveData) : NurbsSurfaceData
Generate a surface by translating a profile curve along a rail curve
params
- profile NurbsCurveData
- rail NurbsCurveData
returns
- NurbsSurfaceData object
surfaceBoundaryCurves
STATIC METHOD
surfaceBoundaryCurves(surface : NurbsSurfaceData) : Array<NurbsCurveData>
Extract the boundary curves from a surface
returns
- an array containing 4 elements, first 2 curves in the V direction, then 2 curves in the U direction
surfaceIsocurve
STATIC METHOD
surfaceIsocurve(surface : NurbsSurfaceData, u : Float, useV : Bool) : NurbsCurveData
loftedSurface
STATIC METHOD
loftedSurface(curves : Array<NurbsCurveData>, degreeV : Int) : NurbsSurfaceData
clonedCurve
STATIC METHOD
clonedCurve(curve : NurbsCurveData) : NurbsCurveData
rationalBezierCurve
STATIC METHOD
rationalBezierCurve(controlPoints : Array<Point>, weights : Array<Float>) : NurbsCurveData
Generate the control points, weights, and knots for a bezier curve of any degree
params
- first point in counter-clockwise form
- second point in counter-clockwise form
- third point in counter-clockwise form
- forth point in counter-clockwise form
returns
- NurbsSurfaceData object
fourPointSurface
STATIC METHOD
fourPointSurface(p1 : Point, p2 : Point, p3 : Point, p4 : Point, degree : Int) : NurbsSurfaceData
Generate the control points, weights, and knots of a surface defined by 4 points
params
- first point in counter-clockwise form
- second point in counter-clockwise form
- third point in counter-clockwise form
- forth point in counter-clockwise form
returns
- NurbsSurfaceData object
ellipseArc
STATIC METHOD
ellipseArc(center : Point, xaxis : Point, yaxis : Point, startAngle : Float, endAngle : Float) : NurbsCurveData
Generate the control points, weights, and knots of an elliptical arc
params
- the center
- the scaled x axis
- the scaled y axis
- start angle of the ellipse arc, between 0 and 2pi, where 0 points at the xaxis
- end angle of the arc, between 0 and 2pi, greater than the start angle
returns
- a NurbsCurveData object representing a NURBS curve
arc
STATIC METHOD
arc(center : Point, xaxis : Vector, yaxis : Vector, radius : Float, startAngle : Float, endAngle : Float) : NurbsCurveData
Generate the control points, weights, and knots of an arbitrary arc (Corresponds to Algorithm A7.1 from Piegl & Tiller)
params
- the center of the arc
- the xaxis of the arc
- orthogonal yaxis of the arc
- radius of the arc
- start angle of the arc, between 0 and 2pi
- end angle of the arc, between 0 and 2pi, greater than the start angle
returns
- a NurbsCurveData object representing a NURBS curve
polyline
STATIC METHOD
polyline(pts : Array<Point>) : NurbsCurveData
Generate the control points, weights, and knots of a polyline curve
params
- array of points in curve
returns
- a NurbsCurveData object representing a NURBS curve
extrudedSurface
STATIC METHOD
extrudedSurface(axis : Point, length : Float, profile : NurbsCurveData) : NurbsSurfaceData
Generate the control points, weights, and knots of an extruded surface
params
- axis of the extrusion
- length of the extrusion
- a NurbsCurveData object representing a NURBS surface
returns
- an object with the following properties: controlPoints, weights, knots, degree
cylindricalSurface
STATIC METHOD
cylindricalSurface(axis : Point, xaxis : Point, base : Point, height : Float, radius : Float) : NurbsSurfaceData
Generate the control points, weights, and knots of a cylinder
params
- normalized axis of cylinder
- xaxis in plane of cylinder
- position of base of cylinder
- height from base to top
- radius of the cylinder
returns
- an object with the following properties: controlPoints, weights, knotsU, knotsV, degreeU, degreeV
revolvedSurface
STATIC METHOD
revolvedSurface(profile : NurbsCurveData, center : Point, axis : Point, theta : Float) : NurbsSurfaceData
Generate the control points, weights, and knots of a revolved surface (Corresponds to Algorithm A7.1 from Piegl & Tiller)
params
- center of the rotation axis
- axis of the rotation axis
- angle to revolve around axis
- degree of the generatrix
- control points of the generatrix
- weights of the generatrix
returns
- an object with the following properties: controlPoints, weights, knots, degree
sphericalSurface
STATIC METHOD
sphericalSurface(center : Point, axis : Point, xaxis : Point, radius : Float)
Generate the control points, weights, and knots of a sphere
params
- the center of the sphere
- normalized axis of sphere
- vector perpendicular to axis of sphere, starting the rotation of the sphere
- radius of the sphere
returns
- an object with the following properties: controlPoints, weights, knotsU, knotsV, degreeU, degreeV
conicalSurface
STATIC METHOD
conicalSurface(axis : Point, xaxis : Point, base : Point, height : Float, radius : Float) : NurbsSurfaceData
Generate the control points, weights, and knots of a cone
params
- normalized axis of cone
- position of base of cone
- height from base to tip
- radius at the base of the cone
returns
- an object with the following properties: controlPoints, weights, knots, degree
rationalInterpCurve
STATIC METHOD
rationalInterpCurve(points : Array<Array<Float>>, degree : Int, homogeneousPoints : Bool, start_tangent : Point, end_tangent : Point) : NurbsCurveData