Skip to content

Line3D

Class full path: NemAll_Python_Geometry.Line3D

Representation class for 3D line.

Attributes

EndPoint: Point3D property writable

Get the end point.

Get the end point in world coordinate system.

EndRelPoint: Point3D property writable

Get the end point.

Get the end point in relative coordinate system.

RefPoint: Point3D property writable

Get the point

StartPoint: Point3D property writable

Get the start point.

Get the start point in world coordinate system.

StartRelPoint: Point3D property writable

Get the start point.

Get the start point in relative coordinate system.

Functions

EqualRef(line)

Test if points are equal.

Parameters:

Name Type Description Default
line Line3D

line for comparision

required

Returns:

Type Description
bool

bool

GetCenterPoint()

Get the center point in world coordinate system

Returns:

Type Description
Point3D

Center point

GetCoords()

Get the coordinates.

Get the coordinates in world coordinate system.

Returns:

Type Description
float

X coordinate of start point,

float

Y coordinate of start point,

float

Z coordinate of start point,

float

X coordinate of end point,

float

Y coordinate of end point,

float

Z coordinate of end point)

GetEndPoint()

Get the end point.

Get the end point in world coordinate system.

Returns:

Type Description
Point3D

Point3D.

GetEndRelPoint()

Get the end point.

Get the end point in relative coordinate system.

Returns:

Type Description
Point3D

Point3D.

GetRefPoint()

Get the point

Returns:

Type Description
Point3D

Point3D.

GetStartPoint()

Get the start point.

Get the start point in world coordinate system.

Returns:

Type Description
Point3D

Point3D

GetStartRelPoint()

Get the start point.

Get the start point in relative coordinate system.

Returns:

Type Description
Point3D

Point3D.

GetVector()

Get the vector from start to end point.

Returns:

Type Description
Vector3D

Vector3D.

Is2DLine()

Check, whether the line is a 2D line (both y coordinates are 0.)

Returns:

Type Description
bool

Line is a 2D line: true/false

IsPoint()

Check, whether the line is a point (start point equal end point)

Returns:

Type Description
bool

Line is a point: true/false

Reverse()

Reverse orientation of the Line

Set overload

Set(x1, y1, z1, x2, y2, z2)

Initialize from 6 doubles

Set line points in world coordinate system

Parameters:

Name Type Description Default
x1 float

X coordinate of start point

required
y1 float

Y coordinate of start point

required
z1 float

Z coordinate of start point

required
x2 float

X coordinate of end point

required
y2 float

Y coordinate of end point

required
z2 float

Z coordinate of end point

required
Set(line)

Initialize line from line.

Parameters:

Name Type Description Default
line Line3D

Line3D.

required
Set(startPoint, endPoint)

Initialize from two points.

Set line points in world coordinate system.

Parameters:

Name Type Description Default
startPoint Point3D

start point.

required
endPoint Point3D

end point.

required
Set(refPoint, startPoint, endPoint)

Initialize from 3 points.

Set line points in local coordinate system.

Parameters:

Name Type Description Default
refPoint Point3D

Reference point.

required
startPoint Point3D

relative start point.

required
endPoint Point3D

relative end point.

required

SetEndPoint(endPoint)

Set end point

Set end point in world coordinate system.

Parameters:

Name Type Description Default
endPoint Point3D

End point.

required

SetEndRelPoint(endPoint)

Set end point

Set end point in Local coordinate system.

Parameters:

Name Type Description Default
endPoint Point3D

End point.

required

SetRefPoint(refPoint)

Set the point.

Parameters:

Name Type Description Default
refPoint Point3D

Reference point.

required

SetStartPoint(startPoint)

Set start point

Set start point in world coordinate system.

Parameters:

Name Type Description Default
startPoint Point3D

Start point.

required

SetStartRelPoint(startPoint)

Set start point

Set start point in Local coordinate system.

Parameters:

Name Type Description Default
startPoint Point3D

Start point.

required

TrimEnd(ds)

Trim line at the end

Parameters:

Name Type Description Default
ds float

dimension value the line is modified

  • value >0 shortens the line

  • value <0 extend the line

  • If the line is shorter than the trim value an exception is thrown

required

TrimStart(ds)

Trim line at the start

Parameters:

Name Type Description Default
ds float

dimension value the line is modified

  • value >0 shortens the line

  • value <0 extend the line

  • If the line is shorter than the trim value an exception is thrown

required

__eq__(line)

Comparison of lines without tolerance.

Be careful, this method work without tolerance!

Parameters:

Name Type Description Default
line Line3D

Compared line.

required

Returns:

Type Description
object

True when lines are equal, otherwise false.

__init__ overload

__init__()

initialize

__init__(line2D)

Copy constructor.

Copy Line2D to Line3D at z=0.0

Parameters:

Name Type Description Default
line2D Line2D

Line2D which will be copied.

required
__init__(line)

Copy constructor.

Copy Line3D

Parameters:

Name Type Description Default
line Line3D

Line3D which will be copied.

required
__init__(point1, point2)

Constructor.

Constructs a Line3D from point1 to point2 in world coordinates.

Parameters:

Name Type Description Default
point1 Point3D

start point of line.

required
point2 Point3D

end point of line.

required
__init__(startPoint, vec)

Constructor.

Constructs a Line3D from point1 to point1+vec in world coordinates.

Parameters:

Name Type Description Default
startPoint Point3D

start point of line.

required
vec Vector3D

translation vector.

required
__init__(x1, y1, z1, x2, y2, z2)

Constructor.

Constructs a Line3D from 6 doubles in world coordinates.

Parameters:

Name Type Description Default
x1 float

X coordinate of start point.

required
y1 float

Y coordinate of start point.

required
z1 float

Z coordinate of start point.

required
x2 float

X coordinate of end point.

required
y2 float

Y coordinate of end point.

required
z2 float

Z coordinate of end point.

required
__init__(refPoint, startPoint, endPoint)

Constructor.

Constructs a Line3D in local coordinate system.

Parameters:

Name Type Description Default
refPoint Point3D

Reference point.

required
startPoint Point3D

relative start point.

required
endPoint Point3D

relative end point.

required

__mul__ overload

__mul__(matrix)

2D matrix transformation.

Multiplies line start and end point with matrix.

Parameters:

Name Type Description Default
matrix Matrix2D

2D transformation Matrix

required

Returns:

Type Description
object

Line3D.

__mul__(matrix)

3D matrix transformation.

Multiplies line start and end point with matrix.

Parameters:

Name Type Description Default
matrix Matrix3D

3D transformation Matrix

required

Returns:

Type Description
object

Line3D.

__repr__()

Convert to string