User Tools

Site Tools


DzLine3

A three dimensional line segment.

More...

Inherits :

Properties

DAZ Script
DzVec3end
DzVec3origin

Constructors

DAZ Script
DzLine3 ()
DzLine3 ( String line )
DzLine3 ( DzLine3 line )
DzLine3 ( DzVec3 origin, DzVec3 end )

Methods

DAZ Script
DzVec3getDirection ()
DzVec3getPoint ( Number t )
Numberlength ( Number t=1.0 )
ObjectlinesIntersect ( DzLine3 line, Number tolerance=0.0 )
ObjectminDistanceFromLine ( DzLine3 line )
ObjectminDistanceFromLineSquared ( DzLine3 line )
ObjectminDistanceFromPoint ( DzVec3 pnt, Boolean clampEnds=false )
ObjectminDistanceFromPointSquared ( DzVec3 pnt, Boolean clampEnds=false )
ObjectminDistanceFromRay ( DzLine3 ray )
ObjectminDistanceFromRaySquared ( DzLine3 ray )
voidnegate ()
ObjectplaneIntersect ( DzVec3 planePoint, DzVec3 planeNormal )
ObjectsegmentsIntersect ( DzLine3 line, Number tolerance=0.0 )
voidsetLength ( Number length )
voidswapEnds ()
StringtoString ()

Detailed Description

TODO: Add detailed description.

Properties


DzVec3 : end

Holds the line's ending point in three dimensional space.


DzVec3 : origin

Holds the line's starting point in three dimensional space.

Constructors


DzLine3()

Default Constructor. Creates an uninitialized line.


DzLine3( String line )

Creates a quaternion by parsing a string.

Parameter(s):

  • line - A string representation of the line in the form "[[ originX, originY, originZ ],[ endX, endY, endZ ]]"

DzLine3( DzLine3 line )

Copy Constructor.


DzLine3( DzVec3 origin, DzVec3 end )

Parameterized Constructor.

Parameter(s):

  • origin - The origin point of the line.
  • end - The end point of the line.

Methods


DzVec3 : getDirection()

Return Value:

  • The vector direction of this line (end - origin).

Since:

  • 4.11.0.216

DzVec3 : getPoint( Number t )

Return Value:

  • The point with the given parametric distance along the line.

Since:

  • 4.11.0.216

Number : length( Number t=1.0 )

Return Value:

  • The length of the line given a parametric distance along the line.

See Also:

Since:

  • 4.11.0.216

Object : linesIntersect( DzLine3 line, Number tolerance=0.0 )

Tests the intersection of two lines. This line and the given line are assumed to be infinitely long in both directions (i.e. the intersection can be outside the origin-end segment of either line).

Parameter(s):

  • line - The line to test intersection with.
  • tolerance - If not zero, specifies the maximum distance between lines that will be counted as an intersection.

Return Value:

  • An object where the “intersects” property represents whether or not this line intersects with the given line, and the “intersection” property represents the intersection point if the lines intersect.

Since:

  • 4.11.0.216

Object : minDistanceFromLine( DzLine3 line )

Parameter(s):

  • line - The line to calculate min distance from.

Return Value:

  • An object where the “distance” property represents the minimum distance between this line and another line, the “s” property represents the parametric distance along this line, and the “t” property represents the parametric distance along the given line.

Since:

  • 4.11.0.216

Object : minDistanceFromLineSquared( DzLine3 line )

Parameter(s):

  • line - The line to calculate min distance from.

Return Value:

  • An object where the “distance” property represents the minimum distance squared between this line and another line, the “s” property represents the parametric distance along this line, and the “t” property represents the parametric distance along the given line.

Since:

  • 4.11.0.216

Object : minDistanceFromPoint( DzVec3 pnt, Boolean clampEnds=false )

Parameter(s):

  • pnt - The point to calculate the min distance from.
  • clampEnds - If true, the parametric distance is clamped to the [0-1] range and the nearest point to the line segment is returned rather than the nearest distance to the infinite line formed by the two end points of the segment.

Return Value:

  • An object where the “distance” property represents the minimum distance between this line and a point, and the “s” property represents the parametric distance along the line to the minimum perpendicular distance point.

Since:

  • 4.11.0.216

Object : minDistanceFromPointSquared( DzVec3 pnt, Boolean clampEnds=false )

Parameter(s):

  • pnt - The point to calculate the min distance from.
  • clampEnds - If true, the parametric distance is clamped to the [0-1] range and the nearest point to the line segment is returned rather than the nearest distance to the infinite line formed by the two end points of the segment.

Return Value:

  • An object where the “distance” property represents the minimum distance squared between this line and a point, and the “s” property represents the parametric distance along the line to the minimum perpendicular distance point.

Since:

  • 4.11.0.216

Object : minDistanceFromRay( DzLine3 ray )

Parameter(s):

  • ray - The ray to calculate min distance from.

Return Value:

  • An object where the “distance” property represents the minimum distance between this line and a ray, the “seg_t” property represents the parametric distance along this line, and the “ray_t” property represents the parametric distance along the given ray.

Since:

  • 4.11.0.216

Object : minDistanceFromRaySquared( DzLine3 ray )

Parameter(s):

  • ray - The ray to calculate min distance from.

Return Value:

  • An object where the “distance” property represents the minimum distance squared between this line and a ray, the “seg_t” property represents the parametric distance along this line, and the “ray_t” property represents the parametric distance along the given ray.

Since:

  • 4.11.0.216

void : negate()

Reverses the direction of the line by mirroring the endpoint.

Since:

  • 4.11.0.216

Object : planeIntersect( DzVec3 planePoint, DzVec3 planeNormal )

Calculates the intersection of this line and the plane specified. The plane is defined by a point on the plane and the normal to the plane.

Parameter(s):

  • planePoint - A point on the plane (to define the plane).
  • planeNormal - The normal to the plane (to define the plane).

Return Value:

  • An object where the “intersects” property represents whether or not this line intersects with the given plane, the “t” property represents the parametric distance along this line to the intersection point (if there is one), and the “intersection” property represents the intersection point if the line and plane intersect.

Since:

  • 4.11.0.216

Object : segmentsIntersect( DzLine3 line, Number tolerance=0.0 )

Tests the intersection of two line segments.

Parameter(s):

  • line - The line to test intersection with.
  • tolerance - If not zero, specifies the maximum distance between lines that will be counted as an intersection.

Return Value:

  • An object where the “intersects” property represents whether or not this line segment intersects with the given line segment, and the “intersection” property represents the intersection point if the lines intersect.

Since:

  • 4.11.0.216

void : setLength( Number length )

Sets the line to have the length given by setting the endpoint relative to the current origin.

See Also:

Since:

  • 4.11.0.216

void : swapEnds()

Swaps the origin for the endpoint.

Since:

  • 4.11.0.216

String : toString()

Return Value:

  • A string representation of this line in the form "[[ originX, originY, originZ ],[ endX, endY, endZ ]]".