Logo Euclid

Polyline3D Type

A class holding a list of 3D points representing a mutable 3D Polyline. If the last point is the same as the first point, the Polyline3D is closed. The source-of-truth storage is an interleaved float buffer: x0, y0, z0, x1, y1, z1, ...

Constructors

Constructor Description

Polyline3D(points)

Full Usage: Polyline3D(points)

Parameters:
    points : Pnt seq

Returns: Polyline3D

Create a new Polyline3D by copying the provided sequence of points into a flat array.

points : Pnt seq
Returns: Polyline3D

Polyline3D(capacity)

Full Usage: Polyline3D(capacity)

Parameters:
    capacity : int

Returns: Polyline3D

Create a new empty Polyline3D with predefined point count capacity.

capacity : int
Returns: Polyline3D

Instance members

Instance member Description

this.AddPoint

Full Usage: this.AddPoint

Parameters:

Adds a point to the end of the Polyline3D.

pt : Pnt

this.AddXYZ

Full Usage: this.AddXYZ

Parameters:
    x : float
    y : float
    z : float

Adds a point from x, y, and z coordinates.

x : float
y : float
z : float

this.AreaIn2D

Full Usage: this.AreaIn2D

Returns: float

Calculates the area of the Polyline3D when projected in 2D. Z values are ignored. The segment from the last point to the first point is included in the area calculation. For self intersecting Polylines the result is invalid.

Returns: float

this.AsFSharpCode

Full Usage: this.AsFSharpCode

Returns: string

Format this 3D polyline into an F# code string that can be used to recreate the polyline.

Returns: string

this.AsPoints

Full Usage: this.AsPoints

Returns: ResizeArray<Pnt>

Converts the float buffer of the Polyline3D into a list of Points. Use .XYZs to access the live internal buffer.

Returns: ResizeArray<Pnt>

this.AsString

Full Usage: this.AsString

Returns: string

Format Polyline3D into string including its length.

Returns: string

this.AverageNormal

Full Usage: this.AverageNormal

Returns: Vec

Returns the average normal vector of the Polyline3D. It is calculated by summing up the cross products of all segments around the center point. Does not check for bad input, may be zero length if points are colinear.

Returns: Vec

this.BoundingBox

Full Usage: this.BoundingBox

Returns: BBox

Gets the bounding box of the Polyline3D.

Returns: BBox

this.Center

Full Usage: this.Center

Returns: Pnt

Returns the average center of all points of the Polyline3D.

Returns: Pnt

this.Clone

Full Usage: this.Clone

Returns: Polyline3D

Creates a copy of the Polyline3D. Same as polyline.Duplicate()

Returns: Polyline3D

this.CloseInPlace

Full Usage: this.CloseInPlace

Parameters:
    ?toleranceForAddingPoint : float

Close the Polyline3D if it is not already closed. If the ends are closer than the tolerance, the last point is set equal to the first point. Otherwise the start point is added to the end of the Polyline3D. The default tolerance is 1e-6

?toleranceForAddingPoint : float

this.ClosestParameter

Full Usage: this.ClosestParameter

Parameters:
Returns: float

Returns the parameter on the Polyline3D that is the closest point to the given point. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 . Returns the parameter on the Polyline3D that is the closest point to the given point. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .

p : Pnt
Returns: float

this.ClosestParameterXYZ

Full Usage: this.ClosestParameterXYZ

Parameters:
    x : float
    y : float
    z : float

Returns: float

Returns the parameter on the Polyline3D that is the closest point to the given point. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .

x : float
y : float
z : float
Returns: float

this.ClosestPoint

Full Usage: this.ClosestPoint

Parameters:
Returns: Pnt

Returns the point on the Polyline3D that is the closest point to the given point.

p : Pnt
Returns: Pnt

this.ClosestPointIndex

Full Usage: this.ClosestPointIndex

Parameters:
Returns: int

Returns the index into the Polylines point list of the point that is closest to the given point.

p : Pnt
Returns: int

this.DistanceTo

Full Usage: this.DistanceTo

Parameters:
Returns: float

Returns the distance of the test point to the closest point on the Polyline3D.

p : Pnt
Returns: float

this.DistanceToXYZ

Full Usage: this.DistanceToXYZ

Parameters:
    x : float
    y : float
    z : float

Returns: float

Returns the distance of the test point to the closest point on the Polyline3D.

x : float
y : float
z : float
Returns: float

this.Duplicate

Full Usage: this.Duplicate

Returns: Polyline3D

Creates a copy of the Polyline3D Same as polyline.Clone()

Returns: Polyline3D

this.End

Full Usage: this.End

Returns: Pnt

Gets or sets last or end point of the Polyline3D This is the point at index Points.Count - 1. Same as Polyline3D.LastPoint

Returns: Pnt

this.EvaluateAt

Full Usage: this.EvaluateAt

Parameters:
    t : float

Returns: Pnt

Returns the point at a given parameter on the Polyline3D. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 . If the parameter is within 1e-6 of an integer value, the integer value is used as parameter.

t : float
Returns: Pnt

this.FirstPoint

Full Usage: this.FirstPoint

Returns: Pnt

Gets or sets the first point of the Polyline3D. This is the point at index 0. Same as Polyline3D.Start

Returns: Pnt

this.FirstSegment

Full Usage: this.FirstSegment

Returns: Line3D

Gets the first segment of the Polyline3D.

Returns: Line3D

this.GetPt

Full Usage: this.GetPt

Parameters:
    position : int

Returns: Pnt

Gets the point at the given position. (does Pnt(xyzs.[position * 3], xyzs.[position * 3 + 1], xyzs.[position * 3 + 2]) internally)

position : int
Returns: Pnt

this.GetSegment

Full Usage: this.GetSegment

Parameters:
    i : int

Returns: Line3D

Gets the segment at index i of the Polyline3D.

i : int
Returns: Line3D

this.GetX

Full Usage: this.GetX

Parameters:
    position : int

Returns: float

Gets the x coordinate of the point at the given position. (does xyzs.[position * 3] internally)

position : int
Returns: float

this.GetY

Full Usage: this.GetY

Parameters:
    position : int

Returns: float

Gets the y coordinate of the point at the given position. (does xyzs.[position * 3 + 1] internally)

position : int
Returns: float

this.GetZ

Full Usage: this.GetZ

Parameters:
    position : int

Returns: float

Gets the z coordinate of the point at the given position. (does xyzs.[position * 3 + 2] internally)

position : int
Returns: float

this.IsAlmostClosed

Full Usage: this.IsAlmostClosed

Parameters:
    tolerance : float

Returns: bool

Tests if Polyline3D is closed within given tolerance. Returns False if the Polyline3D has less than 3 points.

tolerance : float
Returns: bool

this.IsClockwiseIn2D

Full Usage: this.IsClockwiseIn2D

Returns: bool

Test if Polyline3D is Clockwise when projected in 2D. Z values are ignored. The Polyline3D does not need to be actually closed. The signed area of the Polyline3D is calculated. If it is negative the Polyline3D is Clockwise.

Returns: bool

this.IsClosed

Full Usage: this.IsClosed

Returns: bool

Tests if Polyline3D start and end points are exactly the same. Returns False if the Polyline3D has less than 3 points.

Returns: bool

this.IsCounterClockwiseIn2D

Full Usage: this.IsCounterClockwiseIn2D

Returns: bool

Test if Polyline3D is CounterClockwise when projected in 2D. Z values are ignored. The Polyline3D does not need to be actually closed. The signed area of the Polyline3D is calculated. If it is positive the Polyline3D is CCW.

Returns: bool

this.LastPoint

Full Usage: this.LastPoint

Returns: Pnt

Gets or sets the last point of the Polyline3D. This is the point at index Points.Count - 1. Same as Polyline3D.End

Returns: Pnt

this.LastSegment

Full Usage: this.LastSegment

Returns: Line3D

Gets the last segment of the Polyline3D.

Returns: Line3D

this.Length

Full Usage: this.Length

Returns: float

Gets the length of the Polyline3D Returns 0.0 if there are less than 2 points.

Returns: float

this.Move

Full Usage: this.Move

Parameters:
Returns: Polyline3D

Returns a Polyline3D moved by a vector.

v : Vec
Returns: Polyline3D

this.MoveX

Full Usage: this.MoveX

Parameters:
    distance : float

Returns: Polyline3D

Returns a Polyline3D moved by a given distance in X direction.

distance : float
Returns: Polyline3D

this.MoveY

Full Usage: this.MoveY

Parameters:
    distance : float

Returns: Polyline3D

Returns a Polyline3D moved by a given distance in Y direction.

distance : float
Returns: Polyline3D

this.MoveZ

Full Usage: this.MoveZ

Parameters:
    distance : float

Returns: Polyline3D

Returns a Polyline3D moved by a given distance in Z direction.

distance : float
Returns: Polyline3D

this.PointCount

Full Usage: this.PointCount

Returns: int

Gets the count of points in the Polyline3D

Returns: int

this.Reverse

Full Usage: this.Reverse

Returns: Polyline3D

Returns new Polyline3D in reversed Order.

Returns: Polyline3D

this.ReverseInPlace

Full Usage: this.ReverseInPlace

Reverse order of the Polyline3D in place.

this.Rotate

Full Usage: this.Rotate

Parameters:
Returns: Polyline3D

Multiplies (or applies) a Quaternion to the Polyline3D. The polyline is rotated around the World Origin.

q : Quaternion
Returns: Polyline3D

this.RotateOnZ

Full Usage: this.RotateOnZ

Parameters:
Returns: Polyline3D

Rotation a Polyline3D around Z-Axis.

r : Rotation2D
Returns: Polyline3D

this.RotateOnZWithCenter

Full Usage: this.RotateOnZWithCenter

Parameters:
Returns: Polyline3D

Rotation a Polyline3D round given center point an a local Z-axis.

cen : Pnt
r : Rotation2D
Returns: Polyline3D

this.RotateWithCenter

Full Usage: this.RotateWithCenter

Parameters:
Returns: Polyline3D

Multiplies (or applies) a Quaternion to the Polyline3D to rotate around a given center point.

cen : Pnt
q : Quaternion
Returns: Polyline3D

this.Scale

Full Usage: this.Scale

Parameters:
    factor : float

Returns: Polyline3D

Scales the 3D polyline by a given factor. Scale center is World Origin 0,0,0

factor : float
Returns: Polyline3D

this.ScaleOn

Full Usage: this.ScaleOn

Parameters:
    cen : Pnt
    factor : float

Returns: Polyline3D

Scales the 3D polyline by a given factor on a given center point

cen : Pnt
factor : float
Returns: Polyline3D

this.SecondLastPoint

Full Usage: this.SecondLastPoint

Returns: Pnt

Gets or sets the second last point of the Polyline3D.

Returns: Pnt

this.SecondPoint

Full Usage: this.SecondPoint

Returns: Pnt

Gets or sets the second point of the Polyline3D. This is the point at index 1.

Returns: Pnt

this.SegmentCount

Full Usage: this.SegmentCount

Returns: int

Gets the count of segments in the Polyline3D This is poly.Points.Count - 1

Returns: int

this.SegmentVectors

Full Usage: this.SegmentVectors

Returns: ResizeArray<Vec>

Returns the line vectors of all segments of the Polyline3D as a list of Vec. The length of the list is one less than the point count.

Returns: ResizeArray<Vec>

this.SegmentVectorsXYZ

Full Usage: this.SegmentVectorsXYZ

Returns: ResizeArray<float>

Returns the line vectors of all segments of the Polyline3D as a flat list of x, y, and z components. The length of the list is 3 less than the xyzs count, so one less vector than points in the polyline.

Returns: ResizeArray<float>

this.Segments

Full Usage: this.Segments

Returns: ResizeArray<Line3D>

Returns all segments of the Polyline3D as a list of Line3D.

Returns: ResizeArray<Line3D>

this.SetPnt

Full Usage: this.SetPnt

Parameters:
    position : int
    pt : Pnt

Sets the point at given position to the given point. ( sets xyzs.[position * 3] and xyzs.[position * 3 + 1] and xyzs.[position * 3 + 2] internally)

position : int
pt : Pnt

this.SetPointXYZ

Full Usage: this.SetPointXYZ

Parameters:
    position : int
    x : float
    y : float
    z : float

Sets the x, y, and z coordinates of the point at the given index. NOTE: setting the first or last point on a closed Polyline3D might open it. (sets xyzs.[position * 3], xyzs.[position * 3 + 1], and xyzs.[position * 3 + 2] internally )

position : int
x : float
y : float
z : float

this.SetPointXYZClosed

Full Usage: this.SetPointXYZClosed

Parameters:
    position : int
    x : float
    y : float
    z : float

Sets the x, y, and z coordinates of the point at the given position. On a closed Polyline3D, setting the first or last point will set both to the same point. Raises an error if the position is out of range. (sets xyzs.[position * 3] and xyzs.[position * 3 + 1] and xyzs.[position * 3 + 2] internally)

position : int
x : float
y : float
z : float

this.SignedAreaIn2D

Full Usage: this.SignedAreaIn2D

Returns: float

Calculates the signed area of the Polyline3D when projected in 2D. Z values are ignored. The Polyline3D does not need to be actually closed. The signed area of the Polyline3D is calculated. If it is positive the Polyline3D is CCW. Raises an error on an empty Polyline3D.

Returns: float

this.Start

Full Usage: this.Start

Returns: Pnt

Gets or sets first point of the Polyline3D This is the point at index 0. Same as Polyline3D.FirstPoint

Returns: Pnt

this.Transform

Full Usage: this.Transform

Parameters:
Returns: Polyline3D

Applies or multiplies a 4x4 transformation matrix to the Polyline3D.

m : Matrix
Returns: Polyline3D

this.TransformRigid

Full Usage: this.TransformRigid

Parameters:
Returns: Polyline3D

Multiplies (or applies) a RigidMatrix to the Polyline3D.

m : RigidMatrix
Returns: Polyline3D

this.XYZs

Full Usage: this.XYZs

Returns: ResizeArray<float>

Gets the X, Y and Z interleaved ResizeArray of the Polyline3D: x0, y0, z0, x1, y1, z1, ... This is the live internal buffer, so changes to the list will be reflected in the Polyline3D.

Returns: ResizeArray<float>

Static members

Static member Description

Polyline3D.addPoint pt p

Full Usage: Polyline3D.addPoint pt p

Parameters:
Modifiers: inline

Adds a point to the end of the Polyline3D.

pt : Pnt
p : Polyline3D

Polyline3D.addXYZ x y z p

Full Usage: Polyline3D.addXYZ x y z p

Parameters:
Modifiers: inline

Adds a point from x, y, and z coordinates.

x : float
y : float
z : float
p : Polyline3D

Polyline3D.areaIn2D pl

Full Usage: Polyline3D.areaIn2D pl

Parameters:
Returns: float
Modifiers: inline

Calculates the area of the Polyline3D when projected in 2D. Z values are ignored. The segment from the last point to the first point is included in the area calculation. For self intersecting Polylines the result is invalid.

pl : Polyline3D
Returns: float

Polyline3D.asFSharpCode pl

Full Usage: Polyline3D.asFSharpCode pl

Parameters:
Returns: string
Modifiers: inline

Format this 3D polyline into an F# code string that can be used to recreate the polyline.

pl : Polyline3D
Returns: string

Polyline3D.asPoints p

Full Usage: Polyline3D.asPoints p

Parameters:
Returns: ResizeArray<Pnt>
Modifiers: inline

Converts the float buffer of the Polyline3D into a list of Points. Use .XYZs to access the live internal buffer.

p : Polyline3D
Returns: ResizeArray<Pnt>

Polyline3D.asString pl

Full Usage: Polyline3D.asString pl

Parameters:
Returns: string
Modifiers: inline

Format Polyline3D into string including its length.

pl : Polyline3D
Returns: string

Polyline3D.averageNormal pl

Full Usage: Polyline3D.averageNormal pl

Parameters:
Returns: Vec
Modifiers: inline

Returns the average normal vector of the Polyline3D. It is calculated by summing up the cross products of all segments around the center point. Does not check for bad input, may be zero length if points are colinear.

pl : Polyline3D
Returns: Vec

Polyline3D.boundingBox pl

Full Usage: Polyline3D.boundingBox pl

Parameters:
Returns: BBox
Modifiers: inline

Gets the bounding box of the Polyline3D.

pl : Polyline3D
Returns: BBox

Polyline3D.center pl

Full Usage: Polyline3D.center pl

Parameters:
Returns: Pnt
Modifiers: inline

Returns the average center of all points of the Polyline3D.

pl : Polyline3D
Returns: Pnt

Polyline3D.clone pl

Full Usage: Polyline3D.clone pl

Parameters:
Returns: Polyline3D
Modifiers: inline

Creates a copy of the Polyline3D. Same as polyline.Duplicate()

pl : Polyline3D
Returns: Polyline3D

Polyline3D.close toleranceForAddingPoint pl

Full Usage: Polyline3D.close toleranceForAddingPoint pl

Parameters:
Returns: Polyline3D

Returns a new closed Polyline3D. If the first and last point are within the tolerance of each other, the last point is set equal to the first point. Otherwise one point is added. Raises an error if the Polyline3D has fewer than 3 points, same as CloseInPlace.

toleranceForAddingPoint : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.closeInPlace toleranceForAddingPoint pl

Full Usage: Polyline3D.closeInPlace toleranceForAddingPoint pl

Parameters:
    toleranceForAddingPoint : float - The tolerance used to decide whether to snap the last point to the first point.
    pl : Polyline3D - The Polyline3D to close.

Returns: Polyline3D A reference to the same Polyline3D as the input

Closes the Polyline3D in place by adding a point. If the first and last point are within the given tolerance of each other, the last point is set equal to the first point instead.

toleranceForAddingPoint : float

The tolerance used to decide whether to snap the last point to the first point.

pl : Polyline3D

The Polyline3D to close.

Returns: Polyline3D

A reference to the same Polyline3D as the input

Polyline3D.closestParameter pl pt

Full Usage: Polyline3D.closestParameter pl pt

Parameters:
Returns: float
Modifiers: inline

Returns the parameter on the Polyline3D that is the closest point to the given point. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .

pl : Polyline3D
pt : Pnt
Returns: float

Polyline3D.closestParameterXYZ pl x y z

Full Usage: Polyline3D.closestParameterXYZ pl x y z

Parameters:
Returns: float
Modifiers: inline

Returns the parameter on the Polyline3D that is the closest point to the given point. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .

pl : Polyline3D
x : float
y : float
z : float
Returns: float

Polyline3D.closestPoint pl pt

Full Usage: Polyline3D.closestPoint pl pt

Parameters:
Returns: Pnt
Modifiers: inline

Returns the point on the Polyline3D that is the closest point to the given point.

pl : Polyline3D
pt : Pnt
Returns: Pnt

Polyline3D.closestPointIndex pl pt

Full Usage: Polyline3D.closestPointIndex pl pt

Parameters:
Returns: int
Modifiers: inline

Returns the index into the Polyline3D's point list of the point that is closest to the given point.

pl : Polyline3D
pt : Pnt
Returns: int

Polyline3D.createDirectly xyzs

Full Usage: Polyline3D.createDirectly xyzs

Parameters:
    xyzs : ResizeArray<float>

Returns: Polyline3D

Create a new Polyline3D by using the provided X, Y and Z interleaved ResizeArray directly. Unsafe because later changes to the ResizeArray will be reflected in the Polyline3D.

xyzs : ResizeArray<float>
Returns: Polyline3D

Polyline3D.createEmpty capacity

Full Usage: Polyline3D.createEmpty capacity

Parameters:
    capacity : int

Returns: Polyline3D
Modifiers: inline

Create a new empty Polyline3D without any points. But predefined capacity.

capacity : int
Returns: Polyline3D

Polyline3D.createFrom2DXYMembers xyObjs

Full Usage: Polyline3D.createFrom2DXYMembers xyObjs

Parameters:
    xyObjs : ^T seq

Returns: Polyline3D
Modifiers: inline
Type parameters: ^T, ^a, ^b (requires (member get_X : ^T -> ^a) and (member get_Y : ^T -> ^b) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float))

Creates a Polyline3D from a list of objects with X and Y members (uppercase), using 0.0 for Z.

xyObjs : ^T seq
Returns: Polyline3D

Polyline3D.createFrom2DxyMembers xyObjs

Full Usage: Polyline3D.createFrom2DxyMembers xyObjs

Parameters:
    xyObjs : ^T seq

Returns: Polyline3D
Modifiers: inline
Type parameters: ^T, ^a, ^b (requires (member get_x : ^T -> ^a) and (member get_y : ^T -> ^b) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float))

Creates a Polyline3D from a list of objects with x and y members (lowercase), using 0.0 for z.

xyObjs : ^T seq
Returns: Polyline3D

Polyline3D.createFromPts points

Full Usage: Polyline3D.createFromPts points

Parameters:
    points : Pnt seq

Returns: Polyline3D

Create a new Polyline3D by copying over all points.

points : Pnt seq
Returns: Polyline3D

Polyline3D.createFromRect3D r

Full Usage: Polyline3D.createFromRect3D r

Parameters:
Returns: Polyline3D

Creates a closed Polyline3D starting at the Origin, going to x, then x+y, then y and back to origin.

r : Rect3D
Returns: Polyline3D

Polyline3D.createFromXYZMembers xyzObjs

Full Usage: Polyline3D.createFromXYZMembers xyzObjs

Parameters:
    xyzObjs : ^T seq

Returns: Polyline3D
Modifiers: inline
Type parameters: ^T, ^a, ^b, ^c (requires (member get_X : ^T -> ^a) and (member get_Y : ^T -> ^b) and (member get_Z : ^T -> ^c) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^c -> Microsoft.FSharp.Core.float))

Creates a Polyline3D from a list of objects with X, Y, and Z members (uppercase).

xyzObjs : ^T seq
Returns: Polyline3D

Polyline3D.createFromxyzMembers xyzObjs

Full Usage: Polyline3D.createFromxyzMembers xyzObjs

Parameters:
    xyzObjs : ^T seq

Returns: Polyline3D
Modifiers: inline
Type parameters: ^T, ^a, ^b, ^c (requires (member get_x : ^T -> ^a) and (member get_y : ^T -> ^b) and (member get_z : ^T -> ^c) and (static member op_Explicit : ^a -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^b -> Microsoft.FSharp.Core.float) and (static member op_Explicit : ^c -> Microsoft.FSharp.Core.float))

Creates a Polyline3D from a list of objects with x, y, and z members (lowercase).

xyzObjs : ^T seq
Returns: Polyline3D

Polyline3D.distanceTo pl pt

Full Usage: Polyline3D.distanceTo pl pt

Parameters:
Returns: float
Modifiers: inline

Returns the distance of the test point to the closest point on the Polyline3D.

pl : Polyline3D
pt : Pnt
Returns: float

Polyline3D.distanceToXYZ pl x y z

Full Usage: Polyline3D.distanceToXYZ pl x y z

Parameters:
Returns: float
Modifiers: inline

Returns the distance of the test point to the closest point on the Polyline3D.

pl : Polyline3D
x : float
y : float
z : float
Returns: float

Polyline3D.duplicate pl

Full Usage: Polyline3D.duplicate pl

Parameters:
Returns: Polyline3D
Modifiers: inline

Creates a copy of the Polyline3D Same as polyline.Clone()

pl : Polyline3D
Returns: Polyline3D

Polyline3D.end' pl

Full Usage: Polyline3D.end' pl

Parameters:
Returns: Pnt
Modifiers: inline

Gets the last or end point of the Polyline3D This is the point at index Points.Count - 1. Same as Polyline3D.LastPoint

pl : Polyline3D
Returns: Pnt

Polyline3D.ensureClockwiseIn2D pl

Full Usage: Polyline3D.ensureClockwiseIn2D pl

Parameters:
Returns: Polyline3D
Modifiers: inline

Tests if the Polyline3D is Clockwise when projected in 2D (Z values are ignored). Returns the same instance if the Polyline3D is already Clockwise, otherwise returns a new reversed Polyline3D.

pl : Polyline3D
Returns: Polyline3D

Polyline3D.ensureClockwiseInPlaceIn2D pl

Full Usage: Polyline3D.ensureClockwiseInPlaceIn2D pl

Parameters:
Returns: Polyline3D
Modifiers: inline

Tests if the Polyline3D is Clockwise when projected in 2D (Z values are ignored). If not reverse the Polyline3D in place. Always returns the same instance.

pl : Polyline3D
Returns: Polyline3D

Polyline3D.ensureCounterClockwiseIn2D pl

Full Usage: Polyline3D.ensureCounterClockwiseIn2D pl

Parameters:
Returns: Polyline3D
Modifiers: inline

Tests if the Polyline3D is Counter Clockwise when projected in 2D (Z values are ignored). Returns the same instance if the Polyline3D is already Counter Clockwise, otherwise returns a new reversed Polyline3D.

pl : Polyline3D
Returns: Polyline3D

Polyline3D.ensureCounterClockwiseInPlaceIn2D pl

Full Usage: Polyline3D.ensureCounterClockwiseInPlaceIn2D pl

Parameters:
Returns: Polyline3D
Modifiers: inline

Tests if the Polyline3D is Counter Clockwise when projected in 2D (Z values are ignored). If not reverse the Polyline3D in place. Always returns the same instance.

pl : Polyline3D
Returns: Polyline3D

Polyline3D.equals pl1 pl2

Full Usage: Polyline3D.equals pl1 pl2

Parameters:
    pl1 : Polyline3D - The first Polyline3D instance.
    pl2 : Polyline3D - The second Polyline3D instance.

Returns: bool True if the two Polyline3D instances are equal, otherwise false.

Tests if two Polyline3D have the same point count and if their corresponding points are exactly equal.

pl1 : Polyline3D

The first Polyline3D instance.

pl2 : Polyline3D

The second Polyline3D instance.

Returns: bool

True if the two Polyline3D instances are equal, otherwise false.

Polyline3D.equalsTol tol pl1 pl2

Full Usage: Polyline3D.equalsTol tol pl1 pl2

Parameters:
    tol : float - The tolerance value for comparing the coordinates.
    pl1 : Polyline3D - The first Polyline3D instance.
    pl2 : Polyline3D - The second Polyline3D instance.

Returns: bool

Tests if two Polyline3D have the same point count and if their corresponding points are equal within a given tolerance.

tol : float

The tolerance value for comparing the coordinates.

pl1 : Polyline3D

The first Polyline3D instance.

pl2 : Polyline3D

The second Polyline3D instance.

Returns: bool

Polyline3D.evaluateAt t pl

Full Usage: Polyline3D.evaluateAt t pl

Parameters:
Returns: Pnt

Returns the point at a given parameter on the Polyline3D. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter from 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .

t : float
pl : Polyline3D
Returns: Pnt

Polyline3D.firstPoint pl

Full Usage: Polyline3D.firstPoint pl

Parameters:
Returns: Pnt
Modifiers: inline

Gets the first point of the Polyline3D. This is the point at index 0. Same as Polyline3D.Start

pl : Polyline3D
Returns: Pnt

Polyline3D.firstSegment pl

Full Usage: Polyline3D.firstSegment pl

Parameters:
Returns: Line3D
Modifiers: inline

Gets the first segment of the Polyline3D.

pl : Polyline3D
Returns: Line3D

Polyline3D.getPt position p

Full Usage: Polyline3D.getPt position p

Parameters:
Returns: Pnt
Modifiers: inline

Gets the point at the given position. (does Pnt(xyzs.[position * 3], xyzs.[position * 3 + 1], xyzs.[position * 3 + 2]) internally)

position : int
p : Polyline3D
Returns: Pnt

Polyline3D.getSegment i pl

Full Usage: Polyline3D.getSegment i pl

Parameters:
Returns: Line3D
Modifiers: inline

Gets the segment at index i of the Polyline3D.

i : int
pl : Polyline3D
Returns: Line3D

Polyline3D.getX position p

Full Usage: Polyline3D.getX position p

Parameters:
Returns: float
Modifiers: inline

Gets the x coordinate of the point at the given index. (does xyzs.[position * 3] internally)

position : int
p : Polyline3D
Returns: float

Polyline3D.getXYZs p

Full Usage: Polyline3D.getXYZs p

Parameters:
Returns: ResizeArray<float>
Modifiers: inline

Gets the X, Y and Z interleaved ResizeArray of the Polyline3D: x0, y0, z0, x1, y1, z1, ... This is the live internal buffer, so changes to the list will be reflected in the Polyline3D.

p : Polyline3D
Returns: ResizeArray<float>

Polyline3D.getY position p

Full Usage: Polyline3D.getY position p

Parameters:
Returns: float
Modifiers: inline

Gets the y coordinate of the point at the given index. (does xyzs.[position * 3 + 1] internally)

position : int
p : Polyline3D
Returns: float

Polyline3D.getZ position p

Full Usage: Polyline3D.getZ position p

Parameters:
Returns: float
Modifiers: inline

Gets the z coordinate of the point at the given index. (does xyzs.[position * 3 + 2] internally)

position : int
p : Polyline3D
Returns: float

Polyline3D.isAlmostClosed tolerance pl

Full Usage: Polyline3D.isAlmostClosed tolerance pl

Parameters:
Returns: bool
Modifiers: inline

Tests if Polyline3D is closed within given tolerance. Returns False if the Polyline3D has less than 3 points.

tolerance : float
pl : Polyline3D
Returns: bool

Polyline3D.isClockwiseIn2D pl

Full Usage: Polyline3D.isClockwiseIn2D pl

Parameters:
Returns: bool
Modifiers: inline

Test if Polyline3D is Clockwise when projected in 2D. Z values are ignored. The Polyline3D does not need to be actually closed. The signed area of the Polyline3D is calculated. If it is negative the Polyline3D is Clockwise.

pl : Polyline3D
Returns: bool

Polyline3D.isClosed pl

Full Usage: Polyline3D.isClosed pl

Parameters:
Returns: bool
Modifiers: inline

Tests if Polyline3D start and end points are exactly the same. Returns False if the Polyline3D has less than 3 points.

pl : Polyline3D
Returns: bool

Polyline3D.isCounterClockwiseIn2D pl

Full Usage: Polyline3D.isCounterClockwiseIn2D pl

Parameters:
Returns: bool
Modifiers: inline

Test if Polyline3D is CounterClockwise when projected in 2D. Z values are ignored. The Polyline3D does not need to be actually closed. The signed area of the Polyline3D is calculated. If it is positive the Polyline3D is CCW.

pl : Polyline3D
Returns: bool

Polyline3D.iter action pl

Full Usage: Polyline3D.iter action pl

Parameters:
    action : float -> float -> float -> unit - A function that takes the X, Y and Z coordinates of a point.
    pl : Polyline3D - The Polyline3D to iterate over.

Modifiers: inline

Iterate over each point in the Polyline3D.

action : float -> float -> float -> unit

A function that takes the X, Y and Z coordinates of a point.

pl : Polyline3D

The Polyline3D to iterate over.

Polyline3D.iterLineSegments action pl

Full Usage: Polyline3D.iterLineSegments action pl

Parameters:
    action : Line3D -> unit - A function that takes a Line3D representing the segment.
    pl : Polyline3D - The Polyline3D to iterate over.

Modifiers: inline

Iterate over each segment in the Polyline3D.

action : Line3D -> unit

A function that takes a Line3D representing the segment.

pl : Polyline3D

The Polyline3D to iterate over.

Polyline3D.iterPnt action pl

Full Usage: Polyline3D.iterPnt action pl

Parameters:
    action : Pnt -> unit - A function that takes a point.
    pl : Polyline3D - The Polyline3D to iterate over.

Iterate over each point in the Polyline3D.

action : Pnt -> unit

A function that takes a point.

pl : Polyline3D

The Polyline3D to iterate over.

Polyline3D.iterPntSkipLast action pl

Full Usage: Polyline3D.iterPntSkipLast action pl

Parameters:
    action : Pnt -> unit - A function that takes a point.
    pl : Polyline3D - The Polyline3D to iterate over.

Modifiers: inline

Iterate over each point in the Polyline3D except the last point.

action : Pnt -> unit

A function that takes a point.

pl : Polyline3D

The Polyline3D to iterate over.

Polyline3D.iterSegments action pl

Full Usage: Polyline3D.iterSegments action pl

Parameters:
    action : float -> float -> float -> float -> float -> float -> unit - A function that takes startX, startY, startZ, endX, endY, and endZ coordinates of a segment.
    pl : Polyline3D - The Polyline3D to iterate over.

Modifiers: inline

Iterate over each segment in the Polyline3D.

action : float -> float -> float -> float -> float -> float -> unit

A function that takes startX, startY, startZ, endX, endY, and endZ coordinates of a segment.

pl : Polyline3D

The Polyline3D to iterate over.

Polyline3D.iterSkipLast action pl

Full Usage: Polyline3D.iterSkipLast action pl

Parameters:
    action : float -> float -> float -> unit - A function that takes the X, Y and Z coordinates of a point.
    pl : Polyline3D - The Polyline3D to iterate over.

Modifiers: inline

Iterate over each point in the Polyline3D except the last point.

action : float -> float -> float -> unit

A function that takes the X, Y and Z coordinates of a point.

pl : Polyline3D

The Polyline3D to iterate over.

Polyline3D.iteri action pl

Full Usage: Polyline3D.iteri action pl

Parameters:
    action : int -> float -> float -> float -> unit - A function that takes the index of the X coordinate (in the flat coordinate array) and the X, Y and Z coordinates of a point.
    pl : Polyline3D - The Polyline3D to iterate over.

Iterate over each point in the Polyline3D with index.

action : int -> float -> float -> float -> unit

A function that takes the index of the X coordinate (in the flat coordinate array) and the X, Y and Z coordinates of a point.

pl : Polyline3D

The Polyline3D to iterate over.

Polyline3D.iteriPnt action pl

Full Usage: Polyline3D.iteriPnt action pl

Parameters:
    action : int -> Pnt -> unit - A function that takes the position ( = array index/3) of the point and the point itself.
    pl : Polyline3D - The Polyline3D to iterate over.

Iterate over each point in the Polyline3D with index.

action : int -> Pnt -> unit

A function that takes the position ( = array index/3) of the point and the point itself.

pl : Polyline3D

The Polyline3D to iterate over.

Polyline3D.lastPoint pl

Full Usage: Polyline3D.lastPoint pl

Parameters:
Returns: Pnt
Modifiers: inline

Gets the last point of the Polyline3D. This is the point at index Points.Count - 1. Same as Polyline3D.End

pl : Polyline3D
Returns: Pnt

Polyline3D.lastSegment pl

Full Usage: Polyline3D.lastSegment pl

Parameters:
Returns: Line3D
Modifiers: inline

Gets the last segment of the Polyline3D.

pl : Polyline3D
Returns: Line3D

Polyline3D.length p

Full Usage: Polyline3D.length p

Parameters:
Returns: float
Modifiers: inline

Gets the length of the Polyline3D. The sum of the lengths of all segments.

p : Polyline3D
Returns: float

Polyline3D.map mapping pl

Full Usage: Polyline3D.map mapping pl

Parameters:
    mapping : float -> float -> float -> Pnt - A function that takes the X, Y and Z coordinates of a point and returns a new point.
    pl : Polyline3D - The Polyline3D to map over.

Returns: Polyline3D A new Polyline3D with the mapped points.

Apply a mapping function to each point in the 3D Polyline. Returns new Polyline3D.

mapping : float -> float -> float -> Pnt

A function that takes the X, Y and Z coordinates of a point and returns a new point.

pl : Polyline3D

The Polyline3D to map over.

Returns: Polyline3D

A new Polyline3D with the mapped points.

Polyline3D.mapPnt mapping pl

Full Usage: Polyline3D.mapPnt mapping pl

Parameters:
    mapping : Pnt -> Pnt - A function that takes a point and returns a new point.
    pl : Polyline3D - The Polyline3D to map over.

Returns: Polyline3D A new Polyline3D with the mapped points.

Apply a mapping function to each point in the 3D Polyline. Returns new Polyline3D.

mapping : Pnt -> Pnt

A function that takes a point and returns a new point.

pl : Polyline3D

The Polyline3D to map over.

Returns: Polyline3D

A new Polyline3D with the mapped points.

Polyline3D.mapi mapping pl

Full Usage: Polyline3D.mapi mapping pl

Parameters:
    mapping : int -> float -> float -> float -> Pnt - A function that takes the index of the X coordinate (in the flat coordinate array) and the X, Y and Z coordinates of a point and returns a new point.
    pl : Polyline3D - The Polyline3D to map over.

Returns: Polyline3D A new Polyline3D with the mapped points.

Apply a mapping function to each point in the 3D Polyline with index. Returns new Polyline3D.

mapping : int -> float -> float -> float -> Pnt

A function that takes the index of the X coordinate (in the flat coordinate array) and the X, Y and Z coordinates of a point and returns a new point.

pl : Polyline3D

The Polyline3D to map over.

Returns: Polyline3D

A new Polyline3D with the mapped points.

Polyline3D.mapiPnt mapping pl

Full Usage: Polyline3D.mapiPnt mapping pl

Parameters:
    mapping : int -> Pnt -> Pnt - A function that takes the position ( = array index/3) of the point and the point itself, and returns a new point.
    pl : Polyline3D - The Polyline3D to map over.

Returns: Polyline3D A new Polyline3D with the mapped points.

Apply a mapping function to each point in the Polyline3D with point position (not float index). Returns new Polyline3D.

mapping : int -> Pnt -> Pnt

A function that takes the position ( = array index/3) of the point and the point itself, and returns a new point.

pl : Polyline3D

The Polyline3D to map over.

Returns: Polyline3D

A new Polyline3D with the mapped points.

Polyline3D.move v pl

Full Usage: Polyline3D.move v pl

Parameters:
Returns: Polyline3D

Move a Polyline3D by a vector. (same as Polyline3D.translate)

v : Vec
pl : Polyline3D
Returns: Polyline3D

Polyline3D.moveX distance pl

Full Usage: Polyline3D.moveX distance pl

Parameters:
Returns: Polyline3D

Returns a Polyline3D moved by a given distance in X direction.

distance : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.moveY distance pl

Full Usage: Polyline3D.moveY distance pl

Parameters:
Returns: Polyline3D

Returns a Polyline3D moved by a given distance in Y direction.

distance : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.moveZ distance pl

Full Usage: Polyline3D.moveZ distance pl

Parameters:
Returns: Polyline3D

Returns a Polyline3D moved by a given distance in Z direction.

distance : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.offset (polyLine, inPlaneOffsetDistance, perpendicularOffsetDistance, ?loop)

Full Usage: Polyline3D.offset (polyLine, inPlaneOffsetDistance, perpendicularOffsetDistance, ?loop)

Parameters:
    polyLine : Polyline3D - A 3D Polyline, open or closed.
    inPlaneOffsetDistance : float - The offset distance in the local plane defined by two segments. A positive distance offsets to the inside of the polyline. A negative distance offsets to the outside. No matter how the polyline is oriented.
    perpendicularOffsetDistance : float - The offset distance perpendicular to the local plane. A positive distance offsets in the direction of the computed normal. For a counterclockwise polyline in xy-plane this is Upwards. A negative distance offsets in the opposite direction.
    ?loop : bool - Optional, defaults to false. Set to true to treat an open polyline as a closed loop, even if first and last points are not at the same location. When loop=true on an open polyline, both distance lists must contain the same number of items as the polyline has points.

Returns: Polyline3D A new 3D polyline.

Offsets a Polyline in 3D space by finding the local plane in each corner. Auto-detects if given points are from a closed Polyline (first point = last point) and loops them. The reference normal is computed from the average normal of the polyline. This function raises an Exception on duplicate points, 180 degree U-turns, or colinear points.

polyLine : Polyline3D

A 3D Polyline, open or closed.

inPlaneOffsetDistance : float

The offset distance in the local plane defined by two segments. A positive distance offsets to the inside of the polyline. A negative distance offsets to the outside. No matter how the polyline is oriented.

perpendicularOffsetDistance : float

The offset distance perpendicular to the local plane. A positive distance offsets in the direction of the computed normal. For a counterclockwise polyline in xy-plane this is Upwards. A negative distance offsets in the opposite direction.

?loop : bool

Optional, defaults to false. Set to true to treat an open polyline as a closed loop, even if first and last points are not at the same location. When loop=true on an open polyline, both distance lists must contain the same number of items as the polyline has points.

Returns: Polyline3D

A new 3D polyline.

Polyline3D.offset' inPlaneOffsetDistance perpendicularOffsetDistance polyLine

Full Usage: Polyline3D.offset' inPlaneOffsetDistance perpendicularOffsetDistance polyLine

Parameters:
    inPlaneOffsetDistance : float - The offset distance in the local plane defined by two segments. A positive distance offsets to the inside of the polyline. A negative distance offsets to the outside. No matter how the polyline is oriented.
    perpendicularOffsetDistance : float - The offset distance perpendicular to the local plane. A positive distance offsets in the direction of the computed normal. For a counterclockwise polyline in xy-plane this is Upwards. A negative distance offsets in the opposite direction.
    polyLine : Polyline3D - A 3D Polyline, open or closed.

Returns: Polyline3D A new 3D polyline.

Offsets a Polyline in 3D space by finding the local plane in each corner. Auto-detects if given points are from a closed Polyline (first point = last point) and loops them. The reference normal is computed from the average normal of the polyline. This function raises an Exception on duplicate points, 180 degree U-turns, or colinear points.

inPlaneOffsetDistance : float

The offset distance in the local plane defined by two segments. A positive distance offsets to the inside of the polyline. A negative distance offsets to the outside. No matter how the polyline is oriented.

perpendicularOffsetDistance : float

The offset distance perpendicular to the local plane. A positive distance offsets in the direction of the computed normal. For a counterclockwise polyline in xy-plane this is Upwards. A negative distance offsets in the opposite direction.

polyLine : Polyline3D

A 3D Polyline, open or closed.

Returns: Polyline3D

A new 3D polyline.

Polyline3D.offsetVar (polyLine, inPlaneOffsetDistances, perpendicularOffsetDistances, ?loop, ?varDistParallelBehaviour, ?considerColinearBelow, ?failAtUTurnAbove)

Full Usage: Polyline3D.offsetVar (polyLine, inPlaneOffsetDistances, perpendicularOffsetDistances, ?loop, ?varDistParallelBehaviour, ?considerColinearBelow, ?failAtUTurnAbove)

Parameters:
    polyLine : Polyline3D - A 3D Polyline, open or closed.
    inPlaneOffsetDistances : ResizeArray<float> - The offset distances in the local plane defined by two segments. One distance per segment. A positive distance offsets to the inside of the polyline. A negative distance offsets to the outside. No matter how the polyline is oriented.
    perpendicularOffsetDistances : ResizeArray<float> - The offset distances perpendicular to the local plane. One distance per segment. A positive distance offsets in the direction of the computed normal. For a counterclockwise polyline in xy-plane this is Upwards. A negative distance offsets in the opposite direction.
    ?loop : bool - Optional, defaults to false. Set to true to treat an open polyline as a closed loop, even if first and last points are not at the same location.
    ?varDistParallelBehaviour : VarDistParallel - Optional, defaults to Fail. The behavior to use when colinear segments with different offset distances are found.
    ?considerColinearBelow : MeasureProduct<cosine, MeasureOne> - Optional, defaults to 2.5 degrees in cosine measure. The cosine of the angle below which segments are considered colinear.
    ?failAtUTurnAbove : MeasureProduct<cosine, MeasureOne> - Optional, defaults to 175 degrees in cosine measure. The cosine of the angle above which a U-turn is considered to fail.

Returns: Polyline3D A new 3D polyline.

Offsets a Polyline in 3D space by finding the local plane in each corner. Auto-detects if given points are from a closed Polyline (first point = last point) and loops them. The reference normal is computed from the average normal of the polyline. This function raises an Exception on duplicate points, 180 degree U-turns, or colinear points.

polyLine : Polyline3D

A 3D Polyline, open or closed.

inPlaneOffsetDistances : ResizeArray<float>

The offset distances in the local plane defined by two segments. One distance per segment. A positive distance offsets to the inside of the polyline. A negative distance offsets to the outside. No matter how the polyline is oriented.

perpendicularOffsetDistances : ResizeArray<float>

The offset distances perpendicular to the local plane. One distance per segment. A positive distance offsets in the direction of the computed normal. For a counterclockwise polyline in xy-plane this is Upwards. A negative distance offsets in the opposite direction.

?loop : bool

Optional, defaults to false. Set to true to treat an open polyline as a closed loop, even if first and last points are not at the same location.

?varDistParallelBehaviour : VarDistParallel

Optional, defaults to Fail. The behavior to use when colinear segments with different offset distances are found.

?considerColinearBelow : MeasureProduct<cosine, MeasureOne>

Optional, defaults to 2.5 degrees in cosine measure. The cosine of the angle below which segments are considered colinear.

?failAtUTurnAbove : MeasureProduct<cosine, MeasureOne>

Optional, defaults to 175 degrees in cosine measure. The cosine of the angle above which a U-turn is considered to fail.

Returns: Polyline3D

A new 3D polyline.

Polyline3D.offsetVarWithRef (polyLine, inPlaneOffsetDistances, perpendicularOffsetDistances, refNormal, ?loop, ?varDistParallelBehaviour, ?considerColinearBelow, ?failAtUTurnAbove)

Full Usage: Polyline3D.offsetVarWithRef (polyLine, inPlaneOffsetDistances, perpendicularOffsetDistances, refNormal, ?loop, ?varDistParallelBehaviour, ?considerColinearBelow, ?failAtUTurnAbove)

Parameters:
    polyLine : Polyline3D - A 3D Polyline, open or closed.
    inPlaneOffsetDistances : IList<float> - The offset distances in the local plane defined by two segments. One distance per segment. A positive distance offsets to the inside of the polyline (for counterclockwise polylines when refNormal points up). A negative distance offsets to the outside.
    perpendicularOffsetDistances : IList<float> - The offset distances perpendicular to the local plane. One distance per segment. A positive distance offsets in the same orientation of refNormal. A negative distance offsets in the opposite direction.
    refNormal : UnitVec - A unit vector defining an approximate normal direction for orienting the perpendicular offset and determining inside/outside.
    ?loop : bool - Optional, defaults to false. Set to true to treat an open polyline as a closed loop, even if first and last points are not at the same location.
    ?varDistParallelBehaviour : VarDistParallel - Optional, defaults to Fail. The behavior to use when colinear segments with different offset distances are found.
    ?considerColinearBelow : MeasureProduct<cosine, MeasureOne> - Optional, defaults to 2.5 degrees in cosine measure. The cosine of the angle below which segments are considered colinear.
    ?failAtUTurnAbove : MeasureProduct<cosine, MeasureOne> - Optional, defaults to 175 degrees in cosine measure. The cosine of the angle above which a U-turn is considered to fail.

Returns: Polyline3D A new 3D polyline.

Offsets a Polyline in 3D space by finding the local plane in each corner. Takes a reference normal for orienting the perpendicular offset and determining inside/outside. Auto-detects if given points are from a closed Polyline (first point = last point) and loops them. This function raises an Exception on duplicate points and 180 degree U-turns.

polyLine : Polyline3D

A 3D Polyline, open or closed.

inPlaneOffsetDistances : IList<float>

The offset distances in the local plane defined by two segments. One distance per segment. A positive distance offsets to the inside of the polyline (for counterclockwise polylines when refNormal points up). A negative distance offsets to the outside.

perpendicularOffsetDistances : IList<float>

The offset distances perpendicular to the local plane. One distance per segment. A positive distance offsets in the same orientation of refNormal. A negative distance offsets in the opposite direction.

refNormal : UnitVec

A unit vector defining an approximate normal direction for orienting the perpendicular offset and determining inside/outside.

?loop : bool

Optional, defaults to false. Set to true to treat an open polyline as a closed loop, even if first and last points are not at the same location.

?varDistParallelBehaviour : VarDistParallel

Optional, defaults to Fail. The behavior to use when colinear segments with different offset distances are found.

?considerColinearBelow : MeasureProduct<cosine, MeasureOne>

Optional, defaults to 2.5 degrees in cosine measure. The cosine of the angle below which segments are considered colinear.

?failAtUTurnAbove : MeasureProduct<cosine, MeasureOne>

Optional, defaults to 175 degrees in cosine measure. The cosine of the angle above which a U-turn is considered to fail.

Returns: Polyline3D

A new 3D polyline.

Polyline3D.offsetWithRef (polyLine, inPlaneOffsetDistance, perpendicularOffsetDistance, refNormal, ?loop)

Full Usage: Polyline3D.offsetWithRef (polyLine, inPlaneOffsetDistance, perpendicularOffsetDistance, refNormal, ?loop)

Parameters:
    polyLine : Polyline3D - A 3D Polyline, open or closed.
    inPlaneOffsetDistance : float - The offset distance in the local plane defined by two segments. A positive distance offsets to the inside of the polyline (for counterclockwise polylines when refNormal points up). A negative distance offsets to the outside.
    perpendicularOffsetDistance : float - The offset distance perpendicular to the local plane. A positive distance offsets in the same orientation of refNormal. A negative distance offsets in the opposite direction.
    refNormal : UnitVec - A unit vector defining an approximate normal direction for orienting the perpendicular offset and determining inside/outside.
    ?loop : bool - Optional, defaults to false. Set to true to treat an open polyline as a closed loop, even if first and last points are not at the same location. When loop=true on an open polyline, both distance lists must contain the same number of items as the polyline has points.

Returns: Polyline3D A new 3D polyline.

Offsets a Polyline in 3D space by finding the local plane in each corner. Takes a reference normal for orienting the perpendicular offset and determining inside/outside. Auto-detects if given points are from a closed Polyline (first point = last point) and loops them. This function raises an Exception on duplicate points and 180 degree U-turns.

polyLine : Polyline3D

A 3D Polyline, open or closed.

inPlaneOffsetDistance : float

The offset distance in the local plane defined by two segments. A positive distance offsets to the inside of the polyline (for counterclockwise polylines when refNormal points up). A negative distance offsets to the outside.

perpendicularOffsetDistance : float

The offset distance perpendicular to the local plane. A positive distance offsets in the same orientation of refNormal. A negative distance offsets in the opposite direction.

refNormal : UnitVec

A unit vector defining an approximate normal direction for orienting the perpendicular offset and determining inside/outside.

?loop : bool

Optional, defaults to false. Set to true to treat an open polyline as a closed loop, even if first and last points are not at the same location. When loop=true on an open polyline, both distance lists must contain the same number of items as the polyline has points.

Returns: Polyline3D

A new 3D polyline.

Polyline3D.pointCount p

Full Usage: Polyline3D.pointCount p

Parameters:
Returns: int
Modifiers: inline

Gets the number of points in the Polyline3D.

p : Polyline3D
Returns: int

Polyline3D.removeDuplicateAndColinearPoints angleTolerance distanceTolerance pl

Full Usage: Polyline3D.removeDuplicateAndColinearPoints angleTolerance distanceTolerance pl

Parameters:
Returns: Polyline3D

Removes consecutive duplicate points and colinear points from the Polyline3D within given tolerances. This algorithm allows the last and first point to be identical if the Polyline3D is closed. Colinear points are removed when the angle between segments is smaller than the cosine threshold (e.g. cosine of 0.5 degrees ). If the Polyline3D is closed and starts and ends with colinear segments, the first point is replaced with the last non-colinear point. So the joint of the loop is now moved to the last non-colinear point. So that there are no colinear segments even between start and end. Raises an error if all points are within the distanceTolerance of the first point.

angleTolerance : float<MeasureProduct<cosine, MeasureOne>>
distanceTolerance : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.removeDuplicatePoints distanceTolerance pl

Full Usage: Polyline3D.removeDuplicatePoints distanceTolerance pl

Parameters:
Returns: Polyline3D

Removes consecutive duplicate points from the Polyline3D within a given tolerance. This algorithm allows the last and first point to be identical if the Polyline3D is closed.

distanceTolerance : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.removeDuplicatePointsFaithfully distanceTolerance pl

Full Usage: Polyline3D.removeDuplicatePointsFaithfully distanceTolerance pl

Parameters:
    distanceTolerance : float - The distance within which points are considered duplicates.
    pl : Polyline3D - A 3D Polyline, open or closed.

Returns: Polyline3D

Removes consecutive duplicate points from the Polyline3D within a given tolerance.

This algorithm ensures to keep edges in their position by re-intersecting segments at their closest approach if points are closer than the distanceTolerance but not identical. The position of start and end point is NOT changed. Use Polyline3D.close to ensure start and end point are identical.

distanceTolerance : float

The distance within which points are considered duplicates.

pl : Polyline3D

A 3D Polyline, open or closed.

Returns: Polyline3D

Polyline3D.removeUTurns minCos polyLine

Full Usage: Polyline3D.removeUTurns minCos polyLine

Parameters:
    minCos : float<MeasureProduct<cosine, MeasureOne>> - The angle between segments so that they are considered a U-turn. For example, for 179.9 degrees use 'Cosine.``179.9``'.
    polyLine : Polyline3D - A 3D Polyline, open or closed.

Returns: Polyline3D If no U-turns are present, the List of points of the original Polyline3D is reused and a new Polyline3D is created with that list. If U-turns are present, a new ResizeArray of points is returned with simple U-turns removed.

Removes simple sharp U-Turns from a Polyline

The Offset3D module also has a removeUTurns function that takes precomputed unit vectors and is therefore more efficient. For nested U-turns and colinear points in U-turns segments use 'removeUTurnsDeeply'. That function calls repeatedly until no more U-turns are present.

minCos : float<MeasureProduct<cosine, MeasureOne>>

The angle between segments so that they are considered a U-turn. For example, for 179.9 degrees use 'Cosine.``179.9``'.

polyLine : Polyline3D

A 3D Polyline, open or closed.

Returns: Polyline3D

If no U-turns are present, the List of points of the original Polyline3D is reused and a new Polyline3D is created with that list. If U-turns are present, a new ResizeArray of points is returned with simple U-turns removed.

Polyline3D.removeUTurnsDeeply minCos polyLine

Full Usage: Polyline3D.removeUTurnsDeeply minCos polyLine

Parameters:
    minCos : float<MeasureProduct<cosine, MeasureOne>> - The angle between segments so that they are considered a U-turn. For example, for 179.9 degrees use 'Cosine.``179.9``'.
    polyLine : Polyline3D - A 3D Polyline, open or closed.

Returns: Polyline3D If no U-turns are present, the List of points of the original Polyline3D is reused and a new Polyline3D is created with that list. If U-turns are present, a new ResizeArray of points is returned with all U-turns removed.

Removes all sharp U-Turns from a Polyline recursively until no more U-turns are present. This function calls 'removeUTurns' repeatedly until no more U-turns are present. Use this function when you have nested U-turns and colinear points in U-turns segments.

minCos : float<MeasureProduct<cosine, MeasureOne>>

The angle between segments so that they are considered a U-turn. For example, for 179.9 degrees use 'Cosine.``179.9``'.

polyLine : Polyline3D

A 3D Polyline, open or closed.

Returns: Polyline3D

If no U-turns are present, the List of points of the original Polyline3D is reused and a new Polyline3D is created with that list. If U-turns are present, a new ResizeArray of points is returned with all U-turns removed.

Polyline3D.reverse p

Full Usage: Polyline3D.reverse p

Parameters:
Returns: Polyline3D

Returns new Polyline3D in reversed Order.

p : Polyline3D
Returns: Polyline3D

Polyline3D.reverseInPlace p

Full Usage: Polyline3D.reverseInPlace p

Parameters:
Returns: Polyline3D A reference to the same Polyline3D as the input

Reverse order of the Polyline3D in place.

p : Polyline3D

The Polyline3D to reverse.

Returns: Polyline3D

A reference to the same Polyline3D as the input

Polyline3D.rotate q pl

Full Usage: Polyline3D.rotate q pl

Parameters:
Returns: Polyline3D
Modifiers: inline

Multiplies (or applies) a Quaternion to the Polyline3D. The polyline is rotated around the World Origin.

q : Quaternion
pl : Polyline3D
Returns: Polyline3D

Polyline3D.rotateOnZ r pl

Full Usage: Polyline3D.rotateOnZ r pl

Parameters:
Returns: Polyline3D

Rotation a Polyline3D around Z-Axis.

r : Rotation2D
pl : Polyline3D
Returns: Polyline3D

Polyline3D.rotateOnZWithCenter cen r pl

Full Usage: Polyline3D.rotateOnZWithCenter cen r pl

Parameters:
Returns: Polyline3D

Rotation a Polyline3D round given center point an a local Z-axis.

cen : Pnt
r : Rotation2D
pl : Polyline3D
Returns: Polyline3D

Polyline3D.rotateWithCenter cen q pl

Full Usage: Polyline3D.rotateWithCenter cen q pl

Parameters:
Returns: Polyline3D

Multiplies (or applies) a Quaternion to the Polyline3D to rotate around a given center point.

cen : Pnt
q : Quaternion
pl : Polyline3D
Returns: Polyline3D

Polyline3D.scale factor pl

Full Usage: Polyline3D.scale factor pl

Parameters:
Returns: Polyline3D

Scales the Polyline3D by a given factor. Scale center is World Origin 0,0,0 Returns a new Polyline3D.

factor : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.scaleOn cen factor pl

Full Usage: Polyline3D.scaleOn cen factor pl

Parameters:
Returns: Polyline3D
Modifiers: inline

Scales the 3D polyline by a given factor on a given center point

cen : Pnt
factor : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.secondLastPoint pl

Full Usage: Polyline3D.secondLastPoint pl

Parameters:
Returns: Pnt
Modifiers: inline

Gets the second last point of the Polyline3D.

pl : Polyline3D
Returns: Pnt

Polyline3D.secondPoint pl

Full Usage: Polyline3D.secondPoint pl

Parameters:
Returns: Pnt
Modifiers: inline

Gets the second point of the Polyline3D. This is the point at index 1.

pl : Polyline3D
Returns: Pnt

Polyline3D.segmentCount p

Full Usage: Polyline3D.segmentCount p

Parameters:
Returns: int
Modifiers: inline

Gets the number of segments in the Polyline3D.

p : Polyline3D
Returns: int

Polyline3D.segmentVectors pl

Full Usage: Polyline3D.segmentVectors pl

Parameters:
Returns: ResizeArray<Vec>
Modifiers: inline

Returns the line vectors of all segments of the Polyline3D as a list of Vec. The length of the list is one less than the point count.

pl : Polyline3D
Returns: ResizeArray<Vec>

Polyline3D.segmentVectorsXYZ p

Full Usage: Polyline3D.segmentVectorsXYZ p

Parameters:
Returns: ResizeArray<float>
Modifiers: inline

Returns the line vectors of all segments of the Polyline3D as a flat list of x, y, and z components. The length of the list is 3 less than the xyzs count, so one less vector than points in the polyline.

p : Polyline3D
Returns: ResizeArray<float>

Polyline3D.segments pl

Full Usage: Polyline3D.segments pl

Parameters:
Returns: ResizeArray<Line3D>
Modifiers: inline

Returns all segments of the Polyline3D as a list of Line3D.

pl : Polyline3D
Returns: ResizeArray<Line3D>

Polyline3D.setPnt position pt p

Full Usage: Polyline3D.setPnt position pt p

Parameters:
Modifiers: inline

Sets the point at given position to the given point. ( sets xyzs.[position * 3] and xyzs.[position * 3 + 1] and xyzs.[position * 3 + 2] internally)

position : int
pt : Pnt
p : Polyline3D

Polyline3D.setPointXYZ x y z position p

Full Usage: Polyline3D.setPointXYZ x y z position p

Parameters:
    x : float
    y : float
    z : float
    position : int
    p : Polyline3D

Modifiers: inline

Sets the x, y, and z coordinates of the point at the given index. NOTE: setting the first or last point on a closed Polyline3D might open it. (sets xyzs.[position * 3], xyzs.[position * 3 + 1], and xyzs.[position * 3 + 2] internally )

x : float
y : float
z : float
position : int
p : Polyline3D

Polyline3D.setPointXYZClosed x y z position p

Full Usage: Polyline3D.setPointXYZClosed x y z position p

Parameters:
    x : float
    y : float
    z : float
    position : int
    p : Polyline3D

Modifiers: inline

Sets the x, y, and z coordinates of the point at the given index. On a closed Polyline3D, setting the first or last point will set both to the same point. Raises an error if the index is out of range. (sets xyzs.[position * 3], xyzs.[position * 3 + 1], and xyzs.[position * 3 + 2] internally)

x : float
y : float
z : float
position : int
p : Polyline3D

Polyline3D.signedAreaIn2D pl

Full Usage: Polyline3D.signedAreaIn2D pl

Parameters:
Returns: float
Modifiers: inline

Calculates the signed area of the Polyline3D when projected in 2D. Z values are ignored. The Polyline3D does not need to be actually closed. The signed area of the Polyline3D is calculated. If it is positive the Polyline3D is CCW.

pl : Polyline3D
Returns: float

Polyline3D.start pl

Full Usage: Polyline3D.start pl

Parameters:
Returns: Pnt
Modifiers: inline

Gets first point of the Polyline3D

pl : Polyline3D
Returns: Pnt

Polyline3D.subPolyline a b pl

Full Usage: Polyline3D.subPolyline a b pl

Parameters:
Returns: Polyline3D

Returns new Polyline3D from point at Parameter a to point at Parameter b. If 'a' is bigger than 'b' then the new Polyline3D is in opposite direction. If the start parameter is less than 1e-4 below the next integer it snaps up to that vertex. If the end parameter is less than 1e-4 above the previous integer it snaps down to that vertex. Raises an error if a parameter is outside the domain of the Polyline3D (0.0 to points.Count - 1.0).

a : float
b : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.transform m pl

Full Usage: Polyline3D.transform m pl

Parameters:
Returns: Polyline3D

Applies a 4x4 transformation matrix.

m : Matrix
pl : Polyline3D
Returns: Polyline3D

Polyline3D.transformRigid m pl

Full Usage: Polyline3D.transformRigid m pl

Parameters:
Returns: Polyline3D

Multiplies (or applies) a RigidMatrix to the Polyline3D.

m : RigidMatrix
pl : Polyline3D
Returns: Polyline3D

Polyline3D.translate v pl

Full Usage: Polyline3D.translate v pl

Parameters:
Returns: Polyline3D

Move a Polyline3D by a vector. (same as Polyline3D.move)

v : Vec
pl : Polyline3D
Returns: Polyline3D

Polyline3D.tryFind condition pl

Full Usage: Polyline3D.tryFind condition pl

Parameters:
    condition : float -> float -> float -> bool - A function that takes the X, Y and Z coordinates of a point and returns a boolean indicating whether the condition is satisfied.
    pl : Polyline3D - The Polyline3D to search through.

Returns: Pnt option Some(Pnt) if a point satisfying the condition is found, otherwise None.
Modifiers: inline

Find the first point in the Polyline3D that satisfies a given condition. Returns Some(point) if found, otherwise None.

condition : float -> float -> float -> bool

A function that takes the X, Y and Z coordinates of a point and returns a boolean indicating whether the condition is satisfied.

pl : Polyline3D

The Polyline3D to search through.

Returns: Pnt option

Some(Pnt) if a point satisfying the condition is found, otherwise None.

Polyline3D.tryFindIndex condition pl

Full Usage: Polyline3D.tryFindIndex condition pl

Parameters:
    condition : float -> float -> float -> bool - A function that takes the X, Y and Z coordinates of a point and returns a boolean indicating whether the condition is satisfied.
    pl : Polyline3D - The Polyline3D to search through.

Returns: int option Some(index of x) the index of the x value in the polylines flat array if found, otherwise None.
Modifiers: inline

Find the index of the first point in the Polyline3D that satisfies a given condition. Returns Some(index) if found, otherwise None.

condition : float -> float -> float -> bool

A function that takes the X, Y and Z coordinates of a point and returns a boolean indicating whether the condition is satisfied.

pl : Polyline3D

The Polyline3D to search through.

Returns: int option

Some(index of x) the index of the x value in the polylines flat array if found, otherwise None.

Polyline3D.tryFindLast condition pl

Full Usage: Polyline3D.tryFindLast condition pl

Parameters:
    condition : float -> float -> float -> bool - A function that takes the X, Y and Z coordinates of a point and returns a boolean indicating whether the condition is satisfied.
    pl : Polyline3D - The Polyline3D to search through.

Returns: Pnt option Some(Pnt) if a point satisfying the condition is found, otherwise None.
Modifiers: inline

Find the last point in the Polyline3D that satisfies a given condition. Returns Some(point) if found, otherwise None.

condition : float -> float -> float -> bool

A function that takes the X, Y and Z coordinates of a point and returns a boolean indicating whether the condition is satisfied.

pl : Polyline3D

The Polyline3D to search through.

Returns: Pnt option

Some(Pnt) if a point satisfying the condition is found, otherwise None.

Polyline3D.tryFindLastIndex condition pl

Full Usage: Polyline3D.tryFindLastIndex condition pl

Parameters:
    condition : float -> float -> float -> bool - A function that takes the X, Y and Z coordinates of a point and returns a boolean indicating whether the condition is satisfied.
    pl : Polyline3D - The Polyline3D to search through.

Returns: int option Some(index of x) the index of the x value in the polylines flat array if found, otherwise None.
Modifiers: inline

Find the index of the last point in the Polyline3D that satisfies a given condition. Returns Some(index) if found, otherwise None.

condition : float -> float -> float -> bool

A function that takes the X, Y and Z coordinates of a point and returns a boolean indicating whether the condition is satisfied.

pl : Polyline3D

The Polyline3D to search through.

Returns: int option

Some(index of x) the index of the x value in the polylines flat array if found, otherwise None.

Type something to start searching.