bitbybit.dev v1.0.0-rc.1
    Preparing search index...

    Class MeshBitByBit

    Index

    Constructors

    base

    • Calculates signed distance from a point to a plane (positive=above plane, negative=below). Example: point=[0,5,0], plane={normal:[0,1,0], d:0} → 5 (point is 5 units above XZ plane)

      Parameters

      Returns number

      signed distance

      signed dist to plane

      false

    mesh

    • Calculates all intersection segments between two triangle meshes (pairwise triangle tests). Returns array of line segments where mesh surfaces intersect. Example: cube mesh intersecting with sphere mesh → multiple segments forming intersection curve

      Parameters

      Returns Segment3[]

      array of intersection segments

      mesh-mesh int segments

      false

    • Calculates intersection polylines between two meshes by sorting segments into connected paths. Segments are joined end-to-end to form continuous or closed curves. Example: cube-sphere intersection → closed polyline loops where surfaces meet

      Parameters

      Returns Polyline3[]

      array of intersection polylines

      mesh-mesh int polylines

      true

    • Calculates intersection points between two meshes as point arrays (one array per polyline). Closed polylines have first point duplicated at end. Example: cube-sphere intersection → arrays of points defining intersection curves

      Parameters

      Returns Point3[][]

      array of intersection points

      mesh-mesh int points

      false

    traingle

    • Calculates plane equation from triangle vertices (normal vector and distance from origin). Returns undefined if triangle is degenerate (zero area, collinear points). Example: triangle=[[0,0,0], [1,0,0], [0,1,0]] → {normal:[0,0,1], d:0} (XY plane)

      Parameters

      Returns TrianglePlane3

      triangle plane

      triangle plane

      false

    • Calculates intersection segment of two triangles (line segment where they cross). Returns undefined if triangles don't intersect, are parallel, or are coplanar. Example: triangle1=[[0,0,0], [2,0,0], [1,2,0]], triangle2=[[1,-1,1], [1,1,1], [1,1,-1]] → [[1,0,0], [1,1,0]]

      Parameters

      Returns Segment3

      intersection segment or undefined if no intersection

      triangle-triangle int

      false