Skip to content

Line3D

Canonical path: NemAll_Python_Geometry.Line3D

Representation class for 3D line.

Methods:

Attributes:

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.

RefPoint property writable

RefPoint: Point3D

Get the point

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

Test if points are equal.

Parameters:

  • line (Line3D) –

    line for comparision

Returns:

  • bool

    bool

GetCenterPoint

GetCenterPoint() -> Point3D

Get the center point in world coordinate system

Returns:

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

Get the end point.

Get the end point in world coordinate system.

Returns:

GetEndRelPoint

GetEndRelPoint() -> Point3D

Get the end point.

Get the end point in relative coordinate system.

Returns:

GetRefPoint

GetRefPoint() -> Point3D

Get the point

Returns:

GetStartPoint

GetStartPoint() -> Point3D

Get the start point.

Get the start point in world coordinate system.

Returns:

GetStartRelPoint

GetStartRelPoint() -> Point3D

Get the start point.

Get the start point in relative coordinate system.

Returns:

GetVector

GetVector() -> Vector3D

Get the vector from start to end point.

Returns:

Is2DLine

Is2DLine() -> bool

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

Returns:

  • bool

    Line is a 2D line: true/false

IsPoint

IsPoint() -> bool

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

Returns:

  • bool

    Line is a point: true/false

Reverse

Reverse()

Reverse orientation of the Line

Set overloaded

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

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)

Initialize line from line.

Parameters:

Set(startPoint: Point3D, endPoint: Point3D)

Initialize from two points.

Set line points in world coordinate system.

Parameters:

  • startPoint (Point3D) –

    start point.

  • endPoint (Point3D) –

    end point.

Set(refPoint: Point3D, startPoint: Point3D, endPoint: Point3D)

Initialize from 3 points.

Set line points in local coordinate system.

Parameters:

  • refPoint (Point3D) –

    Reference point.

  • startPoint (Point3D) –

    relative start point.

  • endPoint (Point3D) –

    relative end point.

SetEndPoint

SetEndPoint(endPoint: Point3D)

Set end point

Set end point in world coordinate system.

Parameters:

  • endPoint (Point3D) –

    End point.

SetEndRelPoint

SetEndRelPoint(endPoint: Point3D)

Set end point

Set end point in Local coordinate system.

Parameters:

  • endPoint (Point3D) –

    End point.

SetRefPoint

SetRefPoint(refPoint: Point3D)

Set the point.

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 start point

Set start point in Local coordinate system.

Parameters:

  • startPoint (Point3D) –

    Start point.

TrimEnd

TrimEnd(ds: float)

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

TrimStart(ds: float)

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

__init__()

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)

Copy constructor.

Copy Line3D

Parameters:

  • line (Line3D) –

    Line3D which will be copied.

__init__(point1: Point3D, point2: Point3D)

Constructor.

Constructs a Line3D from point1 to point2 in world coordinates.

Parameters:

  • point1 (Point3D) –

    start point of line.

  • point2 (Point3D) –

    end point of line.

__init__(startPoint: Point3D, vec: Vector3D)

Constructor.

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

Parameters:

  • startPoint (Point3D) –

    start point of line.

  • vec (Vector3D) –

    translation vector.

__init__(x1: float, y1: float, z1: float, x2: float, y2: float, z2: float)

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.

__init__(refPoint: Point3D, startPoint: Point3D, endPoint: Point3D)

Constructor.

Constructs a Line3D in local coordinate system.

Parameters:

  • refPoint (Point3D) –

    Reference point.

  • startPoint (Point3D) –

    relative start point.

  • endPoint (Point3D) –

    relative 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.

__repr__

__repr__() -> str

Convert to string