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

    Class Point

    Index

    Constructors

    clean

    • Removes consecutive duplicate points from array within tolerance. Example: [[0,0,0], [0,0,0], [1,0,0], [1,0,0], [2,0,0]] → [[0,0,0], [1,0,0], [2,0,0]]

      Parameters

      Returns Point3[]

      Points in the array without consecutive duplicates

      remove duplicates

      true

    create

    • Creates a 3D point from X, Y, Z coordinates. Example: x=10, y=5, z=3 → [10,5,3]

      Parameters

      Returns Point3

      point 3d

      point xyz

      true

    • Creates a 2D point from X, Y coordinates. Example: x=10, y=5 → [10,5]

      Parameters

      Returns Point2

      point 3d

      point xy

      false

    • Creates logarithmic spiral points using golden angle or custom widening factor. Generates natural spiral patterns common in nature (sunflower, nautilus shell). Example: numberPoints=100, radius=10, phi=1.618 → 100 points forming outward spiral

      Parameters

      Returns Point3[]

      Specified number of points in the array along the spiral

      spiral

      true

    • Creates hexagonal grid center points on XY plane (honeycomb pattern). Grid size controlled by number of hexagons, not width/height. Example: radiusHexagon=1, nrHexagonsX=3, nrHexagonsY=3 → 9 hex centers in grid pattern

      Parameters

      Returns Point3[]

      Points in the array on the grid

      hex grid

      true

    • Creates hexagonal grid scaled to fit within specified width/height bounds (auto-calculates hex size). Returns center points and hex vertices. Supports pointy-top or flat-top orientation. Example: width=10, height=10, nrHexagonsInHeight=3 → hex grid filling 10×10 area with 3 rows

      Parameters

      Returns HexGridData

      An object containing the array of center points and an array of hexagon vertex arrays.

      scaled hex grid to fit

      false

    • Calculates normal vector from three points using cross product (perpendicular to plane). Example: p1=[0,0,0], p2=[1,0,0], p3=[0,1,0] → [0,0,1] (pointing up from XY plane)

      Parameters

      Returns Vector3

      Normal vector

      normal from 3 points

      true

    extract

    • Calculates axis-aligned bounding box containing all points (min, max, center, width, height, length). Example: points=[[0,0,0], [10,5,3]] → {min:[0,0,0], max:[10,5,3], center:[5,2.5,1.5], width:10, height:5, length:3}

      Parameters

      Returns BoundingBox

      Bounding box of points

      bounding box pts

      true

    • Calculates distance to the nearest point in a collection. Example: point=[0,0,0], points=[[5,0,0], [10,0,0], [3,0,0]] → 3 (distance to [3,0,0])

      Parameters

      Returns number

      Distance to closest point

      distance to closest pt

      false

    • Finds array index of the nearest point in a collection (1-based index, not 0-based). Example: point=[0,0,0], points=[[5,0,0], [10,0,0], [3,0,0]] → 3 (index of [3,0,0])

      Parameters

      Returns number

      Closest point index

      index of closest pt

      false

    • Finds the nearest point in a collection to a reference point. Example: point=[0,0,0], points=[[5,0,0], [10,0,0], [3,0,0]] → [3,0,0]

      Parameters

      Returns Point3

      Closest point

      closest pt

      true

    • Calculates centroid (average position) of multiple points. Example: points=[[0,0,0], [10,0,0], [10,10,0]] → [6.67,3.33,0]

      Parameters

      Returns Point3

      point

      average point

      true

    fillet

    • Calculates the maximum possible fillet radius at a corner formed by two line segments sharing an endpoint (C), such that the fillet arc is tangent to both segments and lies entirely within them.

      Parameters

      Returns number

      the maximum fillet radius

      max fillet radius

      false

    • Calculates the maximum possible fillet radius at a corner C, such that the fillet arc is tangent to both segments (P1-C, P2-C) and the tangent points lie within the first half of each segment (measured from C).

      Parameters

      Returns number

      the maximum fillet radius

      max fillet radius half line

      false

    • Calculates the maximum possible fillet radius at each corner of a polyline formed by formed by a series of points. The fillet radius is calculated for each internal corner and optionally for the closing corners if the polyline is closed.

      Parameters

      Returns number[]

      Array of maximum fillet radii for each corner

      max fillets half line

      false

    • Calculates the single safest maximum fillet radius that can be applied uniformly to all corners of collection of points, based on the 'half-line' constraint. This is determined by finding the minimum of the maximum possible fillet radii calculated for each individual corner.

      Parameters

      Returns number

      The smallest value from the results of pointsMaxFilletsHalfLine. Returns 0 if the polyline has fewer than 3 points or if any calculated maximum radius is 0.

      safest fillet radii points

      false

    get

    • Extracts X coordinate from a point. Example: point=[5,10,3] → 5

      Parameters

      Returns number

      X coordinate

      x coord

      false

    • Extracts Y coordinate from a point. Example: point=[5,10,3] → 10

      Parameters

      Returns number

      Y coordinate

      y coord

      false

    • Extracts Z coordinate from a point. Example: point=[5,10,3] → 3

      Parameters

      Returns number

      Z coordinate

      z coord

      false

    measure

    • Calculates Euclidean distance between two points. Example: start=[0,0,0], end=[3,4,0] → 5 (using Pythagorean theorem: √(3²+4²))

      Parameters

      Returns number

      Distance

      distance

      false

    • Calculates distances from a start point to multiple end points. Example: start=[0,0,0], endPoints=[[3,0,0], [0,4,0], [5,0,0]] → [3, 4, 5]

      Parameters

      Returns number[]

      Distances

      distances to points

      false

    • Checks if two points are approximately equal within tolerance (distance-based comparison). Example: point1=[1.0000001, 2.0, 3.0], point2=[1.0, 2.0, 3.0], tolerance=1e-6 → true

      Parameters

      Returns boolean

      true if the points are almost equal

      two points almost equal

      false

    sort

    • Sorts points lexicographically (by X, then Y, then Z coordinates). Example: [[5,0,0], [1,0,0], [3,0,0]] → [[1,0,0], [3,0,0], [5,0,0]]

      Parameters

      Returns Point3[]

      sorted points

      sort points

      true

    transforms

    • Applies transformation matrix to a single point (rotates, scales, or translates). Example: point=[0,0,0] with translation [5,5,0] → [5,5,0]

      Parameters

      Returns Point3

      Transformed point

      transform point

      true

    • Applies same transformation matrix to multiple points (batch transform). Example: 5 points with rotation 90° → all 5 points rotated together

      Parameters

      Returns Point3[]

      Transformed points

      transform points

      true

    • Applies different transformation matrices to corresponding points (one transform per point). Arrays must have equal length. Example: 3 points with 3 different translations → each point moved independently

      Parameters

      Returns Point3[]

      Transformed points

      transforms for points

      true

    • Moves multiple points by a translation vector (same offset for all points). Example: points=[[0,0,0], [1,0,0]], translation=[5,5,0] → [[5,5,0], [6,5,0]]

      Parameters

      Returns Point3[]

      Translated points

      translate points

      true

    • Moves multiple points by corresponding translation vectors (one vector per point). Arrays must have equal length. Example: 3 points with 3 different vectors → each point moved by its corresponding vector

      Parameters

      Returns Point3[]

      Translated points

      translate points with vectors

      true

    • Moves multiple points by separate X, Y, Z values (convenience method for translation). Example: points=[[0,0,0]], x=10, y=5, z=0 → [[10,5,0]]

      Parameters

      Returns Point3[]

      Translated points

      translate xyz points

      true

    • Scales multiple points around a center point with different factors per axis. Example: points=[[10,0,0]], center=[5,0,0], scaleXyz=[2,1,1] → [[15,0,0]] (doubles X distance from center)

      Parameters

      Returns Point3[]

      Scaled points

      scale points on center

      true

    • Stretches multiple points along a direction from a center point (directional scaling). Example: points=[[10,0,0]], center=[0,0,0], direction=[1,0,0], scale=2 → [[20,0,0]]

      Parameters

      Returns Point3[]

      Stretched points

      stretch points dir from center

      true

    • Rotates multiple points around a center point along a custom axis. Example: points=[[10,0,0]], center=[0,0,0], axis=[0,1,0], angle=90° → [[0,0,-10]]

      Parameters

      Returns Point3[]

      Rotated points

      rotate points center axis

      true

    • Duplicates a point N times (creates array with N copies of the same point). Example: point=[5,5,0], amountOfPoints=3 → [[5,5,0], [5,5,0], [5,5,0]]

      Parameters

      • inputs: MultiplyPointDto

        The point to be multiplied and the amount of points to create

      Returns Point3[]

      Distance

      multiply point

      true