Tess
verb.eval.Tess
CLASS
Tess
contains static, immutable algorithms for tessellation of NURBS curves and sufaces. Tessellation is the decomposition
of the analytical NURBS representation into discrete meshes or polylines that are useful for drawing.
Some of these algorithms are "adaptive" - using certain heuristics to sample geometry where such samples make sense - while others are "regular" in that they sample regularly throughout a parametric domain. There are tradeoffs here. While adaptive algorithms can sometimes yield "better" results that are smaller or more economical, this can sometimes come at increased computational cost. For example, it is sometimes necessarily to compute higher order derivatives in order to obtain these more economical results. Your usage of these algorithms should consider these tradeoffs.
rationalCurveRegularSample
STATIC METHOD
rationalCurveRegularSample(curve : NurbsCurveData, numSamples : Int, includeU : Bool) : Array<Point>
Sample a NURBS curve at equally spaced parametric intervals
params
- NurbsCurveData object
- integer number of samples
- whether to prefix the point with the parameter
returns
- an array of points, prepended by the point param if required
rationalCurveRegularSampleRange
STATIC METHOD
rationalCurveRegularSampleRange(curve : NurbsCurveData, start : Float, end : Float, numSamples : Int, includeU : Bool) : Array<Point>
Sample a range of a NURBS curve at equally spaced parametric intervals
params
- NurbsCurveData object
- start parameter for sampling
- end parameter for sampling
- integer number of samples
- whether to prefix the point with the parameter
returns
- an dictionary of parameter - point pairs
rationalCurveAdaptiveSample
STATIC METHOD
rationalCurveAdaptiveSample(curve : NurbsCurveData, tol : Float, e-6 : undefined, includeU : Bool) : Array<Point>
Sample a NURBS curve over its entire domain, corresponds to this algorithm
params
- NurbsCurveData object
- tol for the adaptive scheme
- whether to prefix the point with the parameter
returns
- an array of dim + 1 length where the first element is the param where it was sampled and the remaining the pt
rationalCurveAdaptiveSampleRange
STATIC METHOD
rationalCurveAdaptiveSampleRange(curve : NurbsCurveData, start : undefined, end : undefined, tol : undefined, includeU : undefined) : Array<Point>
Sample a NURBS curve at 3 points, facilitating adaptive sampling
params
- NurbsCurveData object
- start parameter for sampling
- end parameter for sampling
- whether to prefix the point with the parameter
returns
- an array of dim + 1 length where the first element is the param where it was sampled and the remaining the pt
rationalSurfaceNaive
STATIC METHOD
rationalSurfaceNaive(surface : NurbsSurfaceData, divs_u : Int, divs_v : Int) : MeshData
Tessellate a NURBS surface on equal spaced intervals in the parametric domain
params
- NurbsSurfaceData object
- number of divisions in the u direction
- number of divisions in the v direction
returns
- MeshData object
divideRationalSurfaceAdaptive
STATIC METHOD
divideRationalSurfaceAdaptive(surface : NurbsSurfaceData, options : AdaptiveRefinementOptions) : Array<AdaptiveRefinementNode>
Divide a NURBS surface int equal spaced intervals in the parametric domain as AdaptiveRefinementNodes
params
- NurbsSurfaceData object
- SurfaceDivideOptions object
returns
- MeshData object
rationalSurfaceAdaptive
STATIC METHOD
rationalSurfaceAdaptive(surface : NurbsSurfaceData, options : AdaptiveRefinementOptions) : MeshData
AdaptiveRefinementOptions
verb.eval.AdaptiveRefinementOptions
CLASS
constructor
METHOD
new AdaptiveRefinementOptions()
normTol
PROPERTY
normTol : Float
minDepth
PROPERTY
minDepth : Int
maxDepth
PROPERTY
maxDepth : Int
refine
PROPERTY
refine : Bool
minDivsU
PROPERTY
minDivsU : Int
minDivsV
PROPERTY
minDivsV : Int
AdaptiveRefinementNode
verb.eval.AdaptiveRefinementNode
CLASS
Structure of the child nodes
in the adaptive refinement tree
v
^
|
+--> u
neighbors[2]
(u0,v1)---(u05,v1)---(u1,v1)
| | |
| 3 | 2 |
| | |
neighbors[3] (u0,v05)--(u05,v05)--(u1,v05) neighbors[1]
| | |
| 0 | 1 |
| | |
(u0,v0)---(u05,v0)---(u1,v0)
neighbors[0]
constructor
METHOD
new AdaptiveRefinementNode(srf : NurbsSurfaceData, corners : Array<SurfacePoint>, neighbors : Array<AdaptiveRefinementNode>)
isLeaf
METHOD
isLeaf()
center
METHOD
center()
evalCorners
METHOD
evalCorners()
evalSrf
METHOD
evalSrf(u : Float, v : Float, srfPt : SurfacePoint) : SurfacePoint
getEdgeCorners
METHOD
getEdgeCorners(edgeIndex : Int) : Array<SurfacePoint>
getAllCorners
METHOD
getAllCorners(edgeIndex : Int) : Array<SurfacePoint>
midpoint
METHOD
midpoint(index : undefined)
hasBadNormals
METHOD
hasBadNormals() : Bool
fixNormals
METHOD
fixNormals() : Void
shouldDivide
METHOD
shouldDivide(options : AdaptiveRefinementOptions, currentDepth : Int)
divide
METHOD
divide(options : AdaptiveRefinementOptions) : Void
triangulate
METHOD
triangulate(mesh : MeshData) : MeshData
triangulateLeaf
METHOD
triangulateLeaf(mesh : MeshData) : MeshData
neighbors
PROPERTY
neighbors : Array<AdaptiveRefinementNode>