Intersect

verb.eval.Intersect

CLASS

Source code

Intersect provides various tools for all kinds of intersection. This includes but not limited to:

Under the hood, most of these algorithms call the recursive bounding box intersection algorithm (Intersect.boundingBoxTrees<T1, T2>) followed by some kind of minimization.

surfaces

STATIC METHOD

Source code

surfaces(surface0 : NurbsSurfaceData, surface1 : NurbsSurfaceData, tol : Float) : Array<NurbsCurveData>

Intersect two NURBS surfaces, yielding a list of curves

params

returns

surfacesAtPointWithEstimate

STATIC METHOD

Source code

surfacesAtPointWithEstimate(surface0 : NurbsSurfaceData, surface1 : NurbsSurfaceData, uv1 : UV, uv2 : UV, tol : Float) : SurfaceSurfaceIntersectionPoint

Refine a pair of surface points to a point where the two surfaces intersect

params

returns

meshes

STATIC METHOD

Source code

meshes(mesh0 : MeshData, mesh1 : MeshData, bbtree0 : IBoundingBoxTree<Int>, bbtree1 : IBoundingBoxTree<Int>) : Array<Array<MeshIntersectionPoint>>

Intersect two meshes, yielding a list of polylines

params

returns

meshSlices

STATIC METHOD

Source code

meshSlices(mesh : MeshData, min : Float, max : Float, step : Float) : Array<Array<Array<MeshIntersectionPoint>>>

Slice a mesh by repeated planar intersections yielding a sequence of polylines. Each plane is along the z axis, so you'll need to transform your mesh if you wish to cut in any other direction.

params

returns

makeMeshIntersectionPolylines

STATIC METHOD

Source code

makeMeshIntersectionPolylines(segments : Array<Interval<MeshIntersectionPoint>>) : Array<Array<MeshIntersectionPoint>>

Given a list of unstructured mesh intersection segments, reconstruct into polylines

params

returns

lookupAdjacentSegment

STATIC METHOD

Source code

lookupAdjacentSegment(segEnd : MeshIntersectionPoint, tree : KdTree<MeshIntersectionPoint>, numResults : Int)

Given a segment end

params

returns

curveAndSurface

STATIC METHOD

Source code

curveAndSurface(curve : NurbsCurveData, surface : NurbsSurfaceData, tol : Float, e-3 : undefined, crvBbTree : IBoundingBoxTree<NurbsCurveData>, srfBbTree : IBoundingBoxTree<NurbsSurfaceData>) : Array<CurveSurfaceIntersection>

Get the intersection of a NURBS curve and a NURBS surface without an estimate

params

returns

curveAndSurfaceWithEstimate

STATIC METHOD

Source code

curveAndSurfaceWithEstimate(curve : NurbsCurveData, surface : NurbsSurfaceData, start_params : Array<Float>, tol : Float, e-3 : undefined) : CurveSurfaceIntersection

Refine an intersection pair for a surface and curve given an initial guess. This is an unconstrained minimization, so the caller is responsible for providing a very good initial guess.

params

returns

polylineAndMesh

STATIC METHOD

Source code

polylineAndMesh(polyline : PolylineData, mesh : MeshData, tol : Float) : Array<PolylineMeshIntersection>

Approximate the intersection of a polyline and mesh while maintaining parameter information

params

returns

curves

STATIC METHOD

Source code

curves(curve1 : NurbsCurveData, curve2 : NurbsCurveData, tolerance : Float) : Array<CurveCurveIntersection>

Approximate the intersection of two NURBS curves

params

returns

triangles

STATIC METHOD

Source code

triangles(mesh0 : MeshData, faceIndex0 : Int, mesh1 : MeshData, faceIndex1 : Int) : Interval<MeshIntersectionPoint>

Intersect two triangles

params

returns

clipRayInCoplanarTriangle

STATIC METHOD

Source code

clipRayInCoplanarTriangle(ray : Ray, mesh : MeshData, faceIndex : Int) : Interval<CurveTriPoint>

mergeTriangleClipIntervals

STATIC METHOD

Source code

mergeTriangleClipIntervals(clip1 : Interval<CurveTriPoint>, clip2 : Interval<CurveTriPoint>, mesh1 : MeshData, faceIndex1 : Int, mesh2 : MeshData, faceIndex2 : Int) : Interval<MeshIntersectionPoint>

planes

STATIC METHOD

Source code

planes(origin0 : Point, normal0 : Vector, origin1 : Point, normal1 : Vector) : Ray

Intersect two planes, yielding a Ray

params

returns

threePlanes

STATIC METHOD

Source code

threePlanes(n0 : Point, d0 : Float, n1 : Point, d1 : Float, n2 : Point, d2 : Float) : Point

Intersect three planes, expects the planes to form a single point of intersection

params

returns

polylines

STATIC METHOD

Source code

polylines(polyline0 : PolylineData, polyline1 : PolylineData, tol : Float) : Array<CurveCurveIntersection>

Intersect two polyline curves, keeping track of parameterization on each

params

returns

segments

STATIC METHOD

Source code

segments(a0 : Point, a1 : Point, b0 : Point, b1 : Point, tol : Float) : CurveCurveIntersection

Find the closest parameter on two rays, see http://geomalgorithms.com/a07-_distance.html

params

returns

rays

STATIC METHOD

Source code

rays(a0 : Point, a : Point, b0 : Point, b : Point) : CurveCurveIntersection

Find the closest parameter on two rays, see http://geomalgorithms.com/a07-_distance.html

params

returns

segmentWithTriangle

STATIC METHOD

Source code

segmentWithTriangle(p0 : Point, p1 : Point, points : Array<Point>, tri : Tri) : TriSegmentIntersection

Intersect segment with triangle (from http://geomalgorithms.com/a06-_intersect-2.html)

params

returns

segmentAndPlane

STATIC METHOD

Source code

segmentAndPlane(p0 : Point, p1 : Point, v0 : Point, n : Point)

Intersect ray/segment with plane (from http://geomalgorithms.com/a06-_intersect-2.html)

If intersecting a ray, the param needs to be between 0 and 1 and the caller is responsible for making that check

params

returns null or an object with a p property representing the param on the segment

IBoundingBoxTree

verb.eval.IBoundingBoxTree<T>

INTERFACE

Source code

boundingBox

METHOD

Source code

boundingBox() : BoundingBox

split

METHOD

Source code

split() : Pair<IBoundingBoxTree<T>, IBoundingBoxTree<T>>

yield

METHOD

Source code

yield() : T

indivisible

METHOD

Source code

indivisible(tolerance : Float) : Bool

empty

METHOD

Source code

empty() : Bool