Line3D
Canonical path: NemAll_Python_Geometry.Line3D
Representation class for 3D line.
Methods:
-
EqualRef
–Check, whether the reference point of another line is equal to the reference point of this line.
-
GetCenterPoint
–Get the center point in world coordinate system
-
GetCoords
–Get individual line coordinates as a tuple
-
GetEndPoint
–Get the end point.
-
GetEndRelPoint
–Get the end point in local coordinate system, which has its origin in the reference point.
-
GetRefPoint
–Get the reference point of the line (origin of the line's local coordinate system)
-
GetStartPoint
–Get the start point.
-
GetStartRelPoint
–Get the start point in local coordinate system, which has its origin in the reference point.
-
GetVector
–Get the vector from start to end point.
-
Is2DLine
–Check, whether the line is locaten in XY plane (both Z coordinates are 0)
-
IsPoint
–Check, whether the line is a point (start point equal end point)
-
Reverse
–Reverse the line
-
Set
–Overloaded function. See individual overloads.
-
SetEndPoint
–Set end point
-
SetEndRelPoint
–Set the end point in local coordinate system, which has its origin in the reference point.
-
SetRefPoint
–Set the reference point of the line (origin of the line's local coordinate system)
-
SetStartPoint
–Set start point
-
SetStartRelPoint
–Set the start point in local coordinate system, which has its origin in the reference point.
-
TrimEnd
–Trim the line at the end
-
TrimStart
–Trim the line at the start
-
__eq__
–Check, whether two lines are equal.
-
__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
) –End point in local coordinate system
-
RefPoint
(Point3D
) –Reference point of the line (origin of the line's local coordinate system)
-
StartPoint
(Point3D
) –Get the start point.
-
StartRelPoint
(Point3D
) –Start point in local coordinate system
-
To2D
(Line2D
) –convert to 2D3
EndPoint
property
writable
EndPoint: Point3D
Get the end point.
Get the end point in world coordinate system.
RefPoint
property
writable
RefPoint: Point3D
Reference point of the line (origin of the line's local coordinate system)
StartPoint
property
writable
StartPoint: Point3D
Get the start point.
Get the start point in world coordinate system.
EqualRef
EqualRef(line: Line3D) -> bool
Check, whether the reference point of another line is equal to the reference point of this line.
Reference point of a line is by default (0,0,0), regardless of the start point of the line.
Parameters:
-
line
(Line3D
) –Line to compare
Returns:
-
bool
–True if the reference points are equal, False otherwise
Examples:
GetCenterPoint
GetCenterPoint() -> Point3D
Get the center point in world coordinate system
Returns:
-
Point3D
–Center point
Examples:
line_3
is a line from (0, 0, 0) to (5, 5, 5). The center point is at:
GetCoords
GetCoords() -> tuple[float, float, float, float, float, float]
Get individual line coordinates as a tuple
Returns:
-
float
–Start point X coordinate
-
float
–Start point Y coordinate
-
float
–Start point Z coordinate
-
float
–End point X coordinate
-
float
–End point Y coordinate
-
float
–End point Z coordinate
GetEndPoint
GetEndPoint() -> Point3D
GetEndRelPoint
GetEndRelPoint() -> Point3D
Get the end point in local coordinate system, which has its origin in the reference point.
Returns:
-
Point3D
–End point in local coordinate system
GetRefPoint
GetRefPoint() -> Point3D
Get the reference point of the line (origin of the line's local coordinate system)
Returns:
-
Point3D
–Reference point
GetStartPoint
GetStartPoint() -> Point3D
GetStartRelPoint
GetStartRelPoint() -> Point3D
Get the start point in local coordinate system, which has its origin in the reference point.
Returns:
-
Point3D
–Point3D.
GetVector
GetVector() -> Vector3D
Get the vector from start to end point.
Returns:
-
Vector3D
–Vector from the start to the end point
Examples:
Is2DLine
IsPoint
Reverse
Set
overloaded
Set the line with new world coordinate values
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)
Set the end point in local coordinate system, which has its origin in the reference point.
Parameters:
-
endPoint
(Point3D
) –End point.
SetRefPoint
SetRefPoint(refPoint: Point3D)
Set the reference point of the line (origin of the line's local coordinate system)
Parameters:
-
refPoint
(Point3D
) –Reference point.
SetStartPoint
SetStartPoint(startPoint: Point3D)
Set start point
Set start point in world coordinate system.
Parameters:
-
startPoint
(Point3D
) –Start point.
SetStartRelPoint
SetStartRelPoint(startPoint: Point3D)
Set the start point in local coordinate system, which has its origin in the reference point.
Parameters:
-
startPoint
(Point3D
) –Start point.
TrimEnd
Trim the line at the end
Parameters:
-
ds
(float
) –The length by which to trim the line. Negative value extends the line.
TrimStart
Trim the line at the start
Parameters:
-
ds
(float
) –The length by which the line will be trimmed. Negative value extends the line.
__eq__
__eq__(line: Line3D) -> bool
Check, whether two lines are equal.
IMPORTANT: This method works withour tolerance. Use Comparison.Equal
to compare with tolerance
and avoid floating point errors.
Parameters:
-
line
(Line3D
) –line to be compared.
Returns:
-
bool
–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.