Header menu logo Euclid

Polyline3D Type

A mutable 3D Polyline. If the last point is the same as the first point, the Polyline3D is closed.

Record fields

Record Field Description

Points

Full Usage: Points

Field type: ResizeArray<Pnt>

Gets the internal list of all Points of the Polyline3D. This is not a copy, so changes to the list will be reflected in the Polyline3D.

Field type: ResizeArray<Pnt>

Instance members

Instance member Description

this.BoundingBox

Full Usage: this.BoundingBox

Returns: BBox
Modifiers: inline

Gets the a bounding box of the Polyline3D

Returns: BBox

this.CloseIfOpen

Full Usage: this.CloseIfOpen

Parameters:
    toleranceForAddingPoint : float

Close the Polyline2D if it is not already closed. If the ends are closer than the tolerance. The last point is set to equal the first point. Else the start point is added to the end of the Polyline2D.

toleranceForAddingPoint : float

this.ClosestParameter

Full Usage: this.ClosestParameter

Parameters:
Returns: float

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

pt : Pnt
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.

pt : Pnt
Returns: Pnt

this.DistanceTo

Full Usage: this.DistanceTo

Parameters:
Returns: float

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

pt : Pnt
Returns: float

this.Duplicate

Full Usage: this.Duplicate

Returns: Polyline3D
Modifiers: inline

Creates a copy of the Polyline3D

Returns: Polyline3D

this.End

Full Usage: this.End

Returns: Pnt
Modifiers: inline

Gets last or end point of the Polyline3D

Returns: Pnt

this.EvaluateAt

Full Usage: this.EvaluateAt

Parameters:
    t : float

Returns: Pnt

Returns the point at a given parameter on the Polyline3D. The integer part of the parameter is the index of the segment that the point is on. The fractional part of the parameter is the parameter form 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.IsAlmostClosed

Full Usage: this.IsAlmostClosed

Parameters:
    tolerance : float

Returns: bool

Tests if Polyline3D is closed within given tolerance.

tolerance : float
Returns: bool

this.IsClosed

Full Usage: this.IsClosed

Returns: bool
Modifiers: inline

Tests if Polyline3D start and end points are exactly the same.

Returns: bool

this.IsCounterClockwiseIn2D

Full Usage: this.IsCounterClockwiseIn2D

Returns: bool

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

Returns: bool

this.Length

Full Usage: this.Length

Returns: float

Gets the length of the Polyline3D

Returns: float

this.PointCount

Full Usage: this.PointCount

Returns: int
Modifiers: inline

Gets the count of points in the Polyline3D

Returns: int

this.Reverse

Full Usage: this.Reverse

Returns: Polyline3D

Returns new Polyline3D in reversed Order.

Returns: Polyline3D

this.ReverseInPlace

Full Usage: this.ReverseInPlace

Reverse order of the Polyline3D in place.

this.Start

Full Usage: this.Start

Returns: Pnt
Modifiers: inline

Gets first point of the Polyline3D

Returns: Pnt

this.TangentAt

Full Usage: this.TangentAt

Parameters:
    t : float

Returns: UnitVec

Returns the Unitized Tangent 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 form 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at points.Count - 1.0 .

t : float
Returns: UnitVec

Static members

Static member Description

Polyline3D.closestParameter pl pt

Full Usage: Polyline3D.closestParameter pl pt

Parameters:
Returns: float
Modifiers: inline

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

pl : Polyline3D
pt : Pnt
Returns: float

Polyline3D.closestPoint pl pt

Full Usage: Polyline3D.closestPoint pl pt

Parameters:
Returns: Pnt
Modifiers: inline

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

pl : Polyline3D
pt : Pnt
Returns: Pnt

Polyline3D.create points

Full Usage: Polyline3D.create points

Parameters:
    points : Pnt seq

Returns: Polyline3D

Create a new Polyline3D by copying over all points.

points : Pnt seq
Returns: Polyline3D

Polyline3D.createDirectlyUnsafe points

Full Usage: Polyline3D.createDirectlyUnsafe points

Parameters:
    points : ResizeArray<Pnt>

Returns: Polyline3D

Create a new Polyline3D by using the provided ResizeArray directly. All later changes to the ResizeArray will be reflected in the Polyline3D.

points : ResizeArray<Pnt>
Returns: Polyline3D

Polyline3D.createEmpty capacity

Full Usage: Polyline3D.createEmpty capacity

Parameters:
    capacity : int

Returns: Polyline3D

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

capacity : int
Returns: Polyline3D

Polyline3D.distanceTo pl pt

Full Usage: Polyline3D.distanceTo pl pt

Parameters:
Returns: float
Modifiers: inline

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

pl : Polyline3D
pt : Pnt
Returns: float

Polyline3D.ende p

Full Usage: Polyline3D.ende p

Parameters:
Returns: Pnt
Modifiers: inline

Gets last or end point of the Polyline3D

p : Polyline3D
Returns: Pnt

Polyline3D.evaluateAt t pl

Full Usage: Polyline3D.evaluateAt t pl

Parameters:
Returns: Pnt
Modifiers: inline

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 form 0.0 to 1.0 on the segment. The domain Polyline3D starts at 0.0 and ends at point count.

t : float
pl : Polyline3D
Returns: Pnt

Polyline3D.findOuterCornerAndRefNormal (pts, vs)

Full Usage: Polyline3D.findOuterCornerAndRefNormal (pts, vs)

Parameters:
    pts : ResizeArray<Pnt>
    vs : Vec[]

Returns: int * Vec

Returns the index of an outer corner and. a normal vector corresponding to an Counter-Clockwise view on the loop. This is used to calculate the RefNormal vector for the offset function. The input vectors are the vectors for each segment of the polyline. From first and second point up to last and first point.

pts : ResizeArray<Pnt>
vs : Vec[]
Returns: int * Vec

Polyline3D.map mapping pl

Full Usage: Polyline3D.map mapping pl

Parameters:
Returns: Polyline3D

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

mapping : Pnt -> Pnt
pl : Polyline3D
Returns: Polyline3D

Polyline3D.move v pl

Full Usage: Polyline3D.move v pl

Parameters:
Returns: Polyline3D
Modifiers: inline

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

v : Vec
pl : Polyline3D
Returns: Polyline3D

Polyline3D.moveX distance pl

Full Usage: Polyline3D.moveX distance pl

Parameters:
Returns: Polyline3D
Modifiers: inline

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

distance : float
pl : Polyline3D
Returns: Polyline3D

Polyline3D.moveY distance pl

Full Usage: Polyline3D.moveY distance pl

Parameters:
Returns: Polyline3D
Modifiers: inline

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

distance : double
pl : Polyline3D
Returns: Polyline3D

Polyline3D.moveZ distance pl

Full Usage: Polyline3D.moveZ distance pl

Parameters:
Returns: Polyline3D
Modifiers: inline

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

distance : double
pl : Polyline3D
Returns: Polyline3D

Polyline3D.offset (polyLine, offsetDistance, ?normalDistance, ?loop, ?refNormal)

Full Usage: Polyline3D.offset (polyLine, offsetDistance, ?normalDistance, ?loop, ?refNormal)

Parameters:
    polyLine : Polyline3D - A 3D Polyline.
    offsetDistance : float - The offset distance for all segments of the polyline. A positive distance offsets inwards in corners, a negative offset outwards.
    ?normalDistance : float - Optional, The normal distance defined as a perpendicular offset for all corners.
    ?loop : bool - Consider last point and first point to be from a closed loop, even if they are not at the same location.
    ?refNormal : Vec - Optional. An approximate orientation Normal to help find the correct offset side, if given it doesn't need to be calculated anymore. This speeds up the algorithm. To be in Z Axis orientation for Counter-Clockwise loops in 2D.

Returns: Polyline3D A list of points that has the same length as the input list.

Offsets a Polyline in 3D space by finding the local offset in each corner. Auto detects if given points are from a closed Polyline (first point = last point) and loops them. Does not fail on colinear or duplicate points.

polyLine : Polyline3D

A 3D Polyline.

offsetDistance : float

The offset distance for all segments of the polyline. A positive distance offsets inwards in corners, a negative offset outwards.

?normalDistance : float

Optional, The normal distance defined as a perpendicular offset for all corners.

?loop : bool

Consider last point and first point to be from a closed loop, even if they are not at the same location.

?refNormal : Vec

Optional. An approximate orientation Normal to help find the correct offset side, if given it doesn't need to be calculated anymore. This speeds up the algorithm. To be in Z Axis orientation for Counter-Clockwise loops in 2D.

Returns: Polyline3D

A list of points that has the same length as the input list.

Polyline3D.offset (polyLine, offsetDistances, ?normalDistances, ?loop, ?refNormal, ?obliqueOffsets)

Full Usage: Polyline3D.offset (polyLine, offsetDistances, ?normalDistances, ?loop, ?refNormal, ?obliqueOffsets)

Parameters:
    polyLine : Polyline3D - A 3D Polyline.
    offsetDistances : float seq - The parallel offset distances for each segment of the polyline. A positive distance offsets inwards in corners, a negative offset outwards. For open and closed polylines this list of distances must have one item less than number of points in the polyline. Except if the polyline is open and the loop parameter is set to true. Then points and distances list shall have the same count. A empty list for no offset or singleton for constant offset is allowed too.
    ?normalDistances : float - Optional. Normal distances defined as a perpendicular offset at each corner. Unlike offsetDistances this list of distances must have the same item count as number of points in the polyline. Except if the input polyline is already closed. Then distances list shall have one less. (independent of 'loop' parameter) A empty list for no normal offset or singleton for constant offset is allowed too.
    ?loop : bool - Optional. Consider last point and first point to be from a closed loop, even if they are not at the same location.
    ?refNormal : Vec - Optional. An approximate orientation Normal to help find the correct offset side, if given it doesn't need to be calculated anymore. This speeds up the algorithm. To be in Z Axis orientation for Counter-Clockwise loops in 2D.
    ?obliqueOffsets : bool - Optional. When two adjacent segments are colinear but have different offset distances there is no solution with a parallel offset. By default an exception is raised. Set this to true to create and averaged oblique offset instead of failing.

Returns: Polyline3D A list of points that has the same length as the input list.

Offsets a Polyline in 3D space by finding the local offset in each corner. Auto detects if given points are from a closed Polyline (first point = last point) and loops them. Does not fail on colinear or duplicate points.

polyLine : Polyline3D

A 3D Polyline.

offsetDistances : float seq

The parallel offset distances for each segment of the polyline. A positive distance offsets inwards in corners, a negative offset outwards. For open and closed polylines this list of distances must have one item less than number of points in the polyline. Except if the polyline is open and the loop parameter is set to true. Then points and distances list shall have the same count. A empty list for no offset or singleton for constant offset is allowed too.

?normalDistances : float

Optional. Normal distances defined as a perpendicular offset at each corner. Unlike offsetDistances this list of distances must have the same item count as number of points in the polyline. Except if the input polyline is already closed. Then distances list shall have one less. (independent of 'loop' parameter) A empty list for no normal offset or singleton for constant offset is allowed too.

?loop : bool

Optional. Consider last point and first point to be from a closed loop, even if they are not at the same location.

?refNormal : Vec

Optional. An approximate orientation Normal to help find the correct offset side, if given it doesn't need to be calculated anymore. This speeds up the algorithm. To be in Z Axis orientation for Counter-Clockwise loops in 2D.

?obliqueOffsets : bool

Optional. When two adjacent segments are colinear but have different offset distances there is no solution with a parallel offset. By default an exception is raised. Set this to true to create and averaged oblique offset instead of failing.

Returns: Polyline3D

A list of points that has the same length as the input list.

Polyline3D.offsetCore (pts, offD, normD, referenceNormal, fixColinearLooped, allowObliqueOffsetOnColinearSegments)

Full Usage: Polyline3D.offsetCore (pts, offD, normD, referenceNormal, fixColinearLooped, allowObliqueOffsetOnColinearSegments)

Parameters:
    pts : ResizeArray<Pnt>
    offD : IList<float>
    normD : ResizeArray<float>
    referenceNormal : Vec
    fixColinearLooped : bool
    allowObliqueOffsetOnColinearSegments : bool

Returns: ResizeArray<Pnt>

The inner core routine of Points.offset. This function considers input a closed polyline. Start point and end point may not be equal, all arrays must be of the same length. 'referenceNormal' to be in Z Axis for Counter-Clockwise loops in 2D or if it is Vec.Zero it wil be calculated add hoc.

pts : ResizeArray<Pnt>
offD : IList<float>
normD : ResizeArray<float>
referenceNormal : Vec
fixColinearLooped : bool
allowObliqueOffsetOnColinearSegments : bool
Returns: ResizeArray<Pnt>

Polyline3D.pointsUnsafeInternal p

Full Usage: Polyline3D.pointsUnsafeInternal p

Parameters:
Returns: ResizeArray<Pnt>
Modifiers: inline

Gets the internal list of all Points of the Polyline3D. This is not a copy, so changes to the list will be reflected in the Polyline3D.

p : Polyline3D
Returns: ResizeArray<Pnt>

Polyline3D.reverse p

Full Usage: Polyline3D.reverse p

Parameters:
Returns: Polyline3D
Modifiers: inline

Returns new Polyline3D in reversed Order.

p : Polyline3D
Returns: Polyline3D

Polyline3D.reverseInPlace p

Full Usage: Polyline3D.reverseInPlace p

Parameters:
Modifiers: inline

Reverse order of the Polyline3D in place.

p : Polyline3D

Polyline3D.rotate r pl

Full Usage: Polyline3D.rotate r pl

Parameters:
Returns: Polyline3D
Modifiers: inline

Rotation a Polyline3D around Z-Axis.

r : Rotation2D
pl : Polyline3D
Returns: Polyline3D

Polyline3D.rotateWithCenter cen r pl

Full Usage: Polyline3D.rotateWithCenter cen r pl

Parameters:
Returns: Polyline3D
Modifiers: inline

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

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

Polyline3D.segment a b pl

Full Usage: Polyline3D.segment a b pl

Parameters:
Returns: Polyline3D

Returns new Polyline3D from point at Parameter a to point at Parameter b. if 'a' is bigger 'b' then the new Polyline3D is in opposite direction. If a parameter is within 1e-4 of an integer value, the integer value is used as parameter.

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

Polyline3D.start p

Full Usage: Polyline3D.start p

Parameters:
Returns: Pnt
Modifiers: inline

Gets first point of the Polyline3D

p : Polyline3D
Returns: Pnt

Polyline3D.transform m pl

Full Usage: Polyline3D.transform m pl

Parameters:
Returns: Polyline3D
Modifiers: inline

Applies a 4x4 transformation matrix.

m : Matrix
pl : Polyline3D
Returns: Polyline3D

Polyline3D.translate v pl

Full Usage: Polyline3D.translate v pl

Parameters:
Returns: Polyline3D
Modifiers: inline

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

v : Vec
pl : Polyline3D
Returns: Polyline3D

Type something to start searching.