Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Polyline

Index

Constructors

constructor

Methods

countPoints

  • Counts number of points in polyline. Example: polyline with points=[[0,0,0], [1,0,0], [1,1,0]] → 3

    group

    get

    shortname

    nr polyline points

    drawable

    false

    Parameters

    Returns number

    nr of points

create

  • Creates a polyline from points array with optional isClosed flag. Example: points=[[0,0,0], [1,0,0], [1,1,0]], isClosed=true → {points:..., isClosed:true}

    group

    create

    shortname

    polyline

    drawable

    true

    Parameters

    Returns PolylinePropertiesDto

    polyline

getPoints

  • Extracts points array from polyline object. Example: polyline={points:[[0,0,0], [1,0,0]]} → [[0,0,0], [1,0,0]]

    group

    get

    shortname

    points

    drawable

    true

    Parameters

    Returns Point3[]

    points

length

  • Calculates total length of polyline by summing distances between consecutive points. Example: points=[[0,0,0], [3,0,0], [3,4,0]] → 3 + 4 = 7

    group

    get

    shortname

    polyline length

    drawable

    false

    Parameters

    Returns number

    length

maxFilletsHalfLine

  • Calculates the maximum possible half-line fillet radius for each corner of a given polyline. For a closed polyline, it includes the corners connecting the last segment back to the first.

    The calculation uses the 'half-line' constraint, meaning the fillet's tangent points must lie within the first half of each segment connected to the corner.

    group

    fillet

    shortname

    polyline max fillet radii

    drawable

    false

    Parameters

    • inputs: PolylineToleranceDto

      Defines the polyline points, whether it's closed, and an optional tolerance.

    Returns number[]

    An array containing the maximum fillet radius calculated for each corner. The order corresponds to corners P[1]...P[n-2] for open polylines, and P[1]...P[n-2], P[0], P[n-1] for closed polylines. Returns an empty array if the polyline has fewer than 3 points.

polylineSelfIntersection

  • Finds points where polyline crosses itself (self-intersection points). Skips adjacent segments and deduplicates close points. Example: figure-8 shaped polyline → returns center crossing point

    group

    intersections

    shortname

    polyline self intersections

    drawable

    true

    Parameters

    Returns Point3[]

    polyline

polylineToLines

  • Converts polyline to line segments (each segment as line object with start/end). Closed polylines include closing segment. Example: 3 points → 2 or 3 lines (depending on isClosed)

    group

    convert

    shortname

    polyline to lines

    drawable

    true

    Parameters

    Returns Line3[]

    lines

polylineToSegments

  • Converts polyline to segment arrays (each segment as [point1, point2]). Closed polylines include closing segment if endpoints differ. Example: 4 points, closed → 4 segments connecting all points in a loop

    group

    convert

    shortname

    polyline to segments

    drawable

    false

    Parameters

    Returns Segment3[]

    segments

reverse

  • Reverses point order of polyline (flips direction). Example: points=[[0,0,0], [1,0,0], [2,0,0]] → [[2,0,0], [1,0,0], [0,0,0]]

    group

    convert

    shortname

    reverse polyline

    drawable

    true

    Parameters

    Returns PolylinePropertiesDto

    reversed polyline

safestFilletRadius

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

    group

    fillet

    shortname

    polyline safest fillet radius

    drawable

    false

    Parameters

    • inputs: PolylineToleranceDto

      Defines the polyline points, whether it's closed, and an optional tolerance.

    Returns number

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

sortSegmentsIntoPolylines

  • Sorts scrambled segments into connected polylines by matching endpoints. Uses spatial hashing for efficient connection finding. Example: 10 random segments that form 2 connected paths → 2 polylines

    group

    sort

    shortname

    segments to polylines

    drawable

    true

    Parameters

    Returns Polyline3[]

    polylines

transformPolyline

  • Applies transformation matrix to all points in polyline (rotates, scales, or translates). Example: polyline with 4 points, translation [5,0,0] → all points moved +5 in X direction

    group

    transforms

    shortname

    transform polyline

    drawable

    true

    Parameters

    Returns PolylinePropertiesDto

    transformed polyline

twoPolylineIntersection

  • Finds intersection points between two polylines (all segment-segment crossings). Tests all segment pairs and deduplicates close points. Example: crossing polylines forming an X → returns center intersection point

    group

    intersection

    shortname

    two polyline intersection

    drawable

    true

    Parameters

    Returns Point3[]

    points

Generated using TypeDoc