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, ... The instance members for transformations, like Move, Scale or Rotate, and for clean up, like Reverse, Close or RemoveDuplicatePoints, mutate the Polyline3D in place and return unit. Their static counterparts, like Polyline3D.move, Polyline3D.reverse or Polyline3D.removeDuplicatePoints, return a new Polyline3D and leave the input unchanged. The indexed point setters and movers, setPoint, setPointPreservingClosure, setXYZ, setXYZPreservingClosure, movePoint, moveXYZ, movePointPreservingClosure and moveXYZPreservingClosure, and the append functions addPoint and addXYZ mutate in place and return unit, as instance and as static members. Taking a point index alone does not mean mutation: getPoint, getX, getY, getZ and getLine only read the Polyline3D. XYZs and xyzs expose the live coordinate buffer, changes to it change the Polyline3D.

Constructors

Constructor Description

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.

pnt : 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 a 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. The returned vector is not unitized, its length is twice the area of the polygon projected onto that plane. Fails if the summed normal is shorter than 1e-6, because then no normal can be found. This happens if: the Polyline3D has less than 3 points, or all points are in one line, or the cross products cancel each other out on a self intersecting shape, or the Polyline3D is very small. Use TryAverageNormal to get ValueNone instead of an exception. For the last two cases Polyline3D.AveragePlane still finds a plane.

Returns: Vec

this.AveragePlane

Full Usage: this.AveragePlane

Parameters:
    ?tolerance : float

Returns: NPlane

Returns the average plane of the Polyline3D, even if the points are not planar. As opposed to Polyline3D.TryPlane this does not check if all points are on that plane. The origin of the returned NPlane is the average of all points, see Polyline3D.Center. The normal is the unitized Polyline3D.AverageNormal, so it follows the order of the points. If they are counter-clockwise in the World X-Y plane, then the normal points in World Z direction. On self intersecting shapes, where these cross products cancel each other out, the orientation is arbitrary. The optional 'tolerance' is the maximum distance for considering all points to be on one point or on one line, it defaults to 1e-6. Fails if the Polyline3D has less than 3 points, or if all points are within the tolerance of one point or of one line, because then there is no unique plane.

?tolerance : float
Returns: NPlane

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.Close

Full Usage: this.Close

Parameters:
    ?toleranceForAddingPoint : float - Optional. 1e-6 by default The tolerance used to decide whether to snap the last point to the first point.

Closes the Polyline3D in place 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. Raises an error if the Polyline3D has fewer than 3 points.

?toleranceForAddingPoint : float

Optional. 1e-6 by default The tolerance used to decide whether to snap the last point to the first point.

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 .

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. This might be a point on a segment or a vertex of the Polyline3D.

p : Pnt
Returns: Pnt

this.ClosestPointIndex

Full Usage: this.ClosestPointIndex

Parameters:
Returns: int

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

p : Pnt
Returns: int

this.DistanceToPnt

Full Usage: this.DistanceToPnt

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 the last or end point of the Polyline3D. This is the point at index Points.Count - 1. Same as Polyline3D.LastPoint Setting it mutates the Polyline3D in place and moves only this one point, so a closed Polyline3D gets opened. Use SetXYZPreservingClosure or MovePointPreservingClosure to keep it closed.

Returns: Pnt

this.EnsureClockwiseIn2D

Full Usage: this.EnsureClockwiseIn2D

Tests if the Polyline3D is Clockwise when projected in 2D (Z values are ignored). If not, reverses the Polyline3D in place. Raises an error if the area of the Polyline3D in 2D is zero.

this.EnsureCounterClockwiseIn2D

Full Usage: this.EnsureCounterClockwiseIn2D

Tests if the Polyline3D is counter-clockwise when projected in 2D (Z values are ignored). If not, reverses the Polyline3D in place. Raises an error if the area of the Polyline3D in 2D is zero.

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 Setting it mutates the Polyline3D in place and moves only this one point, so a closed Polyline3D gets opened. Use SetXYZPreservingClosure or MovePointPreservingClosure to keep it closed.

Returns: Pnt

this.FirstSegment

Full Usage: this.FirstSegment

Returns: Line3D

Gets the first segment of the Polyline3D.

Returns: Line3D

this.GetPoint

Full Usage: this.GetPoint

Parameters:
    pointIndex : int

Returns: Pnt

Gets the 3D point at the given pointIndex in the list of points. (this gets Pnt(XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1], XYZs.[pointIndex * 3 + 2]) from the internal flat list of x, y, and z coordinates )

pointIndex : 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:
    pointIndex : int

Returns: float

Gets the x coordinate of the 3D point at the given pointIndex in the list of points. (this gets XYZs.[pointIndex * 3] from the internal flat list of x, y, and z coordinates )

pointIndex : int
Returns: float

this.GetY

Full Usage: this.GetY

Parameters:
    pointIndex : int

Returns: float

Gets the y coordinate of the 3D point at the given pointIndex in the list of points. (this gets XYZs.[pointIndex * 3 + 1] from the internal flat list of x, y, and z coordinates )

pointIndex : int
Returns: float

this.GetZ

Full Usage: this.GetZ

Parameters:
    pointIndex : int

Returns: float

Gets the z coordinate of the 3D point at the given pointIndex in the list of points. (this gets XYZs.[pointIndex * 3 + 2] from the internal flat list of x, y, and z coordinates )

pointIndex : 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 fewer 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 fewer than 3 points.

Returns: bool

this.IsCounterClockwiseIn2D

Full Usage: this.IsCounterClockwiseIn2D

Returns: bool

Test if Polyline3D is counter-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 positive the Polyline3D is counter-clockwise.

Returns: bool

this.IsPlanar

Full Usage: this.IsPlanar

Parameters:
    ?tolerance : float

Returns: bool

Tests if all points of the Polyline3D lie in one plane. The optional 'tolerance' is the maximum distance any point may have from that plane, it defaults to 1e-6. Returns FALSE if the Polyline3D has less than 3 points, or if all points are within the tolerance of one point or of one line, because then there is no unique plane.

?tolerance : float
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 Setting it mutates the Polyline3D in place and moves only this one point, so a closed Polyline3D gets opened. Use SetXYZPreservingClosure or MovePointPreservingClosure to keep it closed.

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. The sum of the lengths of all segments. Returns 0.0 if there are fewer than 2 points.

Returns: float

this.Move

Full Usage: this.Move

Parameters:

Moves the Polyline3D in place by a vector.

v : Vec

this.MovePoint

Full Usage: this.MovePoint

Parameters:
    pointIndex : int - The index of the point to move. Must be between 0 and PointCount - 1.
    v : Vec - The vector to move the point by.

Moves the 3D point at the given pointIndex in place by a vector. NOTE: moving the first or last point on a closed Polyline3D opens it. Use MovePointPreservingClosure to keep it closed. (this adds v.X, v.Y and v.Z to XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1] and XYZs.[pointIndex * 3 + 2] in the internal flat list of x, y, and z coordinates )

pointIndex : int

The index of the point to move. Must be between 0 and PointCount - 1.

v : Vec

The vector to move the point by.

this.MovePointPreservingClosure

Full Usage: this.MovePointPreservingClosure

Parameters:
    pointIndex : int - The index of the point to move. Must be between 0 and PointCount - 1.
    v : Vec - The vector to move the point by.

Moves the 3D point at the given pointIndex in place by a vector. On a closed Polyline3D, moving the first or last point moves both, so it stays closed. (this adds v.X, v.Y and v.Z to XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1] and XYZs.[pointIndex * 3 + 2] in the internal flat list of x, y, and z coordinates )

pointIndex : int

The index of the point to move. Must be between 0 and PointCount - 1.

v : Vec

The vector to move the point by.

this.MoveX

Full Usage: this.MoveX

Parameters:
    distance : float

Moves the Polyline3D in place by a given distance in X direction.

distance : float

this.MoveXYZ

Full Usage: this.MoveXYZ

Parameters:
    pointIndex : int - The index of the point to move. Must be between 0 and PointCount - 1.
    x : float - The distance to move the point in X direction.
    y : float - The distance to move the point in Y direction.
    z : float - The distance to move the point in Z direction.

Moves the 3D point at the given pointIndex in place by the given x, y, and z distances. NOTE: moving the first or last point on a closed Polyline3D opens it. Use MoveXYZPreservingClosure to keep it closed. (this adds x, y and z to XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1] and XYZs.[pointIndex * 3 + 2] in the internal flat list of x, y, and z coordinates )

pointIndex : int

The index of the point to move. Must be between 0 and PointCount - 1.

x : float

The distance to move the point in X direction.

y : float

The distance to move the point in Y direction.

z : float

The distance to move the point in Z direction.

this.MoveXYZPreservingClosure

Full Usage: this.MoveXYZPreservingClosure

Parameters:
    pointIndex : int - The index of the point to move. Must be between 0 and PointCount - 1.
    x : float - The distance to move the point in X direction.
    y : float - The distance to move the point in Y direction.
    z : float - The distance to move the point in Z direction.

Moves the 3D point at the given pointIndex in place by the given x, y, and z distances. On a closed Polyline3D, moving the first or last point moves both, so it stays closed. (this adds x, y and z to XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1] and XYZs.[pointIndex * 3 + 2] in the internal flat list of x, y, and z coordinates )

pointIndex : int

The index of the point to move. Must be between 0 and PointCount - 1.

x : float

The distance to move the point in X direction.

y : float

The distance to move the point in Y direction.

z : float

The distance to move the point in Z direction.

this.MoveY

Full Usage: this.MoveY

Parameters:
    distance : float

Moves the Polyline3D in place by a given distance in Y direction.

distance : float

this.MoveZ

Full Usage: this.MoveZ

Parameters:
    distance : float

Moves the Polyline3D in place by a given distance in Z direction.

distance : float

this.PointCount

Full Usage: this.PointCount

Returns: int

Gets the number of points in the Polyline3D.

Returns: int

this.RemoveDuplicateAndCollinearPoints

Full Usage: this.RemoveDuplicateAndCollinearPoints

Parameters:

Removes consecutive duplicate points and collinear points from the Polyline3D in place, within given tolerances. This algorithm allows the last and first point to be identical if the Polyline3D is closed. Collinear 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 collinear segments, the first point is replaced with the last non-collinear point. So the joint of the loop is now moved to the last non-collinear point. So that there are no collinear segments even between start and end. Raises an error if all points are within the distanceTolerance of the first point. In that case the Polyline3D is not changed.

angleTolerance : float<MeasureProduct<cosine, MeasureOne>>
distanceTolerance : float

this.RemoveDuplicatePoints

Full Usage: this.RemoveDuplicatePoints

Parameters:
    distanceTolerance : float - The distance within which points are considered duplicates.

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

From a cluster of points that are closer than the distanceTolerance, only the first point is kept. Use 'RemoveDuplicatePointsFaithfully' if you want to keep the edges in their position by re-intersecting segments. The position of start and end point is NOT changed. Use Close to ensure start and end point are identical.

distanceTolerance : float

The distance within which points are considered duplicates.

this.RemoveDuplicatePointsAndReport

Full Usage: this.RemoveDuplicatePointsAndReport

Parameters:
    distanceTolerance : float - The distance within which points are considered duplicates.

Returns: ResizeArray<Pnt> The removed duplicate points, with consecutive identical entries listed once per run. An empty list if no duplicates were found and the Polyline3D was not changed.

Removes consecutive duplicate points from the Polyline3D in place, within a given tolerance, and returns them. Same as 'RemoveDuplicatePoints', but also reports the points that were removed.

distanceTolerance : float

The distance within which points are considered duplicates.

Returns: ResizeArray<Pnt>

The removed duplicate points, with consecutive identical entries listed once per run. An empty list if no duplicates were found and the Polyline3D was not changed.

this.RemoveDuplicatePointsFaithfully

Full Usage: this.RemoveDuplicatePointsFaithfully

Parameters:
    distanceTolerance : float - The distance within which points are considered duplicates.

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

This algorithm keeps 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 Close to ensure start and end point are identical.

distanceTolerance : float

The distance within which points are considered duplicates.

this.RemoveUTurns

Full Usage: this.RemoveUTurns

Parameters:

Removes simple sharp U-Turns from the Polyline3D in place.

The Offset3D module also has a removeUTurns function that takes precomputed unit vectors and is therefore more efficient. For nested U-turns and collinear 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``'.

this.RemoveUTurnsDeeply

Full Usage: this.RemoveUTurnsDeeply

Parameters:

Removes all sharp U-Turns from the Polyline3D in place, 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 collinear points in U-turns segments.

If an error is raised in any of the repeated calls, the Polyline3D is not changed.

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``'.

this.Reverse

Full Usage: this.Reverse

Reverses the order of the Polyline3D in place.

this.Rotate

Full Usage: this.Rotate

Parameters:

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

q : Quaternion

this.RotateAround

Full Usage: this.RotateAround

Parameters:
    cen : Pnt - The center point of the rotation.
    q : Quaternion - The rotation to apply.

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

cen : Pnt

The center point of the rotation.

q : Quaternion

The rotation to apply.

this.RotateOnZ

Full Usage: this.RotateOnZ

Parameters:

Rotates the Polyline3D in place around the Z-axis.

r : Rotation2D

this.RotateOnZAround

Full Usage: this.RotateOnZAround

Parameters:

Rotates the Polyline3D in place around the local Z-axis through the given center point.

cen : Pnt
r : Rotation2D

this.Scale

Full Usage: this.Scale

Parameters:
    factor : float

Scales the Polyline3D in place by a given factor. Scale center is World Origin 0,0,0

factor : float

this.ScaleOn

Full Usage: this.ScaleOn

Parameters:
    cen : Pnt - The center point of the scaling.
    factor : float - The scale factor.

Scales the Polyline3D in place by a given factor around a given center point.

cen : Pnt

The center point of the scaling.

factor : float

The scale factor.

this.SecondLastPoint

Full Usage: this.SecondLastPoint

Returns: Pnt

Gets or sets the second last point of the Polyline3D. Setting it mutates the Polyline3D in place.

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. Setting it mutates the Polyline3D in place.

Returns: Pnt

this.SegmentCount

Full Usage: this.SegmentCount

Returns: int

Gets the number of segments in the Polyline3D. This is the point count minus one, but never negative.

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.SetPoint

Full Usage: this.SetPoint

Parameters:
    pointIndex : int
    pnt : Pnt

Sets the 3D point at the given pointIndex in the list of points. (this sets XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1], and XYZs.[pointIndex * 3 + 2] in the internal flat list of x, y, and z coordinates )

pointIndex : int
pnt : Pnt

this.SetPointPreservingClosure

Full Usage: this.SetPointPreservingClosure

Parameters:
    pointIndex : int
    pnt : Pnt

Sets the 3D point at the given pointIndex in the list of points. On a closed Polyline3D, setting the first or last point will set both to the same point. Raises an error if the pointIndex is out of range. (this sets XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1], and XYZs.[pointIndex * 3 + 2] in the internal flat list of x, y, and z coordinates )

pointIndex : int
pnt : Pnt

this.SetXYZ

Full Usage: this.SetXYZ

Parameters:
    pointIndex : int
    x : float
    y : float
    z : float

Sets the x, y, and z coordinates of the 3D point at the given pointIndex in the list of points. NOTE: setting the first or last point on a closed Polyline3D might open it. (this sets XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1], and XYZs.[pointIndex * 3 + 2] in the internal flat list of x, y, and z coordinates )

pointIndex : int
x : float
y : float
z : float

this.SetXYZPreservingClosure

Full Usage: this.SetXYZPreservingClosure

Parameters:
    pointIndex : int
    x : float
    y : float
    z : float

Sets the x, y, and z coordinates of the 3D point at the given pointIndex in the list of points. On a closed Polyline3D, setting the first or last point will set both to the same point. Raises an error if the pointIndex is out of range. (this sets XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1], and XYZs.[pointIndex * 3 + 2] in the internal flat list of x, y, and z coordinates )

pointIndex : 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. If it is positive the Polyline3D is counter-clockwise. Polyline does not need to be exactly closed. The segment from the last point to the first point is included in the area calculation. For self-intersecting Polylines the result is invalid. Raises an error on an empty Polyline3D.

Returns: float

this.Start

Full Usage: this.Start

Returns: Pnt

Gets or sets the first point of the Polyline3D. This is the point at index 0. Same as Polyline3D.FirstPoint Setting it mutates the Polyline3D in place and moves only this one point, so a closed Polyline3D gets opened. Use SetXYZPreservingClosure or MovePointPreservingClosure to keep it closed.

Returns: Pnt

this.Transform

Full Usage: this.Transform

Parameters:

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

m : Matrix

this.TransformRigid

Full Usage: this.TransformRigid

Parameters:

Multiplies (or applies) a RigidMatrix to the Polyline3D in place.

m : RigidMatrix

this.TryAverageNormal

Full Usage: this.TryAverageNormal

Returns: Vec voption

Returns the average normal vector of the Polyline3D, or ValueNone if it is degenerate. It is calculated by summing up the cross products of all segments around the center point, so it is the same vector as Polyline3D.AverageNormal, but bad input returns ValueNone instead of raising an exception. The returned vector is not unitized, its length is twice the area of the polygon projected onto that plane. Returns ValueNone if the summed normal is shorter than 1e-6. This happens if: the Polyline3D has less than 3 points, or all points are in one line, or the cross products cancel each other out on a self intersecting shape, or the Polyline3D is very small. For these last two cases Polyline3D.TryAveragePlane still finds a plane.

Returns: Vec voption

this.TryAveragePlane

Full Usage: this.TryAveragePlane

Parameters:
    ?tolerance : float

Returns: NPlane voption

Tries to find the average plane of the Polyline3D, even if the points are not planar. As opposed to Polyline3D.TryPlane this does not check if all points are on that plane. The origin of the returned NPlane is the average of all points, see Polyline3D.Center. The normal is the unitized Polyline3D.AverageNormal, so it follows the order of the points. If they are counter-clockwise in the World X-Y plane, then the normal points in World Z direction. On self intersecting shapes, where these cross products cancel each other out, the orientation is arbitrary. The optional 'tolerance' is the maximum distance for considering all points to be on one point or on one line, it defaults to 1e-6. Returns ValueNone if the Polyline3D has less than 3 points, or if all points are within the tolerance of one point or of one line, because then there is no unique plane.

?tolerance : float
Returns: NPlane voption

this.TryPlane

Full Usage: this.TryPlane

Parameters:
    ?tolerance : float

Returns: NPlane voption

Tries to find the plane that all points of the Polyline3D lie in. The optional 'tolerance' is the maximum distance any point may have from the plane, it defaults to 1e-6. The origin of the returned NPlane is the average of all points, see Polyline3D.Center. The orientation of the normal follows the order of the points. If they are counter-clockwise in the World X-Y plane, then the normal points in World Z direction. On self intersecting shapes, where these cross products cancel each other out, the orientation is arbitrary. Returns ValueNone if: the Polyline3D has less than 3 points, or all points are within the tolerance of one point or of one line, so that there is no unique plane, or any point is further away from the plane than the tolerance. Use Polyline3D.TryAveragePlane to get the average plane of non planar points too.

?tolerance : float
Returns: NPlane voption

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 pnt p

Full Usage: Polyline3D.addPoint pnt p

Parameters:
Modifiers: inline

Adds a point to the end of the Polyline3D.

pnt : 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 a 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. The returned vector is not unitized, its length is twice the area of the polygon projected onto that plane. Fails if the summed normal is shorter than 1e-6, because then no normal can be found. This happens if: the Polyline3D has less than 3 points, or all points are in one line, or the cross products cancel each other out on a self intersecting shape, or the Polyline3D is very small. Use tryAverageNormal to get ValueNone instead of an exception. For the last two cases Polyline3D.averagePlane still finds a plane.

pl : Polyline3D
Returns: Vec

Polyline3D.averagePlane tolerance pl

Full Usage: Polyline3D.averagePlane tolerance pl

Parameters:
Returns: NPlane
Modifiers: inline

Returns the average plane of the Polyline3D, even if the points are not planar. As opposed to Polyline3D.tryPlane this does not check if all points are on that plane. The origin of the returned NPlane is the average of all points, see Polyline3D.center. The normal is the unitized Polyline3D.averageNormal, so it follows the order of the points. If they are counter-clockwise in the World X-Y plane, then the normal points in World Z direction. On self intersecting shapes, where these cross products cancel each other out, the orientation is arbitrary. The 'tolerance' is the maximum distance for considering all points to be on one point or on one line. Use 1e-6 as a default. Fails if the Polyline3D has less than 3 points, or if all points are within the tolerance of one point or of one line, because then there is no unique plane.

tolerance : float
pl : Polyline3D
Returns: NPlane

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:
    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 new closed Polyline3D. Use p.Close to close in place.

Returns a new closed Polyline3D. The input Polyline3D is not changed. 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. Raises an error if the Polyline3D has fewer than 3 points.

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 new closed Polyline3D. Use p.Close to close in place.

Polyline3D.closestParameter pnt pl

Full Usage: Polyline3D.closestParameter pnt pl

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 .

pnt : Pnt
pl : Polyline3D
Returns: float

Polyline3D.closestParameterXYZ x y z pl

Full Usage: Polyline3D.closestParameterXYZ x y z pl

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 .

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

Polyline3D.closestPoint pnt pl

Full Usage: Polyline3D.closestPoint pnt pl

Parameters:
Returns: Pnt
Modifiers: inline

Returns the point on the Polyline3D that is the closest point to the given point. This might be a point on a segment or a vertex of the Polyline3D.

pnt : Pnt
pl : Polyline3D
Returns: Pnt

Polyline3D.closestPointIndex pnt pl

Full Usage: Polyline3D.closestPointIndex pnt pl

Parameters:
Returns: int
Modifiers: inline

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

pnt : Pnt
pl : Polyline3D
Returns: int

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.createFromMembersXY xyObjs

Full Usage: Polyline3D.createFromMembersXY 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.createFromMembersXYZ xyzObjs

Full Usage: Polyline3D.createFromMembersXYZ 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.createFromMembersxy xyObjs

Full Usage: Polyline3D.createFromMembersxy 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.createFromMembersxyz xyzObjs

Full Usage: Polyline3D.createFromMembersxyz 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.createFromPnts points

Full Usage: Polyline3D.createFromPnts points

Parameters:
    points : Pnt seq

Returns: Polyline3D

Create a new Polyline3D by copying over all points. This will allocate a new ResizeArray and copy 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.createFromXYZs xyzs

Full Usage: Polyline3D.createFromXYZs xyzs

Parameters:
    xyzs : ResizeArray<float>

Returns: Polyline3D

Create a new Polyline3D by using the provided X, Y and Z interleaved ResizeArray directly. The buffer is shared, not copied: later changes to the ResizeArray will be reflected in the Polyline3D, and vice versa.

xyzs : ResizeArray<float>
Returns: Polyline3D

Polyline3D.distanceToPnt pnt pl

Full Usage: Polyline3D.distanceToPnt pnt pl

Parameters:
Returns: float
Modifiers: inline

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

pnt : Pnt
pl : Polyline3D
Returns: float

Polyline3D.distanceToXYZ x y z pl

Full Usage: Polyline3D.distanceToXYZ x y z pl

Parameters:
Returns: float
Modifiers: inline

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

x : float
y : float
z : float
pl : Polyline3D
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

Returns a new Polyline3D that is Clockwise when projected in 2D (Z values are ignored). It is reversed if the input is counter-clockwise. The input Polyline3D is not changed. Raises an error if the area of the Polyline3D in 2D is zero.

pl : Polyline3D
Returns: Polyline3D

Polyline3D.ensureCounterClockwiseIn2D pl

Full Usage: Polyline3D.ensureCounterClockwiseIn2D pl

Parameters:
Returns: Polyline3D
Modifiers: inline

Returns a new Polyline3D that is counter-clockwise when projected in 2D (Z values are ignored). It is reversed if the input is clockwise. The input Polyline3D is not changed. Raises an error if the area of the Polyline3D in 2D is zero.

pl : Polyline3D
Returns: Polyline3D

Polyline3D.equalsExact pl1 pl2

Full Usage: Polyline3D.equalsExact 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. The same instance is always equal to itself. Otherwise a NaN coordinate is never 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.equalsWithin tol pl1 pl2

Full Usage: Polyline3D.equalsWithin tol pl1 pl2

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

Returns: bool TRUE if the two Polyline3D instances are equal within the tolerance, otherwise FALSE.

Tests if two Polyline3D have the same point count and if their corresponding points are equal within a given tolerance. The tolerance applies to the X, Y and Z coordinates of each point separately, not to the Euclidean distance between the points. The same instance is always equal to itself. Otherwise a NaN coordinate is never equal. Use Polyline3D.equalsExact to check for an exact match.

tol : float

The tolerance value for comparing each coordinate.

pl1 : Polyline3D

The first Polyline3D instance.

pl2 : Polyline3D

The second Polyline3D instance.

Returns: bool

TRUE if the two Polyline3D instances are equal within the tolerance, otherwise FALSE.

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 . If the parameter is within 1e-6 of an integer value, the integer value is used as parameter.

t : float
pl : Polyline3D
Returns: Pnt

Polyline3D.findAllSelfIntersections pl

Full Usage: Polyline3D.findAllSelfIntersections pl

Parameters:
Returns: ResizeArray<Pnt * int * int> A new list of points on the first segment with the indices of the two intersecting segments, sorted by the first and then by the second segment index. The first index is always smaller than the second. The list is empty if no intersection is found.

Finds all intersections between non-adjacent segments in O(n²) time, with the same rules as Polyline3D.tryFindSelfIntersection: Excludes the closure joint when endpoints are within 1e-7, parallel overlaps (angle below 0.25 degrees), and segments shorter than 1e-6. Uses the XLine3D endpoint parameter tolerance of 1e-6. The closest separation must be less than 1e-6. Use Polyline3D.findAllSelfIntersectionsWithin to set this tolerance.

pl : Polyline3D

The polyline to search.

Returns: ResizeArray<Pnt * int * int>

A new list of points on the first segment with the indices of the two intersecting segments, sorted by the first and then by the second segment index. The first index is always smaller than the second. The list is empty if no intersection is found.

Polyline3D.findAllSelfIntersectionsWithin maxSkewDistance pl

Full Usage: Polyline3D.findAllSelfIntersectionsWithin maxSkewDistance pl

Parameters:
    maxSkewDistance : float - Finite, nonnegative separation tolerance.
    pl : Polyline3D - The polyline to search.

Returns: ResizeArray<Pnt * int * int> A new list of points on the first segment with the indices of the two intersecting segments, sorted by the first and then by the second segment index. The first index is always smaller than the second. The list is empty if no intersection is found.

Finds all intersections between non-adjacent segments in O(n²) time, with the same rules as Polyline3D.tryFindSelfIntersectionWithin: Excludes the closure joint when endpoints are within 1e-7, parallel overlaps (angle below 0.25 degrees), and segments shorter than 1e-6. Uses the XLine3D endpoint parameter tolerance of 1e-6. The closest separation must be strictly less than maxSkewDistance; zero therefore finds no intersections. Use Polyline3D.findAllSelfIntersections for the default maxSkewDistance of 1e-6.

maxSkewDistance : float

Finite, nonnegative separation tolerance.

pl : Polyline3D

The polyline to search.

Returns: ResizeArray<Pnt * int * int>

A new list of points on the first segment with the indices of the two intersecting segments, sorted by the first and then by the second segment index. The first index is always smaller than the second. The list is empty if no intersection is found.

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.getPoint pointIndex p

Full Usage: Polyline3D.getPoint pointIndex p

Parameters:
Returns: Pnt
Modifiers: inline

Gets the 3D point at the given pointIndex in the list of points. (this gets Pnt(XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1], XYZs.[pointIndex * 3 + 2]) from the internal flat list of x, y, and z coordinates )

pointIndex : 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 pointIndex p

Full Usage: Polyline3D.getX pointIndex p

Parameters:
Returns: float
Modifiers: inline

Gets the x coordinate of the 3D point at the given pointIndex in the list of points. (this gets XYZs.[pointIndex * 3] from the internal flat list of x, y, and z coordinates )

pointIndex : int
p : Polyline3D
Returns: float

Polyline3D.getY pointIndex p

Full Usage: Polyline3D.getY pointIndex p

Parameters:
Returns: float
Modifiers: inline

Gets the y coordinate of the 3D point at the given pointIndex in the list of points. (this gets XYZs.[pointIndex * 3 + 1] from the internal flat list of x, y, and z coordinates )

pointIndex : int
p : Polyline3D
Returns: float

Polyline3D.getZ pointIndex p

Full Usage: Polyline3D.getZ pointIndex p

Parameters:
Returns: float
Modifiers: inline

Gets the z coordinate of the 3D point at the given pointIndex in the list of points. (this gets XYZs.[pointIndex * 3 + 2] from the internal flat list of x, y, and z coordinates )

pointIndex : 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 fewer 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 fewer than 3 points.

pl : Polyline3D
Returns: bool

Polyline3D.isCounterClockwiseIn2D pl

Full Usage: Polyline3D.isCounterClockwiseIn2D pl

Parameters:
Returns: bool
Modifiers: inline

Test if Polyline3D is counter-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 positive the Polyline3D is counter-clockwise.

pl : Polyline3D
Returns: bool

Polyline3D.isPlanar tolerance pl

Full Usage: Polyline3D.isPlanar tolerance pl

Parameters:
Returns: bool
Modifiers: inline

Tests if all points of the Polyline3D lie in one plane. The 'tolerance' is the maximum distance any point may have from that plane. Use 1e-6 as a default. Returns FALSE if the Polyline3D has less than 3 points, or if all points are within the tolerance of one point or of one line, because then there is no unique plane.

tolerance : float
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.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.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 pointIndex of the point ( = array index/3) 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 pointIndex of the point ( = array index/3) 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. Returns 0.0 if there are fewer than 2 points.

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 Polyline3D. 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 Polyline3D. 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 Polyline3D 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 pointIndex of the point ( = array index/3) 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 the pointIndex (not the index into the flat coordinate array). Returns new Polyline3D.

mapping : int -> Pnt -> Pnt

A function that takes the pointIndex of the point ( = array index/3) 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

Returns a new Polyline3D moved by a vector. The input Polyline3D is not changed.

v : Vec
pl : Polyline3D
Returns: Polyline3D

Polyline3D.movePoint pointIndex v p

Full Usage: Polyline3D.movePoint pointIndex v p

Parameters:
    pointIndex : int - The index of the point to move. Must be between 0 and PointCount - 1.
    v : Vec - The vector to move the point by.
    p : Polyline3D - The Polyline3D to change.

Modifiers: inline

Moves the 3D point at the given pointIndex in place by a vector. NOTE: moving the first or last point on a closed Polyline3D opens it. Use Polyline3D.movePointPreservingClosure to keep it closed.

pointIndex : int

The index of the point to move. Must be between 0 and PointCount - 1.

v : Vec

The vector to move the point by.

p : Polyline3D

The Polyline3D to change.

Polyline3D.movePointPreservingClosure pointIndex v p

Full Usage: Polyline3D.movePointPreservingClosure pointIndex v p

Parameters:
    pointIndex : int - The index of the point to move. Must be between 0 and PointCount - 1.
    v : Vec - The vector to move the point by.
    p : Polyline3D - The Polyline3D to change.

Modifiers: inline

Moves the 3D point at the given pointIndex in place by a vector. On a closed Polyline3D, moving the first or last point moves both, so it stays closed.

pointIndex : int

The index of the point to move. Must be between 0 and PointCount - 1.

v : Vec

The vector to move the point by.

p : Polyline3D

The Polyline3D to change.

Polyline3D.moveX distance pl

Full Usage: Polyline3D.moveX distance pl

Parameters:
Returns: Polyline3D

Returns a new Polyline3D moved by a given distance in X direction. The input Polyline3D is not changed.

distance : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.moveXYZ pointIndex x y z p

Full Usage: Polyline3D.moveXYZ pointIndex x y z p

Parameters:
    pointIndex : int - The index of the point to move. Must be between 0 and PointCount - 1.
    x : float - The distance to move the point in X direction.
    y : float - The distance to move the point in Y direction.
    z : float - The distance to move the point in Z direction.
    p : Polyline3D - The Polyline3D to change.

Modifiers: inline

Moves the 3D point at the given pointIndex in place by the given x, y, and z distances. NOTE: moving the first or last point on a closed Polyline3D opens it. Use Polyline3D.moveXYZPreservingClosure to keep it closed.

pointIndex : int

The index of the point to move. Must be between 0 and PointCount - 1.

x : float

The distance to move the point in X direction.

y : float

The distance to move the point in Y direction.

z : float

The distance to move the point in Z direction.

p : Polyline3D

The Polyline3D to change.

Polyline3D.moveXYZPreservingClosure pointIndex x y z p

Full Usage: Polyline3D.moveXYZPreservingClosure pointIndex x y z p

Parameters:
    pointIndex : int - The index of the point to move. Must be between 0 and PointCount - 1.
    x : float - The distance to move the point in X direction.
    y : float - The distance to move the point in Y direction.
    z : float - The distance to move the point in Z direction.
    p : Polyline3D - The Polyline3D to change.

Modifiers: inline

Moves the 3D point at the given pointIndex in place by the given x, y, and z distances. On a closed Polyline3D, moving the first or last point moves both, so it stays closed.

pointIndex : int

The index of the point to move. Must be between 0 and PointCount - 1.

x : float

The distance to move the point in X direction.

y : float

The distance to move the point in Y direction.

z : float

The distance to move the point in Z direction.

p : Polyline3D

The Polyline3D to change.

Polyline3D.moveY distance pl

Full Usage: Polyline3D.moveY distance pl

Parameters:
Returns: Polyline3D

Returns a new Polyline3D moved by a given distance in Y direction. The input Polyline3D is not changed.

distance : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.moveZ distance pl

Full Usage: Polyline3D.moveZ distance pl

Parameters:
Returns: Polyline3D

Returns a new Polyline3D moved by a given distance in Z direction. The input Polyline3D is not changed.

distance : float
pl : Polyline3D
Returns: Polyline3D

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 counter-clockwise 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, on U-turns sharper than 175 degrees, and if the average normal cannot be computed, for example if all points are collinear.

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 counter-clockwise 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.offsetByNormal refNormal inPlaneOffsetDistance perpendicularOffsetDistance polyLine

Full Usage: Polyline3D.offsetByNormal refNormal inPlaneOffsetDistance perpendicularOffsetDistance polyLine

Parameters:
    refNormal : UnitVec - A unit vector defining an approximate normal direction for orienting the perpendicular offset and determining inside/outside. Only if the polyline has no corner, like a straight one, it defines the offset plane. Fails if it is within half a degree of perpendicular to the plane of every corner, because then it cannot tell the sides apart.
    inPlaneOffsetDistance : float - The offset distance in the local plane defined by two segments. A positive distance offsets to the inside of the polyline (for counter-clockwise 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.
    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. 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 on U-turns sharper than 175 degrees. Uses the default settings of Polyline3D.offsetByNormalCustom. Use Polyline3D.offsetByNormalCustom to set them.

refNormal : UnitVec

A unit vector defining an approximate normal direction for orienting the perpendicular offset and determining inside/outside. Only if the polyline has no corner, like a straight one, it defines the offset plane. Fails if it is within half a degree of perpendicular to the plane of every corner, because then it cannot tell the sides apart.

inPlaneOffsetDistance : float

The offset distance in the local plane defined by two segments. A positive distance offsets to the inside of the polyline (for counter-clockwise 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.

polyLine : Polyline3D

A 3D Polyline, open or closed.

Returns: Polyline3D

A new 3D polyline.

Polyline3D.offsetByNormalCustom (polyLine, inPlaneOffsetDistance, perpendicularOffsetDistance, refNormal, ?loop, ?considerCollinearBelow, ?failAtUTurnAbove)

Full Usage: Polyline3D.offsetByNormalCustom (polyLine, inPlaneOffsetDistance, perpendicularOffsetDistance, refNormal, ?loop, ?considerCollinearBelow, ?failAtUTurnAbove)

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 counter-clockwise 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. Only if the polyline has no corner, like a straight one, it defines the offset plane. Fails if it is within half a degree of perpendicular to the plane of every corner, because then it cannot tell the sides apart.
    ?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.
    ?considerCollinearBelow : MeasureProduct<cosine, MeasureOne> - Optional, defaults to 2.5 degrees in cosine measure. The cosine of the angle below which segments are considered collinear, unless the polyline turned by more than this angle since the previous corner, so that an arc keeps its corners. A collinear point takes the plane interpolated between the neighboring corners.
    ?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. There is no U-turn behavior like Offset2D.UTurn, on purpose: two almost opposite segments span no reliable plane in 3D, so a chamfer or threshold point has no defined direction. Remove U-turns first, for example with Polyline3D.removeUTurns.

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 on U-turns sharper than failAtUTurnAbove.

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 counter-clockwise 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. Only if the polyline has no corner, like a straight one, it defines the offset plane. Fails if it is within half a degree of perpendicular to the plane of every corner, because then it cannot tell the sides apart.

?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.

?considerCollinearBelow : MeasureProduct<cosine, MeasureOne>

Optional, defaults to 2.5 degrees in cosine measure. The cosine of the angle below which segments are considered collinear, unless the polyline turned by more than this angle since the previous corner, so that an arc keeps its corners. A collinear point takes the plane interpolated between the neighboring corners.

?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. There is no U-turn behavior like Offset2D.UTurn, on purpose: two almost opposite segments span no reliable plane in 3D, so a chamfer or threshold point has no defined direction. Remove U-turns first, for example with Polyline3D.removeUTurns.

Returns: Polyline3D

A new 3D polyline.

Polyline3D.offsetCustom (polyLine, inPlaneOffsetDistance, perpendicularOffsetDistance, ?loop, ?considerCollinearBelow, ?failAtUTurnAbove)

Full Usage: Polyline3D.offsetCustom (polyLine, inPlaneOffsetDistance, perpendicularOffsetDistance, ?loop, ?considerCollinearBelow, ?failAtUTurnAbove)

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 counter-clockwise 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.
    ?considerCollinearBelow : MeasureProduct<cosine, MeasureOne> - Optional, defaults to 2.5 degrees in cosine measure. The cosine of the angle below which segments are considered collinear, unless the polyline turned by more than this angle since the previous corner, so that an arc keeps its corners. A collinear point takes the plane interpolated between the neighboring corners.
    ?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. There is no U-turn behavior like Offset2D.UTurn, on purpose: two almost opposite segments span no reliable plane in 3D, so a chamfer or threshold point has no defined direction. Remove U-turns first, for example with Polyline3D.removeUTurns.

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, on U-turns sharper than failAtUTurnAbove, and if the average normal cannot be computed, for example if all points are collinear.

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 counter-clockwise 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.

?considerCollinearBelow : MeasureProduct<cosine, MeasureOne>

Optional, defaults to 2.5 degrees in cosine measure. The cosine of the angle below which segments are considered collinear, unless the polyline turned by more than this angle since the previous corner, so that an arc keeps its corners. A collinear point takes the plane interpolated between the neighboring corners.

?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. There is no U-turn behavior like Offset2D.UTurn, on purpose: two almost opposite segments span no reliable plane in 3D, so a chamfer or threshold point has no defined direction. Remove U-turns first, for example with Polyline3D.removeUTurns.

Returns: Polyline3D

A new 3D polyline.

Polyline3D.offsetVariable inPlaneOffsetDistances perpendicularOffsetDistances polyLine

Full Usage: Polyline3D.offsetVariable inPlaneOffsetDistances perpendicularOffsetDistances polyLine

Parameters:
    inPlaneOffsetDistances : IList<float> - The offset distances in the local plane defined by two segments. One distance per segment.
    perpendicularOffsetDistances : IList<float> - The offset distances perpendicular to the local plane. One distance per point. For a closed polyline one less, because its last point is its first point.
    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, with one in-plane distance per segment and one perpendicular distance per point. 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, on U-turns sharper than 175 degrees, at collinear points where the two segments have different in-plane distances, and if the average normal cannot be computed, for example if all points are collinear. Uses the default settings of Polyline3D.offsetVariableCustom. Use Polyline3D.offsetVariableCustom to set them.

inPlaneOffsetDistances : IList<float>

The offset distances in the local plane defined by two segments. One distance per segment.

perpendicularOffsetDistances : IList<float>

The offset distances perpendicular to the local plane. One distance per point. For a closed polyline one less, because its last point is its first point.

polyLine : Polyline3D

A 3D Polyline, open or closed.

Returns: Polyline3D

A new 3D polyline.

Polyline3D.offsetVariableByNormal refNormal inPlaneOffsetDistances perpendicularOffsetDistances polyLine

Full Usage: Polyline3D.offsetVariableByNormal refNormal inPlaneOffsetDistances perpendicularOffsetDistances polyLine

Parameters:
    refNormal : UnitVec - A unit vector defining an approximate normal direction for orienting the perpendicular offset and determining inside/outside. Only if the polyline has no corner, like a straight one, it defines the offset plane. Fails if it is within half a degree of perpendicular to the plane of every corner, because then it cannot tell the sides apart.
    inPlaneOffsetDistances : IList<float> - The offset distances in the local plane defined by two segments. One distance per segment.
    perpendicularOffsetDistances : IList<float> - The offset distances perpendicular to the local plane. One distance per point. For a closed polyline one less, because its last point is its first point.
    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, with one in-plane distance per segment and one perpendicular distance per point. 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, on U-turns sharper than 175 degrees, and at collinear points where the two segments have different in-plane distances. Uses the default settings of Polyline3D.offsetVariableByNormalCustom. Use Polyline3D.offsetVariableByNormalCustom to set them.

refNormal : UnitVec

A unit vector defining an approximate normal direction for orienting the perpendicular offset and determining inside/outside. Only if the polyline has no corner, like a straight one, it defines the offset plane. Fails if it is within half a degree of perpendicular to the plane of every corner, because then it cannot tell the sides apart.

inPlaneOffsetDistances : IList<float>

The offset distances in the local plane defined by two segments. One distance per segment.

perpendicularOffsetDistances : IList<float>

The offset distances perpendicular to the local plane. One distance per point. For a closed polyline one less, because its last point is its first point.

polyLine : Polyline3D

A 3D Polyline, open or closed.

Returns: Polyline3D

A new 3D polyline.

Polyline3D.offsetVariableByNormalCustom (polyLine, inPlaneOffsetDistances, perpendicularOffsetDistances, refNormal, ?loop, ?varDistParallelBehavior, ?considerCollinearBelow, ?failAtUTurnAbove)

Full Usage: Polyline3D.offsetVariableByNormalCustom (polyLine, inPlaneOffsetDistances, perpendicularOffsetDistances, refNormal, ?loop, ?varDistParallelBehavior, ?considerCollinearBelow, ?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 counter-clockwise 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 point. For a closed polyline one less, because its last point is its first point. With loop = TRUE one per point of the open polyline. 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. Only if the polyline has no corner, like a straight one, it defines the offset plane. Fails if it is within half a degree of perpendicular to the plane of every corner, because then it cannot tell the sides apart.
    ?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.
    ?varDistParallelBehavior : VarDistParallel - Optional, defaults to Fail. The behavior to use when collinear segments with different offset distances are found.
    ?considerCollinearBelow : MeasureProduct<cosine, MeasureOne> - Optional, defaults to 2.5 degrees in cosine measure. The cosine of the angle below which segments are considered collinear, unless the polyline turned by more than this angle since the previous corner, or for different distances, since the last point that was offset exactly.
    ?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. There is no U-turn behavior like Offset2D.UTurn, on purpose: two almost opposite segments span no reliable plane in 3D, so a chamfer or threshold point has no defined direction. Remove U-turns first, for example with Polyline3D.removeUTurns.

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, on U-turns sharper than failAtUTurnAbove, and at collinear points where the two segments have different in-plane distances, unless varDistParallelBehavior says otherwise.

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 counter-clockwise 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 point. For a closed polyline one less, because its last point is its first point. With loop = TRUE one per point of the open polyline. 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. Only if the polyline has no corner, like a straight one, it defines the offset plane. Fails if it is within half a degree of perpendicular to the plane of every corner, because then it cannot tell the sides apart.

?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.

?varDistParallelBehavior : VarDistParallel

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

?considerCollinearBelow : MeasureProduct<cosine, MeasureOne>

Optional, defaults to 2.5 degrees in cosine measure. The cosine of the angle below which segments are considered collinear, unless the polyline turned by more than this angle since the previous corner, or for different distances, since the last point that was offset exactly.

?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. There is no U-turn behavior like Offset2D.UTurn, on purpose: two almost opposite segments span no reliable plane in 3D, so a chamfer or threshold point has no defined direction. Remove U-turns first, for example with Polyline3D.removeUTurns.

Returns: Polyline3D

A new 3D polyline.

Polyline3D.offsetVariableCustom (polyLine, inPlaneOffsetDistances, perpendicularOffsetDistances, ?loop, ?varDistParallelBehavior, ?considerCollinearBelow, ?failAtUTurnAbove)

Full Usage: Polyline3D.offsetVariableCustom (polyLine, inPlaneOffsetDistances, perpendicularOffsetDistances, ?loop, ?varDistParallelBehavior, ?considerCollinearBelow, ?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. A negative distance offsets to the outside. No matter how the polyline is oriented.
    perpendicularOffsetDistances : IList<float> - The offset distances perpendicular to the local plane. One distance per point. For a closed polyline one less, because its last point is its first point. With loop = TRUE one per point of the open polyline. A positive distance offsets in the direction of the computed normal. For a counter-clockwise 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.
    ?varDistParallelBehavior : VarDistParallel - Optional, defaults to Fail. The behavior to use when collinear segments with different offset distances are found.
    ?considerCollinearBelow : MeasureProduct<cosine, MeasureOne> - Optional, defaults to 2.5 degrees in cosine measure. The cosine of the angle below which segments are considered collinear, unless the polyline turned by more than this angle since the previous corner, or for different distances, since the last point that was offset exactly.
    ?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. There is no U-turn behavior like Offset2D.UTurn, on purpose: two almost opposite segments span no reliable plane in 3D, so a chamfer or threshold point has no defined direction. Remove U-turns first, for example with Polyline3D.removeUTurns.

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, on U-turns sharper than failAtUTurnAbove, at collinear points where the two segments have different in-plane distances unless varDistParallelBehavior says otherwise, and if the average normal cannot be computed, for example if all points are collinear.

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. A negative distance offsets to the outside. No matter how the polyline is oriented.

perpendicularOffsetDistances : IList<float>

The offset distances perpendicular to the local plane. One distance per point. For a closed polyline one less, because its last point is its first point. With loop = TRUE one per point of the open polyline. A positive distance offsets in the direction of the computed normal. For a counter-clockwise 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.

?varDistParallelBehavior : VarDistParallel

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

?considerCollinearBelow : MeasureProduct<cosine, MeasureOne>

Optional, defaults to 2.5 degrees in cosine measure. The cosine of the angle below which segments are considered collinear, unless the polyline turned by more than this angle since the previous corner, or for different distances, since the last point that was offset exactly.

?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. There is no U-turn behavior like Offset2D.UTurn, on purpose: two almost opposite segments span no reliable plane in 3D, so a chamfer or threshold point has no defined direction. Remove U-turns first, for example with Polyline3D.removeUTurns.

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.removeDuplicateAndCollinearPoints angleTolerance distanceTolerance pl

Full Usage: Polyline3D.removeDuplicateAndCollinearPoints angleTolerance distanceTolerance pl

Parameters:
Returns: Polyline3D

Returns a new Polyline3D with consecutive duplicate points and collinear points removed, within given tolerances. The input Polyline3D is not changed. Use p.RemoveDuplicateAndCollinearPoints to remove the points in place. This algorithm allows the last and first point to be identical if the Polyline3D is closed. Collinear 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 collinear segments, the first point is replaced with the last non-collinear point. So the joint of the loop is now moved to the last non-collinear point. So that there are no collinear 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:
    distanceTolerance : float - The distance within which points are considered duplicates.
    pl : Polyline3D - A 3D Polyline, open or closed.

Returns: Polyline3D A new Polyline3D. Use p.RemoveDuplicatePoints to remove the points in place.

Returns a new Polyline3D with consecutive duplicate points removed, within a given tolerance. The input Polyline3D is not changed.

From a cluster of points that are closer than the distanceTolerance, only the first point is kept. Use 'Polyline3D.removeDuplicatePointsFaithfully' if you want to keep the edges in their position by re-intersecting segments. 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

A new Polyline3D. Use p.RemoveDuplicatePoints to remove the points in place.

Polyline3D.removeDuplicatePointsAndReport distanceTolerance pl

Full Usage: Polyline3D.removeDuplicatePointsAndReport distanceTolerance pl

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

Returns: Polyline3D * ResizeArray<Pnt> A tuple of the new Polyline3D and the removed duplicate points, with consecutive identical entries listed once per run. The list of removed points is empty if no duplicates were found. Use p.RemoveDuplicatePointsAndReport to remove the points in place.

Returns a new Polyline3D with consecutive duplicate points removed, within a given tolerance, and the removed points. Same as 'Polyline3D.removeDuplicatePoints', but also reports the points that were removed. The input Polyline3D is not changed.

distanceTolerance : float

The distance within which points are considered duplicates.

pl : Polyline3D

A 3D Polyline, open or closed.

Returns: Polyline3D * ResizeArray<Pnt>

A tuple of the new Polyline3D and the removed duplicate points, with consecutive identical entries listed once per run. The list of removed points is empty if no duplicates were found. Use p.RemoveDuplicatePointsAndReport to remove the points in place.

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 A new Polyline3D. Use p.RemoveDuplicatePointsFaithfully to remove the points in place.

Returns a new Polyline3D with consecutive duplicate points removed, within a given tolerance. The input Polyline3D is not changed.

This algorithm keeps 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

A new Polyline3D. Use p.RemoveDuplicatePointsFaithfully to remove the points in place.

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 A new Polyline3D. Use p.RemoveUTurns to remove the U-turns in place.

Returns a new Polyline3D with simple sharp U-Turns removed. The input Polyline3D is not changed.

For nested U-turns and collinear points in U-turns segments use 'removeUTurnsDeeply'.

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

A new Polyline3D. Use p.RemoveUTurns to remove the U-turns in place.

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 A new Polyline3D. Use p.RemoveUTurnsDeeply to remove the U-turns in place.

Returns a new Polyline3D with all sharp U-Turns removed, recursively until no more U-turns are present. The input Polyline3D is not changed. Use this function when you have nested U-turns and collinear 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

A new Polyline3D. Use p.RemoveUTurnsDeeply to remove the U-turns in place.

Polyline3D.reverse p

Full Usage: Polyline3D.reverse p

Parameters:
Returns: Polyline3D

Returns a new Polyline3D with the order of the points reversed. The input Polyline3D is not changed. Use p.Reverse() to reverse in place.

p : Polyline3D
Returns: Polyline3D

Polyline3D.rotate q pl

Full Usage: Polyline3D.rotate q pl

Parameters:
Returns: Polyline3D
Modifiers: inline

Returns a new Polyline3D rotated by a Quaternion. The input Polyline3D is not changed. The polyline is rotated around the World Origin.

q : Quaternion
pl : Polyline3D
Returns: Polyline3D

Polyline3D.rotateAround cen q pl

Full Usage: Polyline3D.rotateAround cen q pl

Parameters:
    cen : Pnt - The center point of the rotation.
    q : Quaternion - The rotation to apply.
    pl : Polyline3D - The Polyline3D to rotate. It is not changed.

Returns: Polyline3D A new Polyline3D. Use p.RotateAround to rotate in place.

Returns a new Polyline3D rotated by a Quaternion around a given center point.

cen : Pnt

The center point of the rotation.

q : Quaternion

The rotation to apply.

pl : Polyline3D

The Polyline3D to rotate. It is not changed.

Returns: Polyline3D

A new Polyline3D. Use p.RotateAround to rotate in place.

Polyline3D.rotateOnZ r pl

Full Usage: Polyline3D.rotateOnZ r pl

Parameters:
Returns: Polyline3D

Returns a new Polyline3D rotated around the Z-axis. The input Polyline3D is not changed.

r : Rotation2D
pl : Polyline3D
Returns: Polyline3D

Polyline3D.rotateOnZAround cen r pl

Full Usage: Polyline3D.rotateOnZAround cen r pl

Parameters:
Returns: Polyline3D

Returns a new Polyline3D rotated around the local Z-axis through the given center point. The input Polyline3D is not changed.

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

Polyline3D.scale factor pl

Full Usage: Polyline3D.scale factor pl

Parameters:
Returns: Polyline3D

Returns a new Polyline3D scaled by a given factor. The input Polyline3D is not changed. Scale center is World Origin 0,0,0

factor : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.scaleOn cen factor pl

Full Usage: Polyline3D.scaleOn cen factor pl

Parameters:
    cen : Pnt - The center point of the scaling.
    factor : float - The scale factor.
    pl : Polyline3D - The Polyline3D to scale. It is not changed.

Returns: Polyline3D A new Polyline3D. Use p.ScaleOn to scale in place.
Modifiers: inline

Returns a new Polyline3D scaled by a given factor around a given center point.

cen : Pnt

The center point of the scaling.

factor : float

The scale factor.

pl : Polyline3D

The Polyline3D to scale. It is not changed.

Returns: Polyline3D

A new Polyline3D. Use p.ScaleOn to scale in place.

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. This is the point count minus one, but never negative.

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.setPoint pointIndex pnt p

Full Usage: Polyline3D.setPoint pointIndex pnt p

Parameters:
Modifiers: inline

Sets the 3D point at the given pointIndex in the list of points. (this sets XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1], and XYZs.[pointIndex * 3 + 2] in the internal flat list of x, y, and z coordinates )

pointIndex : int
pnt : Pnt
p : Polyline3D

Polyline3D.setPointPreservingClosure pointIndex pnt p

Full Usage: Polyline3D.setPointPreservingClosure pointIndex pnt p

Parameters:
Modifiers: inline

Sets the 3D point at the given pointIndex in the list of points. On a closed Polyline3D, setting the first or last point will set both to the same point. Raises an error if the pointIndex is out of range. (this sets XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1], and XYZs.[pointIndex * 3 + 2] in the internal flat list of x, y, and z coordinates )

pointIndex : int
pnt : Pnt
p : Polyline3D

Polyline3D.setXYZ pointIndex x y z p

Full Usage: Polyline3D.setXYZ pointIndex x y z p

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

Modifiers: inline

Sets the x, y, and z coordinates of the 3D point at the given pointIndex in the list of points. NOTE: setting the first or last point on a closed Polyline3D might open it. (this sets XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1], and XYZs.[pointIndex * 3 + 2] in the internal flat list of x, y, and z coordinates )

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

Polyline3D.setXYZPreservingClosure pointIndex x y z p

Full Usage: Polyline3D.setXYZPreservingClosure pointIndex x y z p

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

Modifiers: inline

Sets the x, y, and z coordinates of the 3D point at the given pointIndex in the list of points. On a closed Polyline3D, setting the first or last point will set both to the same point. Raises an error if the pointIndex is out of range. (this sets XYZs.[pointIndex * 3], XYZs.[pointIndex * 3 + 1], and XYZs.[pointIndex * 3 + 2] in the internal flat list of x, y, and z coordinates )

pointIndex : int
x : float
y : float
z : float
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. If it is positive the Polyline3D is counter-clockwise. Polyline does not need to be exactly closed. The segment from the last point to the first point is included in the area calculation. For self-intersecting Polylines the result is invalid. Raises an error on an empty Polyline3D.

pl : Polyline3D
Returns: float

Polyline3D.start pl

Full Usage: Polyline3D.start pl

Parameters:
Returns: Pnt
Modifiers: inline

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

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

Returns a new Polyline3D transformed by a 4x4 transformation matrix. The input Polyline3D is not changed.

m : Matrix
pl : Polyline3D
Returns: Polyline3D

Polyline3D.transformRigid m pl

Full Usage: Polyline3D.transformRigid m pl

Parameters:
Returns: Polyline3D

Returns a new Polyline3D transformed by a RigidMatrix. The input Polyline3D is not changed.

m : RigidMatrix
pl : Polyline3D
Returns: Polyline3D

Polyline3D.tryAverageNormal pl

Full Usage: Polyline3D.tryAverageNormal pl

Parameters:
Returns: Vec voption
Modifiers: inline

Returns the average normal vector of the Polyline3D, or ValueNone if it is degenerate. It is calculated by summing up the cross products of all segments around the center point, so it is the same vector as Polyline3D.averageNormal, but bad input returns ValueNone instead of raising an exception. The returned vector is not unitized, its length is twice the area of the polygon projected onto that plane. Returns ValueNone if the summed normal is shorter than 1e-6. This happens if: the Polyline3D has less than 3 points, or all points are in one line, or the cross products cancel each other out on a self intersecting shape, or the Polyline3D is very small. For these last two cases Polyline3D.tryAveragePlane still finds a plane.

pl : Polyline3D
Returns: Vec voption

Polyline3D.tryAveragePlane tolerance pl

Full Usage: Polyline3D.tryAveragePlane tolerance pl

Parameters:
Returns: NPlane voption
Modifiers: inline

Tries to find the average plane of the Polyline3D, even if the points are not planar. As opposed to Polyline3D.tryPlane this does not check if all points are on that plane. The origin of the returned NPlane is the average of all points, see Polyline3D.center. The normal is the unitized Polyline3D.averageNormal, so it follows the order of the points. If they are counter-clockwise in the World X-Y plane, then the normal points in World Z direction. On self intersecting shapes, where these cross products cancel each other out, the orientation is arbitrary. The 'tolerance' is the maximum distance for considering all points to be on one point or on one line. Use 1e-6 as a default. Returns ValueNone if the Polyline3D has less than 3 points, or if all points are within the tolerance of one point or of one line, because then there is no unique plane.

tolerance : float
pl : Polyline3D
Returns: NPlane voption

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 voption ValueSome(Pnt) if a point satisfying the condition is found, otherwise ValueNone.
Modifiers: inline

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

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 voption

ValueSome(Pnt) if a point satisfying the condition is found, otherwise ValueNone.

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 voption ValueSome(index of x) the index of the x value in the polyline's flat array if found, otherwise ValueNone.
Modifiers: inline

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

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 voption

ValueSome(index of x) the index of the x value in the polyline's flat array if found, otherwise ValueNone.

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 voption ValueSome(Pnt) if a point satisfying the condition is found, otherwise ValueNone.
Modifiers: inline

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

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 voption

ValueSome(Pnt) if a point satisfying the condition is found, otherwise ValueNone.

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 voption ValueSome(index of x) the index of the x value in the polyline's flat array if found, otherwise ValueNone.
Modifiers: inline

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

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 voption

ValueSome(index of x) the index of the x value in the polyline's flat array if found, otherwise ValueNone.

Polyline3D.tryFindSelfIntersection pl

Full Usage: Polyline3D.tryFindSelfIntersection pl

Parameters:
Returns: (Pnt * int * int) voption ValueSome with a point on the first segment and both segment indices, or ValueNone.

Searches non-adjacent segments in index order for an intersection in O(n²) time. Excludes the closure joint when endpoints are within 1e-7, parallel overlaps (angle below 0.25 degrees), and segments shorter than 1e-6. Uses the XLine3D endpoint parameter tolerance of 1e-6. The closest separation must be less than 1e-6. Use Polyline3D.tryFindSelfIntersectionWithin to set this tolerance.

pl : Polyline3D

The polyline to search.

Returns: (Pnt * int * int) voption

ValueSome with a point on the first segment and both segment indices, or ValueNone.

Polyline3D.tryFindSelfIntersectionWithin maxSkewDistance pl

Full Usage: Polyline3D.tryFindSelfIntersectionWithin maxSkewDistance pl

Parameters:
    maxSkewDistance : float - Finite, nonnegative separation tolerance.
    pl : Polyline3D - The polyline to search.

Returns: (Pnt * int * int) voption ValueSome with a point on the first segment and both segment indices, or ValueNone.

Searches non-adjacent segments in index order for an intersection in O(n²) time. Excludes the closure joint when endpoints are within 1e-7, parallel overlaps (angle below 0.25 degrees), and segments shorter than 1e-6. Uses the XLine3D endpoint parameter tolerance of 1e-6. The closest separation must be strictly less than maxSkewDistance; zero therefore finds no intersections. Use Polyline3D.tryFindSelfIntersection for the default maxSkewDistance of 1e-6.

maxSkewDistance : float

Finite, nonnegative separation tolerance.

pl : Polyline3D

The polyline to search.

Returns: (Pnt * int * int) voption

ValueSome with a point on the first segment and both segment indices, or ValueNone.

Polyline3D.tryPlane tolerance pl

Full Usage: Polyline3D.tryPlane tolerance pl

Parameters:
Returns: NPlane voption
Modifiers: inline

Tries to find the plane that all points of the Polyline3D lie in. The 'tolerance' is the maximum distance any point may have from the plane. Use 1e-6 as a default. The origin of the returned NPlane is the average of all points, see Polyline3D.Center. The orientation of the normal follows the order of the points. If they are counter-clockwise in the World X-Y plane, then the normal points in World Z direction. On self intersecting shapes, where these cross products cancel each other out, the orientation is arbitrary. Returns ValueNone if: the Polyline3D has less than 3 points, or all points are within the tolerance of one point or of one line, so that there is no unique plane, or any point is further away from the plane than the tolerance. Use Polyline3D.tryAveragePlane to get the average plane of non planar points too.

tolerance : float
pl : Polyline3D
Returns: NPlane voption

Polyline3D.xyzs p

Full Usage: Polyline3D.xyzs 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>

Type something to start searching.