Point3D

From SDK
Jump to navigation Jump to search
Back.jpg

This object represents a 3D point (X,Y and Z values). It is used by many other objects and can also be used with other geometry objects such as Vector3D to perform calculations.


Constructor

Point3D()

This construct an uninitialised point with invalid x, y and z values which can be tested for using the .IsInvalid property.

Point3D(double x, double y, double z)

A new point with the specified X, Y and Z values

x(double) the value for the x coordinate of the point
y(double) the value for the y coordinate of the point
z(double) the value for the z coordinate of the point

Point3D( Point3D pt)

A new point with the same X, Y and Z values as the passed point

pt (Point3D) an existing point to copy X, Y and Z values from

Point3D( Point2D pt, double z)

Create a new point with x and y values from passed 2D point and new z value

pt (Point2D)2D point holding x and y values for point
z(double) new z value for point

Properties

.X or .x

Interaction: Read and Write

Returns: (double) x coordinate for point


.Y or .y

Interaction: Read and Write

Returns: (double) y coordinate for point


.Z or .z

Interaction: Read and Write

Returns: (double) z coordinate for point

.IsInvalid

Returns: (bool) true if the point is invalid (not initialized or :SetInvalid called)

Methods

:IsCoincident( Point3D point, double tol)

Returns: (bool) true if passed point is coincident with this point within passed tolerance

point (Point3D)point to check for coincidence
tol(double) maximum distance apart point can be and still be considered coincident

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

Set new x, y and z values for the point

x(double) new x value for point
y(double) new y value for point
z(double) new z value for point

:Set( Point2D pt, double z)

Set new x and y values from passed 2D point and new z value

pt (Point2D) 2D point holding new x and y values for point
z (double) new z value for point

:SetInvalid()

Set the point to invalid state X,Y and Z will be lost

Operations

Matrix2D * Point3D

Multiplying a matrix by a point returns a transformed point. The Z value is unchanged


Point3D - Point3D

Subtracting a point from another point will returns a Vector3D with the difference between the 2 points.


Point3D + Vector3D

Adding a vector to a point will returns a point displaced from original point by adding the vector


Point3D - Vector3D

Subtracting a vector from a point will returns a point displaced from original point by subtracting the vector


Back.jpg

References

Please Note: The base material for the contents found in this WiKi was sourced from Vectric Lua Interface for Gadgets, version 2.05, published September 12, 2018. by Vectric Ltd. Most current document from Vertric can be downloaded at Vertric Developer Information