Skip to content

Point3D

Class full path: NemAll_Python_Geometry.Point3D

Representation class for 3D point

Attributes

X: float property writable

Get the x coordinate

Y: float property writable

Get the y coordinate

Z: float property writable

Get the z coordinate

Functions

GetCoords()

Get copy of X,Y,Z coordinates

Returns:

Type Description
float

tuple(X coordinate of point,

float

Y coordinate of point,

float

Z coordinate of point)

GetDistance(point)

Get distance

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

Parameters:

Name Type Description Default
point Point3D

Point3D.

required

Returns:

Type Description
float

double.

IsZero()

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:

Type Description
bool

bool.

Set overload

Set(point)

Initialize from point 3D.

Parameters:

Name Type Description Default
point Point3D

Point.

required
Set(x, y, z)

Initialize from x,y,z coordinates.

Parameters:

Name Type Description Default
x float

coordinate.

required
y float

coordinate.

required
z float

coordinate.

required

Values()

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

Returns:

Type Description
list[float]

X coordinate of point,

list[float]

Y coordinate of point,

list[float]

Z coordinate of point

__add__ overload

__add__(vec)

Move the point by vector 3D

Parameters:

Name Type Description Default
vec Vector3D

Vector

required

Returns:

Type Description
Point3D

New point

__add__(vec)

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

Parameters:

Name Type Description Default
vec Vector2D

Vector

required

Returns:

Type Description
Point3D

New point

__add__(point)

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:

Name Type Description Default
point Point3D

Point.

required

Returns:

Type Description
Point3D

Point.

__eq__(point)

Comparison of points without tolerance.

Be careful, this method work without tolerance!

Parameters:

Name Type Description Default
point Point3D

Compared point.

required

Returns:

Type Description
bool

True when points are equal, otherwise false.

__iadd__(point)

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:

Name Type Description Default
point Point3D

Point.

required

Returns:

Type Description
Point3D

Point.

__idiv__(divider)

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:

Name Type Description Default
divider float

Divider.

required

Returns:

Type Description
Point3D

Point.

__init__ overload

__init__()

Initialize

__init__(point)

Copy constructor.

Parameters:

Name Type Description Default
point Point3D

Point which will be copied.

required
__init__(point)

Explicit copy constructor.

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

Parameters:

Name Type Description Default
point Point2D

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

required
__init__(refPoint, point)

Constructor.

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

Parameters:

Name Type Description Default
refPoint Point3D

Reference point.

required
point Point3D

Relative point

required
__init__(x, y, z)

Constructor

Initialize point from single coordinates in world coordinate system.

Parameters:

Name Type Description Default
x float

X coordinate of point

required
y float

Y coordinate of point

required
z float

Z coordinate of point

required

__isub__(point)

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:

Name Type Description Default
point Point3D

Point.

required

Returns:

Type Description
Point3D

Point.

__mul__ overload

__mul__(matrix)

2D matrix transformation.

Result = Point * matrix

Parameters:

Name Type Description Default
matrix Matrix2D

2D transformation Matrix

required

Returns:

Type Description
Point3D

Point.

__mul__(matrix)

3D matrix transformation.

Result = Point * matrix

Parameters:

Name Type Description Default
matrix Matrix3D

3D transformation Matrix

required

Returns:

Type Description
Point3D

Point.

__mul__(scale)

Scale point with constant

Result = Point * scale

Parameters:

Name Type Description Default
scale float
  • scale factor
required

Returns:

Type Description
Point3D

scaled Point

__ne__(point)

Comparison of points without tolerance.

Be careful, this method work without tolerance!

Parameters:

Name Type Description Default
point Point3D

Compared point.

required

Returns:

Type Description
bool

True when points are not equal, otherwise false.

__repr__()

Convert to string

__sub__ overload

__sub__(vec)

Move the point by reversed vector 3D

Parameters:

Name Type Description Default
vec Vector3D

3D vector

required

Returns:

Type Description
Point3D

New point

__sub__(vec)

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

Parameters:

Name Type Description Default
vec Vector2D

2D vector

required

Returns:

Type Description
Point3D

New point

__sub__(point)

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:

Name Type Description Default
point Point3D

Point3D.

required

Returns:

Type Description
Point3D

Point.

__truediv__(divider)

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:

Name Type Description Default
divider float

Divider.

required

Returns:

Type Description
Point3D

Point.