Action:
|
Evaluates an edge or a curve at the specified parameter and number of derivatives.
|
|
Filename:
|
kern/kern_scm/crv_scm.cxx
|
|
Syntax:
|
(curve:eval edge-or-curve parameter [integer-type])
|
|
Arg Types:
|
edge-or-curve
|
curve | edge
|
|
parameter
|
real
|
|
integer-type
|
integer
|
|
Returns:
|
(position) | (position gvector) | (position gvector gvector)
|
|
Errors:
|
EDGE with no
CURVE
|
|
Description:
|
The parameterization of all curves is normalized to lie in the interval 0 to 1; therefore, evaluating at
parameter=0 indicates the start point of the curve.
|
|
|
edge-or-curve specifies an edge or a curve.
|
|
|
parameter specifies the length of the curve to evaluate. If the specified parameter lies outside the range 0 to 1, this extension returns an implicit position. A spline can only reliably be evaluated for parametric values from 0 to 1; if
parameter is outside of this range for a spline edge, the returned value is meaningless.
|
|
|
integer-type is 0, 1, or 2 and specifies how many derivatives to compute. 0 evaluates only the position on the curve; 1 evaluates the position and first derivative [tangent]; or 2 evaluates the position and the first and second derivatives.
|
|
Example:
|
; curve:eval
|
|
; Create a circular edge.
|
|
(define edge1
|
|
|
(edge:circular
|
|
|
(position 0 0 0) 25 0 185))
|
|
;; edge1
|
|
; Evaluate the edge at various
|
|
; parameters and derivatives.
|
|
(curve:eval edge1 0.45 0)
|
|
;; (#[position 2.93843493644595 24.8267114238732 0])
|
|
(curve:eval edge1 0.45 1)
|
|
;; (#[position 2.93843493644595 24.8267114238732 0]
|
|
;; #[gvector -80.1619535059791 9.48779243187324 0])
|
|
(curve:eval edge1 0.45 2)
|
|
;; (#[position 2.93843493644595 24.8267114238732 0]
|
|
;; #[gvector -80.1619535059791 9.48779243187324 0]
|
|
;; #[gvector -30.6347450861677 -258.83165434934 0])
|