Empeld
Empeld plugin documentation.
pluginbase.Helpers.Geometry.Ray Struct Reference

A 3d Ray More...

Public Member Functions

 Ray (Vector3d point, Vector3d direction)
 Initializes a new instance of the pluginbase.Helpers.Geometry.Ray struct. More...
 
Vector3d ProjectPoint (Vector3d center)
 Project a point on the ray at a right angle from the ray to the center More...
 

Static Public Member Functions

static Ray FromSegment (Segment segment)
 Get a ray from a segment without any end More...
 

Public Attributes

Vector3d Point
 The start point of the ray More...
 
Vector3d Direction
 The direction of the ray More...
 

Detailed Description

A 3d Ray

Constructor & Destructor Documentation

◆ Ray()

pluginbase.Helpers.Geometry.Ray.Ray ( Vector3d  point,
Vector3d  direction 
)

Initializes a new instance of the pluginbase.Helpers.Geometry.Ray struct.

Parameters
pointPoint.
directionDirection.
27  {
28  Point = point;
29  Direction = direction;
30  }
Vector3d Point
The start point of the ray
Definition: Ray.cs:14
Vector3d Direction
The direction of the ray
Definition: Ray.cs:19

Member Function Documentation

◆ FromSegment()

static Ray pluginbase.Helpers.Geometry.Ray.FromSegment ( Segment  segment)
static

Get a ray from a segment without any end

Returns
The segment.
Parameters
segmentSegment.
38  {
39  return new Ray(segment.Start, segment.Direction);
40  }
Ray(Vector3d point, Vector3d direction)
Initializes a new instance of the pluginbase.Helpers.Geometry.Ray struct.
Definition: Ray.cs:26

◆ ProjectPoint()

Vector3d pluginbase.Helpers.Geometry.Ray.ProjectPoint ( Vector3d  center)

Project a point on the ray at a right angle from the ray to the center

Returns
The point.
Parameters
centerCenter.
48  {
49  return Vector3d.Dot(this.Direction, center - this.Point) / this.Direction.Length * this.Direction + this.Point;
50  }
Vector3d Point
The start point of the ray
Definition: Ray.cs:14
Vector3d Direction
The direction of the ray
Definition: Ray.cs:19

Member Data Documentation

◆ Direction

Vector3d pluginbase.Helpers.Geometry.Ray.Direction

The direction of the ray

◆ Point

Vector3d pluginbase.Helpers.Geometry.Ray.Point

The start point of the ray


The documentation for this struct was generated from the following file: