ds:set-cstrn-state
List of: Scheme Extensions
Subjects: Deformable Surfaces
Contents: ACIS Deformable Modeling

Action: Sets whether a constraint on a deformable model is enabled or disabled.

Filename: adm/ds_scm/dsscm.cxx

APIs: api_dm_get_attrib_dm2acis

Syntax: (ds:set-cstrn-state owner tag state)

Arg Types: owner entity

state integer

tag integer

Returns: boolean

Description: Sets whether a constraint on a deformable model is enabled or disabled. When state is 1, the constraint is enabled; when state is 0, the constraint is disabled.


The input argument owner is the face or edge being sculpted. tag is the identifier for the constraint to modify. When the tag identifier identifies a constraint, the deformable model in the patch hierarchy which contains the constraint becomes the active deformable model.


This extension returns a #t when the change is allowed and #f when the change is prohibited or when the target is not a constraint.


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


state to enable or disable constraint.


tag identifier identifies a constraint, the deformable model in the patch hierarchy which contains the constraint becomes the active deformable model.

Example: ; ds:set-cstrn-state

; Add to a square test face a parabolic crv-load

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

;; ()

; Add a pt-cstrn at the center of the parent 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)

;; ()

; Disable the point constraint and solve again.

(ds:set-cstrn-state dsmodel1 cc1 0)

;; #t

(ds:solve dsmodel1 1 1)

;; ()

; The shape deforms without the influence of the

; pt-cstrn.
PDF/ADM/06SCJ.PDF
HTM/DATA/ADM/ADM/06SCJ/0019.HTM