Bitbybit Docs
    Preparing search index...

    Class Point

    Points as plain number arrays. A point is [x, y, z] with Y pointing up, the same shape as a vector, so the two can be passed to each other's methods; a 2D point is [x, y]. Every method returns new points or numbers and never changes its inputs. Angles are in degrees and lengths in model units.

    Index

    Constructors

    clean

    • Removes a point when it repeats the one right before it; the same point further away is kept.

      With checkFirstAndLast on, a last point that repeats the first is dropped too. Points within tolerance of each other count as the same. 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 Bit.Inputs.Base.Point3[]

      The points without consecutive repeats

      const cleaned = bitbybit.point.removeConsecutiveDuplicates({
      points: [[0, 0, 0], [0, 0, 0], [1, 0, 0]],
      tolerance: 1e-7,
      checkFirstAndLast: false,
      });

    create

    • Builds a 3D point from its x, y and z values.

      Example: x=10, y=5, z=3 -> [10,5,3]

      Parameters

      Returns Bit.Inputs.Base.Point3

      The point [x, y, z]

      const point = bitbybit.point.pointXYZ({ x: 10, y: 5, z: 3 });
      
    • Builds a 2D point from its x and y values.

      Example: x=10, y=5 -> [10,5]

      Parameters

      Returns Bit.Inputs.Base.Point2

      The point [x, y]

      const point = bitbybit.point.pointXY({ x: 10, y: 5 });