|
Action:
|
Adds a curve constraint that is a straight line in the parametric space of the deformable model and returns its tag.
|
|
|
Filename:
|
adm/ds_scm/dsscm.cxx
|
|
|
APIs:
|
api_dm_get_attrib_dm2acis
|
|
|
Syntax:
|
(ds:add-str-cstrn owner target=1 behavior
|
|
|
start-point stop-point [integral-degree=10])
|
|
|
Arg Types:
|
owner
|
entity
|
|
target
|
integer
|
|
behavior
|
string
|
|
start-point
|
par-pos
|
|
stop-point
|
par-pos
|
|
integral-degree
|
integer
|
|
|
|
|
Returns:
|
integer
|
|
|
Description:
|
Adds a curve constraint to the
target deformable model of the
owner along a straight line segment within the domain of the deformable surface. The line runs from
start-point to
stop-point.
|
|
|
The
target argument specifies which deformable model to use in a patch hierarchy. Valid values for
target are:
|
|
|
1
|
= active deformable model
|
|
2
|
= root deformable model
|
|
-1
|
= active deformable model and offspring
|
|
-2
|
= root deformable model and offspring
|
|
|
Otherwise, the
target is the deformable model whose tag identifier equals
target.
|
|
|
For deformable curves only the
u values of the input
par-pos objects are used. The
u and
v values in
start-point and
stop-point are scaled to range from 0.0 to 1.0.
|
|
|
integral-degree specifies the accuracy of numerical integration used within each element. (A polynomial function of degree
integral_degree will be integrated exactly.) Increasing the
integral-degree increases the computation cost and reduces the error.
|
|
|
behavior specifies whether the position and/or the tangent of the deformable model across the curve is constrained along the length of the curve. The valid string values for
behavior are:
|
|
|
For curve constraints allowed behaviors include:
|
|
|
-
|
"pos_tan" or
"pt"
|
|
-
|
"pos_cur" or
"pc" (turns on "tangent")
|
|
|
owner ACIS face or edge on which the deformable model lives.
|
|
|
target specifies which deformable model to use in a patch hierarchy.
|
|
|
start-point is the starting point of a line.
|
|
|
stop-point is the ending point of a line.
|
|
|
behavior specifies whether the position, the tangent, and/or the curvature of the deformable model across the curve is constrained along the length of the curve.
|
|
|
integral-degree specifies the accuracy of numerical integration used within each element.
|
|
|
Limitations:
|
This Scheme extensions will not always work correctly if the target argument is not already the active deformable model. A target deformable model can be made active by calling a query Scheme extensions on it, such as
ds:get-tag-summary or
ds:get-alpha. This should be used immediately before calling the extension.
|
|
|
Example:
|
; ds:add-str-cstrn
|
|
; Add to a square test face a straight crv-cstrn
|
|
; and use it.
|
|
; Build a test square spline face.
|
|
; (6x6 control points, x and y side length = 36)
|
|
(define dsmodel1 (ds:test-face 6 6 36 36 0))
|
|
;; dsmodel1
|
|
; Don't display entity / ds test face exists
|
|
(define erase (entity:erase dsmodel1))
|
|
;; erase
|
|
; Render the loads and constraints.
|
|
(ds:set-draw-state dsmodel1 1
|
|
|
(+ ds-draw-cstrns ds-draw-loads))
|
|
;; ()
|
|
; toggle off the default edge crv-cstrns
|
|
(ds:toggle-cstrn dsmodel1 1)
|
|
;; 0
|
|
(ds:toggle-cstrn dsmodel1 2)
|
|
;; 0
|
|
(ds:toggle-cstrn dsmodel1 3)
|
|
;; 6
|
|
(ds:toggle-cstrn dsmodel1 4)
|
|
;; 6
|
|
; Add in corner constraints
|
|
(ds:add-pt-cstrn dsmodel1 1 "position"
|
|
|
(par-pos 1 0))
|
|
;; 7
|
|
(ds:add-pt-cstrn dsmodel1 1 "position"
|
|
|
(par-pos 1 1))
|
|
;; 8
|
|
(ds:add-pt-cstrn dsmodel1 1 "position"
|
|
|
(par-pos 0 1))
|
|
;; 9
|
|
; Add straight constraint across square's corner
|
|
(ds:add-str-cstrn dsmodel1 1 "position"
|
|
|
(par-pos 0 0.4) (par-pos 0.4 0))
|
|
;; 10
|
|
; Add a pt-cstrn at the center and track it
|
|
(define cc1 (ds:add-pt-cstrn dsmodel1
|
|
|
1 "position" (par-pos 0.5 0.5)))
|
|
;; cc1
|
|
(ds:set-pt-xyz dsmodel1 cc1 0
|
|
|
(position 18 18 20))
|
|
;; 8
|
|
; OUTPUT Original
|
|
|
; Compute a new deformable model position
|
|
(ds:solve dsmodel1 1 1)
|
|
;; ()
|
|
; The dsmodel1 deforms to interpolate
|
|
; all the point and the curve constraints
|
|
; OUTPUT Result
|
|
|
|
|
|
Figure 4-13. ds:add-str-cstrn
|