Bitbybit Docs
    Bereite Suchindex vor...

    Klasse GeometryHelper

    Index

    Konstruktoren

    Eigenschaften

    getArrayDepth: (value: unknown) => number

    Calculates the nesting depth of an array recursively. Example: [1,2,3] → 1, [[1,2],[3,4]] → 2, [[[1]]] → 3

    Methoden

    • Applies one or more 4×4 transformation matrices to a list of points sequentially. Each transformation is applied in order (composition of transformations). Example: points=[[0,0,0], [1,0,0]] with translation [5,0,0] → [[5,0,0], [6,0,0]]

      Parameter

      Rückgabewert Point3[]

    • Applies a single 4×4 transformation matrix (as flat 16-element array) to multiple points. Example: points=[[0,0,0], [1,0,0]] with translation matrix → transformed points

      Parameter

      Rückgabewert Point3[]

    • Transforms multiple points using a transformation matrix (maps each point through the matrix). Example: points=[[1,0,0], [0,1,0]] with 90° rotation → [[0,1,0], [-1,0,0]]

      Parameter

      Rückgabewert Point3[]

    • Removes all duplicate vectors from a list (works with arbitrary-length numeric vectors). Compares vectors using tolerance for floating-point equality. Example: [[1,2], [3,4], [1,2], [5,6]] with tolerance=1e-7 → [[1,2], [3,4], [5,6]]

      Parameter

      • vectors: number[][]
      • Optionaltolerance: number

      Rückgabewert number[][]

    • Removes consecutive duplicate vectors from a list (keeps only first occurrence in each sequence). Optionally checks and removes duplicate if first and last vectors match. Example: [[1,2], [1,2], [3,4], [3,4], [5,6]] → [[1,2], [3,4], [5,6]]

      Parameter

      • vectors: number[][]
      • OptionalcheckFirstAndLast: boolean
      • Optionaltolerance: number

      Rückgabewert number[][]

    • Compares two vectors for approximate equality using tolerance (element-wise comparison). Returns false if vectors have different lengths. Example: [1.0000001, 2.0], [1.0, 2.0] with tolerance=1e-6 → true

      Parameter

      • vec1: number[]
      • vec2: number[]
      • tolerance: number

      Rückgabewert boolean

    • Checks if two numbers are approximately equal within a tolerance. Example: 1.0000001, 1.0 with tolerance=1e-6 → true, 1.001, 1.0 with tolerance=1e-6 → false

      Parameter

      • num1: number
      • num2: number
      • tolerance: number

      Rückgabewert boolean

    • Removes consecutive duplicate points from a list (specialized for 3D/2D points). Optionally checks and removes duplicate if first and last points match (for closed loops). Example: [[0,0,0], [0,0,0], [1,0,0], [1,0,0]] → [[0,0,0], [1,0,0]]

      Parameter

      • points: Point3[]
      • OptionalcheckFirstAndLast: boolean
      • Optionaltolerance: number

      Rückgabewert Point3[]

    • Checks if two points are approximately equal using tolerance (supports 2D and 3D points). Example: [1.0000001, 2.0, 3.0], [1.0, 2.0, 3.0] with tolerance=1e-6 → true

      Parameter

      Rückgabewert boolean