Scheme Extensions Aa thru ds:c* |
|
|
Technical Article |
Scheme is a public domain programming language, based on the LISP language,
that uses an interpreter to run commands. ACIS provides extensions (written in
C++) to the native Scheme language that can be used by an application to
interact with ACIS through its Scheme Interpreter. The C++ source files for
ACIS Scheme extensions are provided with the product. Spatials Scheme based
demonstration application, Scheme ACIS Interface Driver Extension (Scheme
AIDE), also uses these Scheme extensions and the Scheme Interpreter.
|
edge | edge |
adv-cover-opts | AdvCover_Opt |
; adv-cover:cover-circuit ; Define the edge (define e (edge:spline (list (position 0 0 0) (position 1 1 .3) (position 0 2 0) (position -1 1 .3) (position 0 0 0)))) ;; e ; Make the wire body. (define wire (wire-body e)) ;; wire (define e (list-ref (entity:edges wire) 0)) ;; e ; Cover the wire. (define my-ent (adv-cover:cover-circuit e )) ;; my-ent |
[Top]
edge-list | (edge... ) |
adv-cover-opts | AdvCover_Opt |
; adv-cover:cover-edges (part:clear) ;; #t ; Make a spline edge (define e1 (edge:spline (list (position 4 -3 -1) (position 5 0 0)(position 4 3 1)(position 3 4 2) (position 0 5 3)(position -3 4 2)(position -4 3 1) (position -5 0 0)(position -4 -3 -1)(position -3 -4 -2) (position 0 -5 -3)(position 3 -4 -2)(position 4 -3 -1)) "periodic")) ;; e1 ; Split spline edge and make 2 edges (define elist (edge:split e1 (position 0 5 3))) ;; elist ; Make 2 wire bodies, one from each edge (define wi1 (wire-body (list (list-ref elist 0)))) ;; wi1 (define wi2 (wire-body (list (list-ref elist 1)))) ;; wi2 ; Get the handles for the edges in the wires (define e1 (list-ref (entity:edges wi1) 0)) ;; e1 (define e2 (list-ref (entity:edges wi2) 0)) ;; e2 ; Cover the edges (adv-cover:cover-edges (list e1 e2)) ;; #[entity 10 1]
|
[Top]
adv-cover-opts | AdvCover_Opt |
; adv-cover:max-gap ; Define the edge (define e (edge:spline (list (position 0 0 0) (position 1 1 .3) (position 0 2 0) (position -1 1 .3) (position 0 0 0)))) ;; e ; Make the wire body. (define wire (wire-body e)) ;; wire (define e2 (list-ref (entity:edges wire) 0)) ;; e2 (define op (adv-cover:options "default_continuity" 0)) ;; op ; Cover the wire. (define my-ent (adv-cover:cover-circuit e2 op)) ;; my-ent (adv-cover:max-gap op) ;; (0.0022310700771418 1.0471975511966) |
[Top]
name-of-option | string |
value | real | entity | integer |
adv-cover-opts | AdvCover_Opt |
Note: These options are explained in more detail with examples in the ACIS Deformable Modeling Component Use Cases documentation.
; adv-cover:options ; Example 1 ; make an adv-cover-opts object (define opt (adv-cover:options "default_continuity" 1 "flattening" 0.1)) ; make a cylinder and pick an endcap to cover G1 (solid:cylinder 0 0 0 0 0 10 3) (ray:queue -334.032 -146.77 341.948 0.67652 0.297272 -0.673759 1) (define f (pick-face)) ; recover the end cap (adv-cover:recover-face f opt) (render:rebuild) |
; adv-cover:options ; Example 2 ; make an adv-cover-opts object (define G0_tol 1.e-4) (define G1_tol 5.e-3) (define opt (adv-cover:options "default_continuity" 1 "default_tolerance" G0_tol G1_tol)) ; make a cylinder and pick an endcap to cover G1 (solid:cylinder 0 0 0 0 0 10 3) (ray:queue -334.032 -146.77 341.948 0.67652 0.297272 -0.673759 1) (define f (pick-face)) ; recover the end cap (adv-cover:recover-face f opt) (render:rebuild) |
; adv-cover:options ; Example 3 ; make an adv-cover-opts object (define v (vertex:from-position (position 0 0 15))) (define opt (adv-cover:options "guides" (list v))) ; make a cylinder and pick an endcap to cover G1 (solid:cylinder 0 0 0 0 0 10 3) (ray:queue -334.032 -146.77 341.948 0.67652 0.297272 -0.673759 1) (define f (pick-face)) ; recover the end cap (adv-cover:recover-face f opt) (render:rebuild) |
; adv-cover:options ; Example 4 ; make an adv-cover-opts object (define e (edge:circular (position 0 0 15) 2)) (define wi (wire-body (list e))) (define opt (adv-cover:options "guides" (entity:edges wi) )) ; make a cylinder and pick an endcap to cover G1 (solid:cylinder 0 0 0 0 0 10 3) (ray:queue -334.032 -146.77 341.948 0.67652 0.297272 -0.673759 1) (define f (pick-face)) ; recover the end cap (adv-cover:recover-face f opt) (render:rebuild) |
[Top]
face | face |
adv-cover-opts | AdvCover_Opt |
;adv-cover:recover-face ; Define a solid block (define b (solid:block (position 0 0 0) (position 10 10 10)) ;; b ; Pick a face (define f (list-ref (entity:faces b) 0)) ;; f ; Re-cover the face. (define my-ent (adv-cover:recover-face f )) ;; my-ent |
[Top]
owner | entity |
target | integer |
zone-flag | integer |
uv1 | par-pos |
uv2 |
|
pick1 |
|
pick2 |
Otherwise, the target is the deformable model whose tag identifier equals target.
; ds:add-area-cstrn ; ds:add-area-cstrn ; Use an area constraint to enable an isolated ; deformation ; Build a test square spline face. ; (25x25 control points, x and y side length = 36) (define dsmodel1 (ds:test-face 25 25 36 36 0)) ;; dsmodel1 ; Render the elemnts, loads, and constraints. (ds:set-draw-state dsmodel1 2 (+ ds-draw-elems (+ ds-draw-cstrns ds-draw-loads))) ; Add an area constraint and a pressure load. (define c1 (ds:add-area-cstrn dsmodel1 2 0 (par-pos 0.2 0.2) (par-pos 0.8 0.8))) (define c2 (ds:add-dist-press dsmodel1 2 100000)) ; solve for the new shape. (ds:solve dsmodel1 2) ; The square shape, constrained along its edges ; rises in the middle where deformations are allowed ; Commit the deformable surface back to the model. (ds:commit dsmodel1) ; Perform a zoom-all to see everything. (zoom-all) |
[Top]
owner | entity |
target | integer |
xyz-position | position |
power | integer |
gain | real |
Otherwise, the target is the deformable model whose tag identifier equals target.
An attractor acts like a concentrated charge either attracting (negative gains) or repulsing (positive gains) the entire deformable model shape with a 1/distance**power law. The distance is measured from the attractors location to each point on the deformable model.
The input argument xyz-position is optional. When given it is used to define the location of the attractor. When omitted the location is taken as an offset from center of the deformable model in the direction of surface normal at that point.
The input argument power is optional. When omitted it is set to 2. The power specifies how local the effect is. Values of 0 and 1 are global and values of 2 and higher are more local.
; ds:add-attractor ; Use an attractor to deform a faces shape. ; 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 (define erase (entity:erase dsmodel1)) ;; erase ; Dont render the face. ; Add a attractor and solve for the new shape. (define c1 (ds:add-attractor dsmodel1 2 100)) ;; c1 (ds:solve dsmodel1 1 1) ;; () ; OUTPUT Original ; The square shape, constrained along its edges ; rises at its center. ; Move the attractors xyz point and see the effect. (ds:set-pt-xyz dsmodel1 c1 0 (position 25 25 15)) ;; 15 (ds:solve dsmodel1 1 1) ;; () ; The center of the surface moves to the side. ; OUTPUT Result |
[Top]
owner | entity |
target | integer |
behavior | string |
uv-center | par-pos |
uv-a | par-pos |
uv-b | par-pos |
element-count | integer |
integral-degree | integer |
Otherwise, the target is the deformable model whose tag identifier equals target.
The u and v values in uv-center, uv-a, and uv-b are scaled to range from 0.0 to 1.0.
The parameter space curve is divided into element-count elements for building the constraint equations. More elements increase the cost of computation but reduce the size of the error.
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.
Therefore, a total of 81 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.
; ds:add-circ-cstrn ; Create a test face for this constraint. ; (6x6 control points, x and y side length = 36) (define dsmodel1 (ds:test-face 6 6 36 36 0)) ;; dsmodel1 ; Dont 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 circular constraint at the squares center (ds:add-circ-cstrn dsmodel1 1 "position" (par-pos 0.5 0.5) (par-pos 0 0.3) (par-pos 0.3 0)) ;; 7 ; Toggle off the default 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 ; 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 20 10 0)) ;; 8 ; Compute a new deformable model position. (ds:solve dsmodel1 1 1) ; *** Warning ; (dshusk/ds2acis:DS_LOW_DOF_CNT_WARNING) ; DS_warning - low dof count - Consider ds:split-d ;; () ; dsmodel1 deforms to interpolate the point ; and the curve constraint. ; Commit the deformable surface back to the model. (ds:commit dsmodel1) ;; () ; OUTPUT Result Figure. ds:add-circ-cstrn |
[Top]
owner | entity |
target | integer |
uv-center | par-pos |
uv-a | par-pos |
uv-b | par-pos |
gain | real |
element-count | integer |
integral-degree | integer |
Otherwise, the target is the deformable model whose tag identifier equals target.
The curve loads force the points of the surfaces parameter space curve to lie near the image space curve during subsequent deformations. Increasing the gain value forces the load points to remain closer to their current locations. Use curve constraints to interpolate those points.
The u and v values in uv-center, uv-a, and uv-b are scaled to range from 0.0 to 1.0. gain specifies the stiffness operating between the curves current position and its position in subsequent deformations. Large gain values limit the motion of the curve.
The parameter space curve is divided into element-count elements for building the load equations. More elements increase the cost of computation but reduce the size of the error. The default value is 8.
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.
; ds:add-circ-load ; Add and use a circ crv-cstrn to a square test face ; 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 ; Dont 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)) ;; () (ds:add-circ-load dsmodel1 1 (par-pos 0.5 0.5) (par-pos 0 0.3) (par-pos 0.3 0) 100) ;; 7 ; Toggle off the default 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 ; 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) ;; () ; dsmodel1 deforms to interpolate the point and ; the curve constraint. ; OUTPUT Result Figure. ds:add-circ-load |
[Top]
owner | entity |
target | integer |
shape | string |
tag | integer |
behavior | string |
{uv-pts}+ | par-pos | pick-event |
integral-degree | integer |
Otherwise, the target is the deformable model whose tag identifier equals target.
Subsequent arguments to this extension specify what kind of constraint is being added.
owner is the face or edge being deformed.
shape specifies which loci of points in the deformable model are constrained. The supported constraints include point constraints and curve constraints in the form of straights, parabolas, and ellipses. An ellipse may be used to insert a circle constraint.
tag is the shape of a constraint taken from an existing load. When tag identifies a spring, a pressure point, or a spring load, one or more point constraints are added to the system and the loads are deleted. When tag identifies a curve load, a curve constraint is added.
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.
uv-pts are one or more par-pos point locations that parameterize a shape. Each par-pos location specifies a point in the domain space of the deformable model. The coordinates of any par-pos point are scaled to the range of 0.0 to 1.0. Any uv-pt may be specified explicitly by a par-pos object or by a pick event. When a uv-pt is specified by a pick event, the required par-pos is calculated as the first intersection between the pick ray contained within the pick event and the shape of the deformable model. Different shapes require different numbers of uv-pts. Do not combine uv-pts into a list.
Shape | Count | Description |
---|---|---|
point |
1 |
The points uv point |
straight |
2 |
Begin uv point and end uv point |
parabola |
3 |
Begin uv point, tangent intersection point, and end uv point |
circ |
3 |
Center uv point, a axis end uv point, and b axis end uv point |
tag |
0 |
Shape is taken from an existing load and the load is deleted |
A parabola is defined by three uv points: the two end points and a point at the intersection of the two end tangent vectors.
This makes a well parameterized circle.
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.
; ds:add-cstrn ; Add and use a point constraint to a square test ; face ; 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 ; Dont 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 point constraint at the squares center. (define cc1 (ds:add-cstrn dsmodel1 1 "point" "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) ;; () ; dsmodel1 deforms to interpolate the point and ; the curve constraint. ; OUTPUT Result Figure. ds:add-cstrn |
[Top]
owner | entity |
target | integer |
gain | real |
pos-param1 | par-pos |
pos-param2 | par-pos |
Otherwise, the target is the deformable model whose tag identifier equals target.
The distributed pressure is a force of amplitude (gain) acting in the normal direction of the surface. The distributed pressure is applied to the entire surface by default.
If the two optional parametric position arguments, pos-param1 and pos-param2, are used, they limit the distributed pressure domain to a box whose corners are specified by pos-param1 and pos-param2 in the parameter space of the deformable surface. The param1 and param2 values in pos-param1 and pos-param2 are scaled to range from 0.0 to 1.0. The distributed pressure is an effective puff command. It causes surfaces to billow in the direction of the applied pressure.
; ds:add-dist-press ; Add a distributed pressure to puff a faces shape ; 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 ; Dont 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 distributed pressure and solve for new shape. (define c1 (ds:add-dist-press dsmodel1 1 2000)) ;; c1 (ds:solve dsmodel1 1 1) ;; () ; The square shape, constrained along its edges, ; rises in its center. ; OUTPUT Original ; Increase the pressures amplitude and effect. (ds:set-load-gain dsmodel1 c1 10000) ;; 3 (ds:solve dsmodel1 1 1) ;; () ; The center of the surface moves more. ; OUTPUT Result Figure. ds:add-dist-press |
[Top]
owner | entity |
target | integer |
behavior | string |
start-ppt | par-pos |
tang-xsect-ppt | par-pos |
stop-ppt | par-pos |
integral-degree | integer |
Otherwise, the target is the deformable model whose tag identifier equals target.
The parabolic arc runs from start-ppt to stop-ppt and the arcs end tangents intersect at the point tang-xsect_ppt. The u and v values in start-ppt, tang-xsect-ppt, and stop-ppt are scaled to range from 0.0 to 1.0.
integral-degree specifies the accuracy of numerical integration used during the construction of the constraint equations.
behavior specifies whether the position and/or the tangent of the deformable model across the curve is constrained along the length of the curve.
Therefore, a 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.
; ds:add-parab-cstrn ; 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 ; Dont 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 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 ; OUTPUT Original ; Add a parabolic load across the squares corner. (ds:add-parab-cstrn dsmodel1 1 "position" (par-pos 0 0.4) (par-pos 0 0) (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 ; Compute a new deformable model position. (ds:solve dsmodel1 1 1) ;; () ; The dsmodel1 deforms to interpolate all the point ; constraints while remaining near the load curve. ; OUTPUT Result Figure. ds:add-parab-cstrn |
[Top]
owner | entity |
target | integer |
start-ppt | par-pos |
tang-xsect-ppt | par-pos |
stop-ppt | par-pos |
gain | real |
integral-degree | integer |
Otherwise, the target is the deformable model whose tag identifier equals target.
The parabolic arc runs from start-ppt to stop-ppt and the arcs end tangents intersect at the point tang-xsect-ppt. The u and v values in start-ppt, tang-xsect-ppt, and stop-ppt are scaled to range from 0.0 to 1.0.
gain specifies the stiffness that attracts the loads domain curve towards its image space curve. The loads image space curve is made by projecting the domain curve into image space using the surfaces shape. This starts the curve load out with two curves that have the same shape.
integral-degree specifies the accuracy of numerical integration used during the construction of the constraint equations.
; ds:add-parab-load ; 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 ; Dont 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 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 ; OUTPUT Original ; Add a parabolic load across the squares corner. (ds:add-parab-load dsmodel1 1 (par-pos 0 0.4) (par-pos 0 0) (par-pos 0.4 0) 300) ;; 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 ; Compute a new deformable model position. (ds:solve dsmodel1 1 1) ;; () ; dsmodel1 deforms to interpolate the point ; constraints while remaining near the load curve. ; OUTPUT Result Figure. ds:add-parab-load |
[Top]
owner | entity |
target | integer |
shape | integer |
point1 | par-pos |
point2 | par-pos |
point3 | par-pos |
refinement | integer |
The center of the ellipse is point1. One axis of the ellipse is defined by the vector point2, and the second axis of the ellipse is defined by the vector point3. point2 and point3 are stored as par-pos objects instead of pos-vec objects only because the pos-vec object has not yet been exposed to the Scheme interface. All point arguments are par_pos objects. The points point1, (point1+point2), and (point1+point3) may all have values which range over the unit square which is mapped to the domain of the actual target deformable model.
When shape equals 3, a fillet square seam, point1 and point2 define the upper and lower corners of a square seam where each of the squares corners are rounded off with an arc fillet whose radius equals point3.
The refinement argument specifies the density of the patch control points as compared to the parents. A refinement value of 1 specifies that the new patch control point density is the same as that of the target deformable model. A refinement value of 2 specifies that the new patch has twice the density of control points as the parent. The refinement value must be an integer greater than 0.
Otherwise, the target is the deformable model whose tag identifier equals target.
; ds:add-patch ; Create deformable topology/geometry to illustrate ; command. (define dsmodel1 (ds:test-face 6 6 36 36 0)) ;; dsmodel1 (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 10)) ;; 8 (ds:solve dsmodel1 1 1) ;; () ; Add patch to deformable model. (define patch1 (ds:add-patch dsmodel1 1 1 (par-pos 0.3 0.3) (par-pos 0.5 0.5) (par-pos 0.7 0.7) 3)) ;; patch1 |
[Top]
owner | entity |
target | integer |
behavior | string |
uv-position | par-pos |
pick-event | pick-event |
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.
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.
; 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 ; Dont 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. ds:add-pt-cstrn |
[Top]
owner | entity |
target | integer |
uv-position | par-pos |
pick | pick-event |
gain | real |
Otherwise, the target is the deformable model whose tag identifier equals target.
The point pressure is a single force vector acting in the direction of the surfaces normal with an amplitude set by the input gain. The uv location of the force on the surface is specified explicitly by uv-position or by defining a pick-event. The u and v values in uv-position are scaled to range from 0.0 to 1.0. When a pick-event is input, a line passing through the pick point in the viewing direction is intersected with the surface to find the point at which the pressure is applied.
; ds:add-pt-press ; Use a point pressure load to puff a faces shape ; 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 ; Dont 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)) ;; () (define c1 (ds:add-spring dsmodel1 1 (par-pos 0.5 0.5) (position 10 10 15) 200)) ;; c1 ; Add a point pressure load and ; solve for the new shape (ds:add-pt-press dsmodel1 1 (par-pos 0.4 0.8) 10000)) ;; 7 (ds:solve dsmodel1 1 1) ;; () ; OUTPUT Original ; The square shape, constrained along its edges ; rises towards one corner ; Increase the gain for a larger motion (ds:set-load-gain dsmodel1 c1 20000) ;; 4 (ds:solve dsmodel1 1 1) ;; () ; Motion is exaggerated. ; Commit the deformable surface back to the model. (ds:commit dsmodel1) ;; () ; Perform a zoom-all to see everything. This ; is part of acis.scm. (zoom-all) ;; #[view 10768947] ; OUTPUT Result Figure. ds:add-pt-press |
[Top]
owner | entity |
target | integer |
uv-position | par-pos |
pick | pick-event |
xyz-position | position |
gain | real |
slide-state | integer |
Otherwise, the target is the deformable model whose tag identifier equals target.
This force acts to keep the point in the surface near its associated three dimensional space point. Increasing the gain value keeps the two points closer together. Use the point constraint feature to force a point on the surface to interpolate a point in three dimensional space. The location of the point in the surface can be given explicitly by the uv-position par-pos or computed from a pick-event. Deformable curves only use the u component of the input par-pos object. The u and v values in uv-position are scaled to range from 0.0 to 1.0.
When a pick-event is used, a line passing through the pick point in the viewing direction is intersected with the surface to compute the surface location for the spring. The three dimensional space point may be given explicitly by including the input position xyz-position. When xyz-position is omitted, the springs uv-position point is projected into three dimensional space through the surfaces shape to find the springs (x,y,z) position.
Springs may slide within the deformable surface so that they tend to act in a direction normal to the surface. If slide-state is 0 (default), the spring is fixed in the surface; if slide-state is 1, the spring is allowed to slide in the surface.
Use point constraints to force a point on the surface to interpolate a point in three dimensional space.
; ds:add-spring ; Use a spring load to puff a faces shape ; 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 ; remove entity / ds test face exists (define erase (entity:erase dsmodel1)) ;; erase ; Add a spring and solve for the new shape (define c1 (ds:add-spring dsmodel1 1 (par-pos 0.5 0.5) (position 18 18 15) 100)) ;; c1 (ds:solve dsmodel1 1 1) ;; () ; OUTPUT Original ; The square shape, constrained along its edges rises ; at its center ; Move the springs xyz pt and see the affect (ds:set-pt-xyz dsmodel1 c1 0 (position 25 25 15)) ;; 4 (ds:solve dsmodel1 1 1) ;; () ; The center of the surface moves to the side ; OUTPUT Result Figure. ds:add-spring |
[Top]
owner | entity |
target | integer |
pos-param1 | par-pos |
pos-param2 | par-pos |
position1 | position |
position2 | position |
positionc | position |
positiona | position |
positionb | position |
gain | real |
integral-degree | integer |
Otherwise, the target is the deformable model whose tag identifier equals target.
The load causes the line in the surface to lie near the shape of the three dimensional curve during subsequent deformations. This load is helpful in forcing the shape of the overall surface.
gain specifies the stiffness of the spring acting between the pcurve and the three dimensional space curve. Large gain values cause the points along the pcurve to lie closer to the points on the three dimensional space curve during subsequent deformations.
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.
; ds:add-spring-curve ; 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 ; Dont 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 spring and solve for the new shape (define c1 (ds:add-spring-curve dsmodel1 1 (par-pos 0 0.5) (par-pos 0.5 0) (position 0 18 10) (position 18 0 20) 10000)) ;; c1 ; OUTPUT Original ; Toggle off the default 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 some corner point constraints. (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 0 0)) ;; 8 (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 0 1)) ;; 9 (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 1 1)) ;; 10 (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 1 0)) ;; 11 ; Compute a new deformable model position. (ds:solve dsmodel1 1 1) ;; () ; The dsmodel1 deforms to interpolate the corner ; points and to lie near the crv-load. ; OUTPUT Result Figure. ds:add-spring-curve |
[Top]
owner | entity |
target | integer |
domain-points | real | (real ...) |
position | position | (position ...) |
gain | real |
; ds:add-spring-set ; Example command for demonstrating how a deformable ; model can be used to generate a surface shape ; from a set of scattered points. ; Build a test square spline face. ; (12x12 control points, x and y side length = 36) (define dsmodel1 (ds:test-face 12 12 36 36 0)) ;; dsmodel1 ; Dont 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)) ;; () (ds:set-default-shape dsmodel1 1 0) ;; () ; toggle the edge constraints (ds:toggle-cstrn dsmodel1 1) ;; 0 (ds:toggle-cstrn dsmodel1 2) ;; 0 (ds:toggle-cstrn dsmodel1 3) ;; 6 (ds:toggle-cstrn dsmodel1 4) ;; 6 ; Sample a simple surface function at a set of ; random points and connect each point to ; the deformable surface with a spring. (define spr1 (ds:add-spring-set dsmodel1 1 (ds:test-scatter 65 36 36 25) 5000)) ;; spr1 ; OUTPUT Original ; Force the surface to deform to the points. (ds:solve dsmodel1 1 1) ;; () ; Increase the spring gain and solve again. (ds:set-load-gain dsmodel1 spr1 30000) ;; 5 (ds:solve dsmodel1 1 1) ;; () ; Refine the rendering to improve the look (ds:set-draw-grid dsmodel1 1 30 30) ;; () ; OUTPUT Result Figure. ds:add-spring-set |
[Top]
owner | entity |
target | integer |
behavior | string |
start-point | par-pos |
stop-point | par-pos |
integral-degree | integer |
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.
; 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 ; Dont 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 squares 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. ds:add-str-cstrn |
[Top]
[gain=100 integral-degree=10]) |
owner | entity |
target | integer |
start-point | par-pos |
stop-point | par-pos |
gain | real |
integral-degree | integer |
The line runs from start-point to stop-point. The u and v values in start-point and stop-point are scaled to range from 0.0 to 1.0. The loads image space curve is made by projecting the domain curve into image space using the surfaces shape. This starts the curve load out with two curves that have the same shape.
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
; ds:add-str-load ; Add to a square test face a straight 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 ; Dont 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 ; OUTPUT Original ; Add a parabolic constraint across the ; squares corner (ds:add-str-load dsmodel1 1 (par-pos 0 0.4) (par-pos 0.4 0) 200) ;; 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 ; Compute a new deformable model position (ds:solve dsmodel1 1 1) ;; () ; dsmodel1 deforms to interpolate ; all the point constraints while staying near the ; curve load ; OUTPUT Result Figure. ds:add-str-load |
[Top]
owner | entity |
target | integer |
image-vector | gvector |
gain | real |
Otherwise, the target is the deformable model whose tag identifier equals target.
A vector load is a constant vector force applied to the entire deformable shape. This load can be used to simulate a gravity-like effect. The input argument image-vector is optional. When given, it is used to define the direction of the vector load. When omitted, the direction is taken as the surface normal for the center of the deformable model.
; ds:add-vector-load ; Use a vector_load to puff a faces shape ; define some helpful globals ; 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 (define erase (entity:erase dsmodel1)) ;; erase ; Dont render the face ; Add a vector_load and solve for the new shape (define c1 (ds:add-vector-load dsmodel1 2 100)) ;; c1 (ds:solve dsmodel1 1 1) ;; () ; OUTPUT Original ; The square shape, constrained along its edges ; rises at its center ; Move the vector_loads xyz pt and see the affect (ds:set-pt-xyz dsmodel1 c1 0 (position 25 25 15)) ;; 14 (ds:solve dsmodel1 1 1) ;; () ; The center of the surface moves to the side ; OUTPUT Result Figure. ds:add-vector-load |
[Top]
|
{value(s)} {options}) |
name-of-option | string |
value | integer |
options | adm-options |
; ds:adm-options ; Create a block (define b1 (solid:block (position 5 10 15) (position 10 20 30))) ;; b1 ; define adm options (define ao1 (ds:adm-options "trim_faces" 0)) ;; ao1 (define ao2 (ds:adm-options "use_boundary_loads" 0)) ;; ao2 ; pick a face (ray:queue 8.00781 14.6484 500 0 0 -1 1) ;; #[ray (8.00781 14.6484 500) (0 0 -1)] (define ds-model (pick-face)) ;; ds-model ; start adm (ds:start-adm ds-model) ;; #t |
[Top]
owner | entity |
; ds:commit ; Copy a deformable surface model shape and ; deformable model data back to its ACIS face. ; 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 (ds:commit dsmodel1) ;; () ; No external graphical differences are seen on the ; screen but the internal data structures are now ; different. ; Another Example ; Do not 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 circular constraint at the square's center (ds:add-circ-cstrn dsmodel1 1 "position" (par-pos 0.5 0.5) (par-pos 0 0.3) (par-pos 0.3 0)) ;; 7 ; toggle off the default 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 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) ;; () ; dsmodel1 deforms to interpolate ; both the point and the curve constraint. ; Commit the deformable surface back to the model. (ds:commit dsmodel1) ;; () ; Perform a zoom-all to see everything. This ; is part of acis.scm. (zoom-all) ;; #[view 10768947] |
[Top]
owner | entity |
tag | integer |
memory | string |
The curve load is converted into a curve constraint, keeping the same tag ID and behaviors. When memory is remember, the constraint has the same target as the load. When memory is forget, the constraints target curve is generated by projecting the parameter space curve into image space through the surface function. In this case, the surface is constrained to maintain its current position all along the parameter space curve.
; ds:crv-cstrn-from-load ; Add a crv-load which forces a line in a surface to ; lie near a 3-space line then convert it to a ; constraint. ; 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 ; Dont 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 spline to a 3-space line crv-load (define cc1 (ds:add-spring-curve dsmodel1 1 (par-pos 0 0.5) (par-pos 0.5 0) (position 0 18 10) (position 18 0 20) 1000)) ;; cc1 ; toggle off the default 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 some corner point constraints (define cc2 (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 0 0))) ;; cc2 (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 0 1)) ;; 9 (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 1 1)) ;; 10 (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 1 0)) ;; 11 ; Compute a new deformable model position (ds:solve dsmodel1 1 1) ;; () ; OUTPUT Original ; Convert the load to a constraint (ds:crv-cstrn-from-load dsmodel1 cc1 "forget") ;; 7 ; OUTPUT Result Figure. ds:crv-cstrn-from-load |
[Top]
owner | entity |
tag | integer |
memory | string |
When the constraint is user-added, it is converted into a curve load, keeping the same tag ID and behaviors. If it is a sheet boundary constraint, a new curve load is created and the constraint is disabled. The loads parameter space curve lying within the surface is taken from the curve constraints parameter space curve. If the curve constraint has a target and the memory argument is remember, the load has the same target as the constraint. Otherwise, the loads image space curve is generated by projecting the parameter space curve into image space through the surface function. In this case, the two curves of the curve load start out at the same location.
; ds:crv-load-from-cstrn ; Builds a crv-load from a crv-cstrn. ; Returns the crv-cstrns tag. ; Build a test square face with some tag objects ; (6x6 control points, x and y side length = 36) (define dsmodel1 (ds:test-face 6 6 36 36 0)) ;; dsmodel1 ; Dont 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 corner and center point constraints (define cc1 (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 0.5 0.5))) ;; cc1 (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 0 0)) ;; 8 (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 1 0)) ;; 9 (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 1 1)) ;; 10 (ds:add-pt-cstrn dsmodel1 1 "position" (par-pos 0 1)) ;; 11 ; convert the edge constraints into edge loads (ds:crv-load-from-cstrn dsmodel1 3 "forget") ;; 12 (ds:crv-load-from-cstrn dsmodel1 4 "forget") ;; 13 (ds:crv-load-from-cstrn dsmodel1 5 "f") ;; 14 (ds:set-pt-xyz dsmodel1 cc1 0 (position 18 18 36)) ;; 8 ; OUTPUT Original (ds:solve dsmodel1 1 1) ;; () ; The edges of the curve move with the point ; but not as much as with no edge curve-loads ; OUTPUT Result Figure. ds:crv-load-from-cstrn |
[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.