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–Overloaded function. See individual overloads.
-
Values–Get copy of X,Y,Z coordinates as python list
-
__add__–Overloaded function. See individual overloads.
-
__eq__–Comparison of points without tolerance.
-
__iadd__–Point translation by point
-
__idiv__–Divide operator.
-
__init__–Overloaded function. See individual overloads.
-
__isub__–Point translation by negative point
-
__mul__–Overloaded function. See individual overloads.
-
__ne__–Comparison of points without tolerance.
-
__repr__–Convert to string
-
__sub__–Overloaded function. See individual overloads.
-
__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
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:
-
point(Point3D) –Point3D.
Returns:
-
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:
-
bool–bool.
Set
overloaded
Set(point: Point3D)
Initialize from x,y,z coordinates.
Parameters:
-
x(float) –coordinate.
-
y(float) –coordinate.
-
z(float) –coordinate.
Values
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
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:
-
point(Point3D) –Point.
Returns:
-
Point3D–Point.
__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__
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:
-
point(Point3D) –Point.
Returns:
-
Point3D–Point.
__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:
-
Point3D–Point.
__init__
overloaded
Initialize
__init__(point: Point3D)
__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.
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__
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:
-
point(Point3D) –Point.
Returns:
-
Point3D–Point.
__mul__
overloaded
__mul__(scale: float) -> Point3D
Scale point with constant
Result = Point * scale
Parameters:
-
scale(float) –- scale factor
Returns:
-
Point3D–scaled Point
__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.
__sub__
overloaded
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:
-
point(Point3D) –Point3D.
Returns:
-
Point3D–Point.