Tess

verb.eval.Tess

CLASS

Source code

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

Source code

rationalCurveRegularSample(curve : NurbsCurveData, numSamples : Int, includeU : Bool) : Array<Point>

Sample a NURBS curve at equally spaced parametric intervals

params

returns

rationalCurveRegularSampleRange

STATIC METHOD

Source code

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

returns

rationalCurveAdaptiveSample

STATIC METHOD

Source code

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

returns

rationalCurveAdaptiveSampleRange

STATIC METHOD

Source code

rationalCurveAdaptiveSampleRange(curve : NurbsCurveData, start : undefined, end : undefined, tol : undefined, includeU : undefined) : Array<Point>

Sample a NURBS curve at 3 points, facilitating adaptive sampling

params

returns

rationalSurfaceNaive

STATIC METHOD

Source code

rationalSurfaceNaive(surface : NurbsSurfaceData, divs_u : Int, divs_v : Int) : MeshData

Tessellate a NURBS surface on equal spaced intervals in the parametric domain

params

returns

divideRationalSurfaceAdaptive

STATIC METHOD

Source code

divideRationalSurfaceAdaptive(surface : NurbsSurfaceData, options : AdaptiveRefinementOptions) : Array<AdaptiveRefinementNode>

Divide a NURBS surface int equal spaced intervals in the parametric domain as AdaptiveRefinementNodes

params

returns

rationalSurfaceAdaptive

STATIC METHOD

Source code

rationalSurfaceAdaptive(surface : NurbsSurfaceData, options : AdaptiveRefinementOptions) : MeshData

AdaptiveRefinementOptions

verb.eval.AdaptiveRefinementOptions

CLASS

Source code

constructor

METHOD

Source code

new AdaptiveRefinementOptions()

normTol

PROPERTY

Source code

normTol : Float

minDepth

PROPERTY

Source code

minDepth : Int

maxDepth

PROPERTY

Source code

maxDepth : Int

refine

PROPERTY

Source code

refine : Bool

minDivsU

PROPERTY

Source code

minDivsU : Int

minDivsV

PROPERTY

Source code

minDivsV : Int

AdaptiveRefinementNode

verb.eval.AdaptiveRefinementNode

CLASS

Source code

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

Source code

new AdaptiveRefinementNode(srf : NurbsSurfaceData, corners : Array<SurfacePoint>, neighbors : Array<AdaptiveRefinementNode>)

isLeaf

METHOD

Source code

isLeaf()

center

METHOD

Source code

center()

evalCorners

METHOD

Source code

evalCorners()

evalSrf

METHOD

Source code

evalSrf(u : Float, v : Float, srfPt : SurfacePoint) : SurfacePoint

getEdgeCorners

METHOD

Source code

getEdgeCorners(edgeIndex : Int) : Array<SurfacePoint>

getAllCorners

METHOD

Source code

getAllCorners(edgeIndex : Int) : Array<SurfacePoint>

midpoint

METHOD

Source code

midpoint(index : undefined)

hasBadNormals

METHOD

Source code

hasBadNormals() : Bool

fixNormals

METHOD

Source code

fixNormals() : Void

shouldDivide

METHOD

Source code

shouldDivide(options : AdaptiveRefinementOptions, currentDepth : Int)

divide

METHOD

Source code

divide(options : AdaptiveRefinementOptions) : Void

triangulate

METHOD

Source code

triangulate(mesh : MeshData) : MeshData

triangulateLeaf

METHOD

Source code

triangulateLeaf(mesh : MeshData) : MeshData

neighbors

PROPERTY

Source code

neighbors : Array<AdaptiveRefinementNode>