Ray

Synopsis

This design describes a ray object with a direction vector and a start point. Ray parts are displayed as a line segment to indicate their direction and the start of the line segment indicates its position.

Mixins

InkStrokedMixin

RenderMixin

AssemblyMixin

BaseDesign

Parameters

Name Type Description
origin point Origin point used to describe the ray's location.
direction vector Vector used to describe the ray's orientation.
length number Length of line representing the ray.

At points of zero curvature - such as any point on a line, inflection points of splines, or ends of certain fitted splines - the normal( ) and binormal( ) vectors are undefined or ambiguous. In these cases, it is common to get zero or near-zero vectors returned. Such vectors are likely to cause degenerate geometry or other errors when used in other calculations. It may be necessary to anticipate and handle such cases appropriately for the particular intended use.

Example 1

Name: Ray_Ex01
Design: Curves AcDrawingDocument
Child Name: origin
Child Design: :Sphere
Name Type Supplied
center point Point(0, 0, 0)
radius number 0.2
color string "blue"
Child Name: outset
Child Design: :Sphere
Name Type Supplied
center point Point(7, 1, 3)
radius number 0.2
color string "jungle green"
Child Name: Ray
Child Design: :Ray
Name Type Supplied
direction vector outset.center - origin.center
origin point origin.center

Example 2

Name: Ray_Ex02
Design: Curves AcDrawingDocument
Name Type Formula
segmentQty integer 14
pointList list

Dim i As Integer = 0

Dim result as List = {}

For i = 1 To (segmentQty - 1)

result = result + {curve.pointAtLength(i * curve.length / segmentQty)}

Next i

Return result

Child Name: curve
Child Design: :SplineCurve
Name Type Supplied
pointList list {Point(0, -1, 0), Point(2, 1, 0), Point(2, 3, 0), Point(5, 0, 0)}
color string "blue"
Child Name: biNormal
Child List?
Child Design: :Ray
Name Type Supplied
direction vector curve.biNormal(nth(Child.index, pointList))
origin point nth(Child.index, pointList)
Quantity integer length(pointList)
Child Name: pt
Child Design: :Point
Child List?
Name Type Supplied
origin point nth(Child.index, pointList)
color string "red"
Quantity integer length(pointList)

Example 3

Name: Ray_Ex03
Design: Curves AcDrawingDocument
Name Type Formula
segmentQty integer 14
pointList list Dim i As Integer = 0 Dim result as List = {} For i = 1 To (segmentQty - 1) result = result + {curve.pointAtLength(i * curve.length / segmentQty)} Next i Return result
Child Name: curve
Child Design: :SplineCurve
Name Type Supplied
pointList list {Point(0, -1, 0), Point(2, 1, 0), Point(2, 3, 0), Point(5, 0, 0)}
color string "olive green"
Child Name: normal
Child Design: :Ray
Child List?
Name Type Supplied
direction vector curve.normal(nth(Child.index, pointList))
origin point nth(Child.index, pointList)
Quantity integer length(pointList)
Child Name: pt
Child Design: :Point
Child List?
Name Type Supplied
origin point nth(Child.index, pointList)
color string "blue"
Quantity integer length(pointList)