Spline3D
Class full path: NemAll_Python_Geometry.Spline3D
Bases: PolyPoints3D
class for 3D spline geometry
Attributes
EndVector: Vector3D
property
writable
Get end vector.
IsPeriodic: bool
property
writable
Check if spline is periodic ( first/last points are equal + start and end tangents are equal)
StartVector: Vector3D
property
writable
Get start vector.
Functions
CalculateEndVector()
Calculates end vector
Returns:
Type | Description |
---|---|
Vector3D
|
End vector |
CalculatePoint
overload
CalculatePoint(param)
Calculates point on spline
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param
|
float
|
parameter of spline. |
required |
Returns:
Type | Description |
---|---|
Point3D
|
Resulting point |
CalculatePoint(param, cpoints)
staticmethod
Calculates point on spline
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param
|
float
|
parameter of spline. |
required |
cpoints
|
Point3DList
|
control points of spline. |
required |
Returns:
Type | Description |
---|---|
Point3D
|
Resulting point |
CalculateStartVector()
Calculates start vector
Returns:
Type | Description |
---|---|
Vector3D
|
Start vector |
CreateClosedSpline(points)
staticmethod
Create closed spline from given points
Parameters:
Name | Type | Description | Default |
---|---|---|---|
points
|
Point3DList
|
Points |
required |
Returns:
Type | Description |
---|---|
Spline3D
|
Spline |
GetControlPoints()
Compute bezier control points
Returns:
Type | Description |
---|---|
GeoErrorCode
|
tuple(error code, |
list[Point3D]
|
vector of control points) |
GetEndVector()
Get end vector.
Returns:
Type | Description |
---|---|
Vector3D
|
end vector. |
GetStartVector()
Get start vector.
Returns:
Type | Description |
---|---|
Vector3D
|
start vector. |
IsClosed()
Check if spline is closed ( first/last points are equal )
Returns:
Type | Description |
---|---|
bool
|
closed spline true/false |
IsCollinear()
Function checks if the 3D spline is collinear - all control points are on same line
Returns:
Type | Description |
---|---|
bool
|
true if collinear |
IsPlanar()
Function checks if the 3D spline is planar, if yes sets the plane
Returns:
Type | Description |
---|---|
bool
|
tuple(true if planar, |
Plane3D
|
the plane the spline is laying on) |
Reverse()
Reverse of current spline
Method reverse Spline using reverse from PolyPoints and swapping tangents.
SetEndVector(vec)
Set end vector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vec
|
Vector3D
|
new end vector. |
required |
SetStartVector(vec)
Set start vector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vec
|
Vector3D
|
new start vector. |
required |
__eq__(spline)
Comparison of splines without tolerance.
Be careful, this method work without tolerance!
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spline
|
Spline3D
|
Compared spline. |
required |
Returns:
Type | Description |
---|---|
object
|
True when splines are equal, otherwise false. |
__iadd__(point)
Addition assignment operator
Parameters:
Name | Type | Description | Default |
---|---|---|---|
point
|
Point3D
|
New Point3D which will be added to the spline |
required |
Returns:
Type | Description |
---|---|
Spline3D
|
Reference to spline |
__init__
overload
__init__()
Initialize
__init__(splinePoints)
constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
splinePoints
|
list
|
|
required |
__init__(spline)
Copy constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spline
|
Spline3D
|
Spline which will be copied. |
required |
__init__(spline, zPlane)
Copy constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
spline
|
Spline2D
|
Spline which will be copied. |
required |
zPlane
|
float
|
Z plane for the spline |
required |
__repr__()
Convert to string