Skip to content

Point3D

Canonical path: NemAll_Python_Geometry.Point3D

Representation class for 3D point

Methods:

  • GetCoords

    Get copy of X,Y,Z coordinates

  • GetDistance

    Get distance

  • IsZero

    Check the coords [0.0, 0.0, 0.0]

  • Set

    dummy, is only needed for the creation of the documentation by MkDocs

  • Values

    Get copy of X,Y,Z coordinates as python list

  • __add__

    dummy, is only needed for the creation of the documentation by MkDocs

  • __eq__

    Comparison of points without tolerance.

  • __iadd__

    Point translation by point

  • __idiv__

    Divide operator.

  • __init__

    dummy, is only needed for the creation of the documentation by MkDocs

  • __isub__

    Point translation by negative point

  • __mul__

    dummy, is only needed for the creation of the documentation by MkDocs

  • __ne__

    Comparison of points without tolerance.

  • __repr__

    Convert to string

  • __sub__

    dummy, is only needed for the creation of the documentation by MkDocs

  • __truediv__

    Divide operator.

Attributes:

  • To2D (Point2D) –

    convert to 2D3

  • X (float) –

    Get the x coordinate

  • Y (float) –

    Get the y coordinate

  • Z (float) –

    Get the z coordinate

To2D property writable

To2D: Point2D

convert to 2D3

X property writable

X: float

Get the x coordinate

Y property writable

Y: float

Get the y coordinate

Z property writable

Z: float

Get the z coordinate

GetCoords

GetCoords() -> tuple[float, float, float]

Get copy of X,Y,Z coordinates

Returns:

  • tuple[float, float, float]

    tuple(X coordinate of point, Y coordinate of point, Z coordinate of point)

GetDistance

GetDistance(point: Point3D) -> float

Get distance

Formula: Result(double) = |A-B|.

Parameters:

Returns:

  • float

    double.

IsZero

IsZero() -> bool

Check the coords [0.0, 0.0, 0.0]

If the coords are zero, the return value is true. If the coords aren't zero, the return value is false.

Returns:

  • bool

    bool.

Set overloaded

Set(point: Point3D)

Initialize from point 3D.

Parameters:

Set(x: float, y: float, z: float)

Initialize from x,y,z coordinates.

Parameters:

  • x (float) –

    coordinate.

  • y (float) –

    coordinate.

  • z (float) –

    coordinate.

Values

Values() -> list[float]

Get copy of X,Y,Z coordinates as python list

Returns:

  • list[float]

    X coordinate of point,

  • list[float]

    Y coordinate of point,

  • list[float]

    Z coordinate of point

__add__ overloaded

__add__(vec: Vector3D) -> Point3D

Move the point by vector 3D

Parameters:

Returns:

__add__(vec: Vector2D) -> Point3D

Move the point by vector 2D. Z axis will be ignored

Parameters:

Returns:

__add__(point: Point3D) -> Point3D

Point translation by point

Formula: Point(new) = Point(this) + Point

This is not standard math operation and is implemented only as practical use case for point moving in %Allplan. In this case given operand point represent offset from Zero point. For standard move operation please use Service::Move method with Vector3D operand.

Parameters:

Returns:

__eq__

__eq__(point: Point3D) -> bool

Comparison of points without tolerance.

Be careful, this method work without tolerance!

Parameters:

  • point (Point3D) –

    Compared point.

Returns:

  • bool

    True when points are equal, otherwise false.

__iadd__

__iadd__(point: Point3D) -> Point3D

Point translation by point

Formula: Point(this) = Point(this) + Point

This is not standard math operation and is implemented only as practical use case for point moving in %Allplan. In this case given operand point represent offset from Zero point. For standard move operation please use Service::Move method with Vector3D operand.

Parameters:

Returns:

__idiv__

__idiv__(divider: float) -> Point3D

Divide operator.

Formula

Point(this).X = Point(this).X / divider Point(this).Y = Point(this).Y / divider Point(this).Z = Point(this).Z / divider

This method is checked and throwing Geometry::Exception when divider is zero.

Parameters:

  • divider (float) –

    Divider.

Returns:

__init__ overloaded

__init__()

Initialize

__init__(point: Point3D)

Copy constructor.

Parameters:

  • point (Point3D) –

    Point which will be copied.

__init__(point: Point2D)

Explicit copy constructor.

Copy only X_COORD and Y_COORD from point, Z_COORD is set to zero.

Parameters:

  • point (Point2D) –

    2D Point which will be copied to the 3D point.

__init__(refPoint: Point3D, point: Point3D)

Constructor.

Initialize point from point in local coordinate system. Formula: Result = refPoint + point

Parameters:

  • refPoint (Point3D) –

    Reference point.

  • point (Point3D) –

    Relative point

__init__(x: float, y: float, z: float)

Constructor

Initialize point from single coordinates in world coordinate system.

Parameters:

  • x (float) –

    X coordinate of point

  • y (float) –

    Y coordinate of point

  • z (float) –

    Z coordinate of point

__isub__

__isub__(point: Point3D) -> Point3D

Point translation by negative point

Formula: Point(this) = Point(this) - Point

This is not standard math operation and is implemented only as practical use case for point moving in %Allplan. In this case given operand point represent offset from Zero point. For standard move operation please use Service::Move method with Vector3D operand.

Parameters:

Returns:

__mul__ overloaded

__mul__(matrix: Matrix2D) -> Point3D

2D matrix transformation.

Result = Point * matrix

Parameters:

  • matrix (Matrix2D) –

    2D transformation Matrix

Returns:

__mul__(matrix: Matrix3D) -> Point3D

3D matrix transformation.

Result = Point * matrix

Parameters:

  • matrix (Matrix3D) –

    3D transformation Matrix

Returns:

__mul__(scale: float) -> Point3D

Scale point with constant

Result = Point * scale

Parameters:

  • scale (float) –
    • scale factor

Returns:

__ne__

__ne__(point: Point3D) -> bool

Comparison of points without tolerance.

Be careful, this method work without tolerance!

Parameters:

  • point (Point3D) –

    Compared point.

Returns:

  • bool

    True when points are not equal, otherwise false.

__repr__

__repr__() -> str

Convert to string

__sub__ overloaded

__sub__(vec: Vector3D) -> Point3D

Move the point by reversed vector 3D

Parameters:

Returns:

__sub__(vec: Vector2D) -> Point3D

Move the point by reversed vector 2D. Z coordinate stays unchanged.

Parameters:

Returns:

__sub__(point: Point3D) -> Point3D

Point translation by negative point

Formula: Point(new) = Point(this) - Point

This is not standard math operation and is implemented only as practical use case for point moving in %Allplan. In this case given operand point represent offset from Zero point. For standard move operation please use Service::Move method with Vector3D operand.

Parameters:

Returns:

__truediv__

__truediv__(divider: float) -> Point3D

Divide operator.

Formula

Point(new).X = Point(this).X / divider Point(new).Y = Point(this).Y / divider Point(new).Z = Point(this).Z / divider

Parameters:

  • divider (float) –

    Divider.

Returns: