Line3D
Canonical path: NemAll_Python_Geometry.Line3D
Representation class for 3D line.
Methods:
-
EqualRef–Test if points are equal.
-
GetCenterPoint–Get the center point in world coordinate system
-
GetCoords–Get the coordinates.
-
GetEndPoint–Get the end point.
-
GetEndRelPoint–Get the end point.
-
GetRefPoint–Get the point
-
GetStartPoint–Get the start point.
-
GetStartRelPoint–Get the start point.
-
GetVector–Get the vector from start to end point.
-
Is2DLine–Check, whether the line is a 2D line (both y coordinates are 0.)
-
IsPoint–Check, whether the line is a point (start point equal end point)
-
Reverse–Reverse orientation of the Line
-
Set–Overloaded function. See individual overloads.
-
SetEndPoint–Set end point
-
SetEndRelPoint–Set end point
-
SetRefPoint–Set the point.
-
SetStartPoint–Set start point
-
SetStartRelPoint–Set start point
-
TrimEnd–Trim the line at the end
-
TrimStart–Trim the line at the start
-
__eq__–Comparison of lines without tolerance.
-
__init__–Overloaded function. See individual overloads.
-
__mul__–Overloaded function. See individual overloads.
-
__repr__–Convert to string
Attributes:
-
EndPoint(Point3D) –Get the end point.
-
EndRelPoint(Point3D) –Get the end point.
-
RefPoint(Point3D) –Get the point
-
StartPoint(Point3D) –Get the start point.
-
StartRelPoint(Point3D) –Get the start point.
EndPoint
property
writable
EndPoint: Point3D
Get the end point.
Get the end point in world coordinate system.
EndRelPoint
property
writable
EndRelPoint: Point3D
Get the end point.
Get the end point in relative coordinate system.
StartPoint
property
writable
StartPoint: Point3D
Get the start point.
Get the start point in world coordinate system.
StartRelPoint
property
writable
StartRelPoint: Point3D
Get the start point.
Get the start point in relative coordinate system.
EqualRef
EqualRef(line: Line3D) -> bool
GetCenterPoint
GetCenterPoint() -> Point3D
GetCoords
GetCoords() -> tuple[float, float, float, float, float, float]
Get the coordinates.
Get the coordinates in world coordinate system.
Returns:
-
tuple[float, float, float, float, float, float]–tuple(X coordinate of start point, Y coordinate of start point, Z coordinate of start point, X coordinate of end point, Y coordinate of end point, Z coordinate of end point)
GetEndPoint
GetEndPoint() -> Point3D
GetEndRelPoint
GetEndRelPoint() -> Point3D
GetStartPoint
GetStartPoint() -> Point3D
GetStartRelPoint
GetStartRelPoint() -> Point3D
GetVector
GetVector() -> Vector3D
Is2DLine
Check, whether the line is a 2D line (both y coordinates are 0.)
Returns:
-
bool–Line is a 2D line: true/false
IsPoint
Check, whether the line is a point (start point equal end point)
Returns:
-
bool–Line is a point: true/false
Set
overloaded
Initialize from 6 doubles
Set line points in world coordinate system
Parameters:
-
x1(float) –X coordinate of start point
-
y1(float) –Y coordinate of start point
-
z1(float) –Z coordinate of start point
-
x2(float) –X coordinate of end point
-
y2(float) –Y coordinate of end point
-
z2(float) –Z coordinate of end point
Set(line: Line3D)
SetEndPoint
SetEndPoint(endPoint: Point3D)
SetEndRelPoint
SetEndRelPoint(endPoint: Point3D)
SetRefPoint
SetRefPoint(refPoint: Point3D)
SetStartPoint
SetStartPoint(startPoint: Point3D)
Set start point
Set start point in world coordinate system.
Parameters:
-
startPoint(Point3D) –Start point.
SetStartRelPoint
SetStartRelPoint(startPoint: Point3D)
Set start point
Set start point in Local coordinate system.
Parameters:
-
startPoint(Point3D) –Start point.
TrimEnd
Trim the line at the end
Parameters:
-
ds(float) –The length by which the line will be trimmed. Negative value extends the line.
Raises:
-
ValueError–When the ds length is larger than the line's length.
TrimStart
Trim the line at the start
Parameters:
-
ds(float) –The length by which the line will be trimmed. Negative value extends the line.
Raises:
-
ValueError–When the ds length is larger than the line's length.
__eq__
__eq__(line: Line3D) -> object
Comparison of lines without tolerance.
Be careful, this method work without tolerance!
Parameters:
-
line(Line3D) –Compared line.
Returns:
-
object–True when lines are equal, otherwise false.
__init__
overloaded
Initialize
__init__(line2D: Line2D)
Copy constructor.
Copy Line2D to Line3D at z=0.0
Parameters:
-
line2D(Line2D) –Line2D which will be copied.
__init__(line: Line3D)
Constructor.
Constructs a Line3D from 6 doubles in world coordinates.
Parameters:
-
x1(float) –X coordinate of start point.
-
y1(float) –Y coordinate of start point.
-
z1(float) –Z coordinate of start point.
-
x2(float) –X coordinate of end point.
-
y2(float) –Y coordinate of end point.
-
z2(float) –Z coordinate of end point.
__mul__
overloaded
__mul__(matrix: Matrix2D) -> object
2D matrix transformation.
Multiplies line start and end point with matrix.
Parameters:
-
matrix(Matrix2D) –2D transformation Matrix
Returns:
-
object–Line3D.
__mul__(matrix: Matrix3D) -> object
3D matrix transformation.
Multiplies line start and end point with matrix.
Parameters:
-
matrix(Matrix3D) –3D transformation Matrix
Returns:
-
object–Line3D.