Spline3D
Canonical path: NemAll_Python_Geometry.Spline3D
Bases: PolyPoints3D
class for 3D spline geometry
Methods:
-
CalculateEndVector
–Calculates end vector
-
CalculatePoint
–Overloaded function. See individual overloads.
-
CalculateStartVector
–Calculates start vector
-
Clear
–Remove all points from vector.
-
Count
–Get count of points.
-
CreateClosedSpline
–Create closed spline from given points
-
Empty
–Return true if no points, otherwise false.
-
EqualRef
–Test if reference points are equal.
-
GetControlPoints
–Compute bezier control points
-
GetEndPoint
–Get the end point in world coordinate system.
-
GetEndRelPoint
–Get the end point
-
GetEndVector
–Get end vector.
-
GetLastPoint
–Get the last point in world coordinate system.
-
GetPoint
–Get point in world coordinate system.
-
GetPointIndex
–Get index of the given point
-
GetPointIndexes
–Get indexes of the given point, in case that several points in the spline
-
GetRefPoint
–Get reference point.
-
GetRelPoint
–Get point in Local coordinate system.
-
GetStartPoint
–Get the start point in world coordinate system.
-
GetStartRelPoint
–Get the start point
-
GetStartVector
–Get start vector.
-
Insert
–Overloaded function. See individual overloads.
-
InsertRel
–Insert relative point at specific position. Used local coordinates.
-
IsClosed
–Check if spline is closed ( first/last points are equal )
-
IsCollinear
–Function checks if the 3D spline is collinear - all control points are on same line
-
IsPlanar
–Function checks if the 3D spline is planar, if yes sets the plane
-
Remove
–Remove point from specific position.
-
RemoveLastPoint
–Remove the last point
-
Reserve
–Reserve container capacity
-
Resize
–Specifies a new size for the points vector.
-
Reverse
–Reverse of current spline
-
SetEndPoint
–Set the end point in world coordinates
-
SetEndVector
–Set end vector.
-
SetPoint
–Set point at given position in world coordinate system.
-
SetRefPoint
–Set reference point in world coordinate system.
-
SetRelPoint
–Set point at given position in relative coordinate system.
-
SetStartPoint
–Set the start point in world coordinates
-
SetStartVector
–Set start vector.
-
ToLineChain
–Get polyline as a chain of lines composed from 2 points.
-
__eq__
–Comparison of splines.
-
__getitem__
–Get point at position from index. Used world coordinates.
-
__iadd__
–Addition assignment operator
-
__init__
–Overloaded function. See individual overloads.
-
__mul__
–3D matrix transformation
-
__repr__
–Convert to string
-
__setitem__
–Set a value at position from index.
Attributes:
-
EndPoint
(Point3D
) –Get the end point in world coordinate system.
-
EndRelPoint
(Point3D
) –Get the end point
-
EndVector
(Vector3D
) –Get end vector.
-
IsPeriodic
(bool
) –Check if spline is periodic ( first/last points are equal + start and end tangents are equal)
-
LastPoint
(Point3D
) –Get the last point in world coordinate system.
-
Points
(list[Point3D]
) –Get the points
-
RefPoint
(Point3D
) –Get reference point.
-
StartPoint
(Point3D
) –Get the start point in world coordinate system.
-
StartRelPoint
(Point3D
) –Get the start point
-
StartVector
(Vector3D
) –Get start vector.
IsPeriodic
property
writable
Check if spline is periodic ( first/last points are equal + start and end tangents are equal)
CalculateEndVector
CalculateEndVector() -> Vector3D
CalculatePoint
overloaded
staticmethod
CalculatePoint(param: float) -> Point3D
Calculates point on spline
Parameters:
-
param
(float
) –parameter of spline.
Returns:
-
Point3D
–Resulting point
CalculatePoint(param: float, cpoints: Point3DList) -> Point3D
Calculates point on spline
Parameters:
-
param
(float
) –parameter of spline.
-
cpoints
(Point3DList
) –control points of spline.
Returns:
-
Point3D
–Resulting point
CalculateStartVector
CalculateStartVector() -> Vector3D
CreateClosedSpline
staticmethod
CreateClosedSpline(points: Point3DList) -> Spline3D
Create closed spline from given points
Parameters:
-
points
(Point3DList
) –Points
Returns:
-
Spline3D
–Spline
EqualRef
EqualRef(polyPoints: PolyPoints3D) -> bool
Test if reference points are equal.
Parameters:
-
polyPoints
(PolyPoints3D
) –the PolyPoints.
Returns:
-
bool
–Reference points are equal: true/false
GetControlPoints
GetControlPoints() -> tuple[eGeometryErrorCode, list[Point3D]]
Compute bezier control points
Returns:
-
tuple[eGeometryErrorCode, list[Point3D]]
–tuple(error code, vector of control points)
GetEndPoint
GetEndPoint() -> Point3D
Get the end point in world coordinate system.
Returns:
-
Point3D
–end point in world coordinate system
GetLastPoint
GetLastPoint() -> Point3D
Get the last point in world coordinate system.
Returns:
-
Point3D
–last point in world coordinate system
GetPoint
GetPoint(index: int) -> Point3D
Get point in world coordinate system.
This method is checked and throwing Geometry::Exception when index is out of range.
Parameters:
-
index
(int
) –point index.
Returns:
-
Point3D
–point point in world coordinate system.
GetPointIndex
GetPointIndexes
GetRefPoint
GetRefPoint() -> Point3D
GetRelPoint
GetRelPoint(index: int) -> Point3D
Get point in Local coordinate system.
This method is checked and throwing Geometry::Exception when index is out of range.
Parameters:
-
index
(int
) –point index.
Returns:
-
Point3D
–point the point at position index.
GetStartPoint
GetStartPoint() -> Point3D
Get the start point in world coordinate system.
Returns:
-
Point3D
–start point in world coordinate system
Insert
overloaded
Insert(point: Point3D, position: int = 18446744073709551615) -> bool
Insert a point at specified position.
Parameters:
-
point
(Point3D
) –point which will be inserted.
-
position
(int
, default:18446744073709551615
) –Position where the point has to be inserted.
Returns:
-
bool
–true if insert was successfully.
Insert(polyPoints: PolyPoints3D, position: int = 18446744073709551615) -> bool
Insert vector of points at specific position.
If return false then points weren't inserted.
Parameters:
-
polyPoints
(PolyPoints3D
) –the PolyPoints.
-
position
(int
, default:18446744073709551615
) –position where points will be inserted.
Returns:
-
bool
–bool true if successful.
InsertRel
InsertRel(point: Point3D, position: int = 18446744073709551615) -> bool
Insert relative point at specific position. Used local coordinates.
If return false then points weren't Inserted.
Parameters:
-
point
(Point3D
) –the Point.
-
position
(int
, default:18446744073709551615
) –position where points will be inserted.
Returns:
-
bool
–bool true if successful.
IsClosed
Check if spline is closed ( first/last points are equal )
Returns:
-
bool
–closed spline true/false
IsCollinear
Function checks if the 3D spline is collinear - all control points are on same line
Returns:
-
bool
–true if collinear
IsPlanar
Remove
Remove point from specific position.
If return false then points weren't removed.
Parameters:
-
position
(int
) –position of point which will be removed.
Returns:
-
bool
–Point removed: true/false
RemoveLastPoint
Remove the last point
Returns:
-
bool
–Point removed: true/false
Reserve
Reserve container capacity
Parameters:
-
newCount
(int
) –Expected size of container [count of points]
Resize
Specifies a new size for the points vector.
Parameters:
-
newSize
(int
) –The new size of the points vector.
Reverse
Reverse of current spline
Method reverse Spline using reverse from PolyPoints and swapping tangents.
SetEndPoint
SetEndPoint(endpoint: Point3D)
SetEndVector
SetEndVector(vec: Vector3D)
SetPoint
SetPoint(point: Point3D, index: int)
Set point at given position in world coordinate system.
Parameters:
-
point
(Point3D
) –point in the world coordinate system.
-
index
(int
) –index of point which will be set
SetRefPoint
SetRefPoint(refPoint: Point3D)
Set reference point in world coordinate system.
Parameters:
-
refPoint
(Point3D
) –reference point in the world coordinate system.
SetRelPoint
SetRelPoint(point: Point3D, index: int)
Set point at given position in relative coordinate system.
Parameters:
-
point
(Point3D
) –point in the relative coordinate system.
-
index
(int
) –index of point which will be set
SetStartPoint
SetStartPoint(startpoint: Point3D)
SetStartVector
SetStartVector(vec: Vector3D)
ToLineChain
ToLineChain() -> Point3DList
Get polyline as a chain of lines composed from 2 points.
Returns:
-
Point3DList
–vector of lines composed from 2 points (start and end point of a line)
__eq__
__eq__(spline: Spline3D) -> bool
Comparison of splines.
Be careful, this method work without tolerance!
Parameters:
-
spline
(Spline3D
) –spline to be compared.
Returns:
-
bool
–True when splines are equal, otherwise false.
__getitem__
__getitem__(index: int) -> Point3D
Get point at position from index. Used world coordinates.
This method is checked and throwing Geometry::Exception when index is out of range.
Parameters:
-
index
(int
) –point index.
Returns:
-
Point3D
–copy of point.
__iadd__
__init__
overloaded
Initialize
__init__(splinePoints: list[Point3D])
constructor.
__init__(spline: Spline3D)
__init__(spline: Spline2D, zPlane: float = 0)
Copy constructor.
Parameters:
-
spline
(Spline2D
) –Spline which will be copied.
-
zPlane
(float
, default:0
) –Z plane for the spline