Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ XR Studio

Geometry module

  • Last UpdatedJun 29, 2026
  • 3 minute read

The Geometry module provides a set of static, utility methods for common geometric computations in 3D space. It includes point and line projection onto planes, line–line intersection, perpendicular computation, and quaternion generation from direction vectors.

This module is a dependency for the Measure module to properly calculate diameter measures.

The module is defined in the Geometry namespace and all methods are exposed as public static members of the Geometry::Stubs class, so they can be called directly from any script without instantiation.

Including the module

To include the Geometry module in your project, add the following line to your project.

<Module name="gemoerty_module" version="1.0.0" moduleType="GeometryModule" />

The module needs to be included only once. It will not trigger errors if instantiated multiple times.

Public interface

The public interface for the Geometry module.

Method

Signature

Description

ProjectLineToPlane

List<vector3> ProjectLineToPlane(vector3 planePoint, vector3 planeNormal, vector3 linePoint, vector3 lineDirection)

Projects a line onto a plane. Returns a List<vector3> with two elements: the projected line point (index 0) and the projected line direction (index 1).

Input arguments are:

  • planePoint—a point lying on the target plane.

  • planeNormal—the normal vector of the target plane.

  • linePoint—the origin point of the line to project.

  • lineDirection—the direction vector of the line to project.

ProjectPointToPlane

vector3 ProjectPointToPlane(vector3 planePoint, vector3 planeNormal, vector3 point)

Projects a single point onto a plane and returns the projected vector3 position.

Input arguments are:

  • planePoint—a point lying on the target plane.

  • planeNormal—the normal vector of the target plane.

  • point—the 3D point to project onto the plane.

ProjectVectorToPlane

vector3 ProjectVectorToPlane(vector3 planeNormal, vector3 vector)

Projects a direction vector onto a plane and returns the resulting vector3. If the input vector is parallel to the plane normal, the result is Vector3.Zero; the caller is responsible for checking this case.

Input arguments are:

  • planeNormal—the normal vector of the target plane.

  • vector—the direction vector to project.

GetPerpAtDistance

bool GetPerpAtDistance(vector3 linePoint, vector3 lineDirection, double distance, vector3 planeDirection, List<vector3> result)

Computes a perpendicular line at a given distance along an input line, within a reference plane. Returns true on success and populates result with two elements: the perpendicular origin point (index 0) and the perpendicular direction (index 1). Returns false if the perpendicular direction cannot be computed (for example, when the line direction and plane direction are nearly parallel).

Input arguments are:

  • linePoint—the origin point of the reference line.

  • lineDirection—the direction vector of the reference line.

  • distance—the signed distance along the line at which to place the perpendicular.

  • planeDirection—a direction vector defining the reference plane (used together with the line direction to derive the perpendicular via cross product).

  • result—a List<vector3> that will be cleared and filled with the perpendicular point and direction.

QuatFromVectors

quaternion QuatFromVectors(vector3 startVector, vector3 endVector)

Computes the rotation quaternion that transforms startVector into endVector. Both input vectors are assumed to be normalized. The returned quaternion represents the shortest-arc rotation between the two directions.

Input arguments are:

  • startVector—the initial normalized direction vector.

  • endVector—the target normalized direction vector.

IntersectLinesInPlane

bool IntersectLinesInPlane(vector3 pA, vector3 dA, vector3 pB, vector3 dB, List<double> outResult)

Computes the intersection of two lines that are assumed to lie in the same plane. Returns true if an intersection exists and populates outResult with three double values representing the X, Y, and Z components of the intersection point. Returns false if the lines are parallel (cross product of directions is zero).

Input arguments are:

  • pA—a point on the first line.

  • dA—the direction vector of the first line.

  • pB—a point on the second line.

  • dB—the direction vector of the second line.

  • outResult—a List<double> that will be cleared and filled with the three intersection coordinates.

Use example

// Project a line onto the XZ plane (Y = 0)

vector3 planePoint = {0, 0, 0};

vector3 planeNormal = {0, 1, 0};

vector3 linePoint = {1, 5, 0};

vector3 lineDirection = {0, 0, 1};

List<vector3> projected = Geometry::Stubs.ProjectLineToPlane(planePoint, planeNormal, linePoint, lineDirection);

// projected[0] is the projected point, projected[1] is the projected direction

// Find intersection of two lines in a plane

vector3 pA = {0, 0, 0};

vector3 dA = {1, 0, 0};

vector3 pB = {0, 0, 1};

vector3 dB = {0, 0, 1};

List<double> intersection = {0, 0, 0};

bool found = Geometry::Stubs.IntersectLinesInPlane(pA, dA, pB, dB, intersection);

if (found)

{

vector3 point = {intersection[0], intersection[1], intersection[2]};

Runtime::Environment.Print("Intersection at: " + point);

}

In This Topic
Related Links