Point2D
Canonical path: NemAll_Python_Geometry.Point2D
Representation class for 2D point
Methods:
-
GetCoords–Get copy of X,Y coordinates.
-
GetDistance–Get distance.
-
IsZero–Check the coords [0.0,0.0].
-
Set–Overloaded function. See individual overloads.
-
SetX–Set the coordinate.
-
SetY–Set the coordinate.
-
Values–Get copy of X,Y 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__–Matrix transformation.
-
__ne__–Comparison of points without tolerance.
-
__repr__–Convert to string
-
__sub__–Overloaded function. See individual overloads.
-
__truediv__–Divide operator.
Attributes:
GetCoords
GetCoords() -> tuple[float, float]
Get copy of X,Y coordinates.
Returns:
-
tuple[float, float]–tuple(X coordinate of point, Y coordinate of point)
GetDistance
GetDistance(point: Point2D) -> float
Get distance.
Formula: Result(double) = |A-B|.
Parameters:
-
point(Point2D) –Point2D.
Returns:
-
float–double.
IsZero
Check the coords [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: Point2D)
Initialize from x,y coordinates.
Parameters:
-
x(float) –coordinate.
-
y(float) –coordinate.
Values
Get copy of X,Y coordinates as python list.
Returns:
-
list[float]–X coordinate of point.,
-
list[float]–Y 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 Vector2D operand.
Parameters:
-
point(Point2D) –Point.
Returns:
-
Point2D–Point.
__eq__
__eq__(point: Point2D) -> bool
Comparison of points without tolerance.
Be careful, this method work without tolerance!
Parameters:
-
point(Point2D) –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 Vector2D operand.
Parameters:
-
point(Point2D) –Point.
Returns:
-
Point2D–Point.
__idiv__
__idiv__(divider: float) -> Point2D
Divide operator.
Formula
Point(this).X = Point(this).X / divider Point(this).Y = Point(this).Y / divider
This method is checked and throwing Geometry::Exception when divider is zero.
Parameters:
-
divider(float) –Divider.
Returns:
-
Point2D–Point.
__init__
overloaded
Initialize
__init__(point: Point2D)
__init__(point: Point3D)
Explicit copy constructor.
Copy only X_COORD and Y_COORD from point
Parameters:
-
point(Point3D) –3D Point which will be copied to the 2D point.
Constructor.
Initialize point from single coordinates in world coordinate system.
Parameters:
-
x(float) –X coordinate of point.
-
y(float) –Y 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 Vector2D operand.
Parameters:
-
point(Point2D) –Point.
Returns:
-
Point2D–Point.
__mul__
__ne__
__ne__(point: Point2D) -> bool
Comparison of points without tolerance.
Be careful, this method works without tolerance!
Parameters:
-
point(Point2D) –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 Vector2D operand.
Parameters:
-
point(Point2D) –Point.
Returns:
-
Point2D–Point.