ds:add-pt-cstrn
List of: Scheme Extensions
Subjects: Deformable Surfaces
Contents: ACIS Deformable Modeling

Action: Adds a point constraint to the specified deformable model of the owner.

Filename: adm/ds_scm/dsscm.cxx

APIs: api_dm_get_attrib_dm2acis

Syntax: (ds:add-pt-cstrn owner target=1 behavior


{uv-position | pick-event})

Arg Types: owner entity

target integer

behavior string

uv-position par-pos

pick-event pick-event

Returns: integer

Description: Adds a point constraint to the target deformable surface of the owner and returns the new constraint's tag identifier.


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


Otherwise, the target is the deformable model whose tag identifier equals target.


When a parametric position location is supplied for uv-position, the point constraint is added at the given parametric location. The u and v values in uv-position are scaled to range from 0.0 to 1.0.


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. The valid string values for behavior are:


for single behaviors:


- "position" or "p"

- "tangent" or "t"

- "tan2" or "t2"

- "normal" or "n"

- "binormal" or "b"

- "curvature" or "c"

- "curv2" or "c2"


for 2 behavior combinations:


- "pos_tan" or "pt"

- "pos_tan2" or "pt2"

- "pos_norm" or "pn"

- "pos_binorm" or "pb"

- "pos_cur" or "pc"

- "pos_cur2" or "pc2"

- "tan_tan2" or "tt2"

- "tan_norm" or "tn"

- "tan_binorm" or "tb"

- "tan2_norm" or "t2n"

- "cur_cur2" or "cc2"


for 3 behavior combinations:


- "pos_tan_tan2" or "ptt2"

- "pos_tan_norm" or "ptn"

- "pos_tan_binorm" or "ptb"

- "pos_tan2_norm" or "pt2n"

- "pos_tan2_cur" or "pt2c"

- "pos_tan_cur2" or "ptc2"

- "pos_cur_cur2" or "pcc2"

- "tan_tan2_norm" or "tt2n"

- "pos_tan_tan2_norm" or "ptt2n"


Therefore, a large number of different behavior states are allowed for a link constraint. These states can be specified by the string "pos_?_?_tan_?_?" where the question marks can be one of "off" or "o", "fixed" or "f", or "linked" or "l". As an example, the string "pos_linked_linked_tan_off_off" or "pll_too" sets the behavior to DM_POS_LINKED | DM_POS_2_LINKED | DM_TAN_FREE | DM_TAN_2_FREE.


Trimmed surfaces occupy only a portion of the unit square. An error is generated if the uv-position is not in a valid portion of the deformable model. When the pick_event is supplied, a point constraint is added at the first intersection between a ray and the deformable surface or curve. The ray starts at the pick point and moves in the viewing direction.


owner ACIS face or edge on which the deformable model lives.


target specifies which deformable model to use in a patch hierarchy.


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.


uv-position is a parametric position location.


pick-event to add point constraint at the first intersection between a ray and the deformable surface or curve.

Example: ; ds:add-pt-cstrn

; Add and use a point constraint to a square test

; 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))

;; ()

; OUTPUT Original


; 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 16 16 10))

;; 8

; Compute a new deformable model position

(ds:solve dsmodel1 1 1)

;; ()

; OUTPUT Result



Figure 4-8. ds:add-pt-cstrn
PDF/ADM/04SCA.PDF
HTM/DATA/ADM/ADM/04SCA/0013.HTM