Scheme Extensions |
|
|
Technical Article |
body1 | body |
body2 | body |
keep-leftovers | boolean |
keep-opt | string |
bool-opts | Bool_Options |
acis-opts | acis-options |
Description
This extension chops the blank body (body1)
with the tool body (body2). The
returned list contains the result of intersecting the two bodies, the result of
subtracting
body2
from
body1, and (possibly) a body containing
any leftovers. Either of the first two bodies returned may be empty. Leftovers
can only exist if the tool body is incomplete. If there is a body containing
leftovers, the
keep-leftovers
argument controls whether it is deleted or not: if
keep-leftovers
is
#f, any leftovers are deleted and the
returned list is always of length 2. If
keep-leftovers
is
#t, the returned list is only of length
3 if there are some leftovers (that is, an empty leftovers body is never
returned).
; bool:chop ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 25 25))) ;; block1 ; Create another solid block. (define block2 (solid:block (position -5 -20 -30) (position 30 15 35))) ;; block2 ; OUTPUT Original ; Chop block1 with block2 (define chop-result (bool:chop block1 block2)) ;; chop-result ; OUTPUT Result |
[Top]
body-list | (body ...) |
view | view |
hither | real |
yon | real |
acis-opts | acis-options |
Description
This extension takes an entity list and a view, from which it extracts an eye
position and a non-zero view vector (target eye). It also takes two doubles, hither
and yon, which define two planes orthogonal to the view vector. The
model will be clipped to the hither and yon plane. It first copies the
original, then trims those parts of the entity list that are outside the hither
and yon planes. The trimmed copy is passed back.
As default values, it uses the active part and the active view, and sets hither to SPAresabs and yon large enough to display the whole model. The eye point is at a distance hither along the view vector from the hither plane and a distance yon along the view vector from the yon plane.
If the model itself does not need to be trimmed (i.e., it already is completely contained within the hither-yon slice), then no copy of the model is made. A pointer to the original model is passed back (instead of a pointer to a copy). Caution is advised, since the user could delete the original model thinking it is a copy.
; bool:clip ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block1 ; Set the view eye position. (view:set-eye (position 10 15 20)) ;; #[position 100 -200 100] ; Make a copy of model clipped to the eye plane. (define clip (bool:clip)) ;; clip ; Delete original model. (entity:delete block1) ;; () (define refresh (view:refresh)) ;; refresh ; OUTPUT Clip1 ; Notice the clipped copy. ; Set another eye position. (view:set-eye(position 200 -300 400)) ;; #[position 10 15 20] (view:refresh) ;; #[view 1076825080] ; Note the changed eye view and the clipped corner. ; OUTPUT Clip2 |
[Top]
bool-type | string |
acis-opts | acis-options |
Description
Suitable for non-destructive Booleans and glue Booleans. Used in conjunction
with bool:start and bool:sel-intersect.
; bool:complete ; Create a tool body (define b1 (solid:block 0 0 0 10 10 10)) ;; b1 ; Create a blank body (define b2 (solid:block -5 -5 -5 5 5 5)) ;; b2 ; Define faces from tool and blank bodies. (define f1_1 (list-ref (entity:faces b1) 1)) ;; f1_1 (define f1_2 (list-ref (entity:faces b1) 2)) ;; f1_2 (define f1_3 (list-ref (entity:faces b1) 3)) ;; f1_3 (define f2_0 (list-ref (entity:faces b2) 0)) ;; f2_0 (define f2_4 (list-ref (entity:faces b2) 4)) ;; f2_4 (define f2_5 (list-ref (entity:faces b2) 5)) ;; f2_5 (bool:start b1 b2) ;; #t (bool:sel-intersect (list f1_1 f1_2 f1_3 f1_1 f1_2 f1_3 f1_1 f1_2 f1_3) (list f2_0 f2_0 f2_0 f2_4 f2_4 f2_4 f2_5 f2_5 f2_5)) ;; #[entity 132 1] (bool:complete "UNION") ;; #[entity 118 1] |
[Top]
tool-body | body |
blank-body | body |
acis-opts | acis-options |
Description
The current intersection graph is imprinted on both bodies. Faces are split.
; bool:complete-imprint ; Create two blocks b1 and b2 (define b1 (solid:block 0 0 0 10 10 10)) ;; b1 (define b2 (solid:block -1 -1 -1 9 9 9)) ;; b2 ; Color for b1. (entity:set-color b1 1) ;; () ; Color for b2 (entity:set-color b2 4) ;; () (define f1_1 (list-ref (entity:faces b1) 1)) ;; f1_1 (define f1_2 (list-ref (entity:faces b1) 2)) ;; f1_2 (define f1_3 (list-ref (entity:faces b1) 3)) ;; f1_3 (define f2_0 (list-ref (entity:faces b2) 0)) ;; f2_0 (define f2_4 (list-ref (entity:faces b2) 4)) ;; f2_4 (define f2_5 (list-ref (entity:faces b2) 5)) ;; f2_5 (bool:start b1 b2) ;; #t (bool:sel-intersect (list f1_1 f1_1 f1_1 f1_2 f1_2 f1_2 f1_3 f1_3 f1_3) (list f2_0 f2_4 f2_5 f2_0 f2_4 f2_5 f2_0 f2_4 f2_5)) ;; #[entity 15 1] ; Complete the imprint. (bool:complete-imprint b1 b2) ;; #t ; Separate the bodies to see the result. (entity:transform b1 (transform:translation (gvector 10 10 10))) ;; #[entity 1 1] ; Rebuild the graphic display. (render:rebuild) ;; () |
[Top]
tool-body | body |
blank-body | body |
acis-opts | acis-options |
Description
This routine imprints the bodies and then stitches them along the face-face
intersection curves (imprint edges). It gives the same result as imprinting the
two bodies and then stitching them but is faster because the imprint edges are
saved and used directly, instead of detecting compatible edges anew in stitch.
Face normals and coedge senses need not be compatible for attempted stitching
of open solid-bounding shells along edges.
; bool:complete-imprint-stitch ; Create a solid block (define b1(solid:block (position -20 -20 -20) (position 20 20 20))) ;; b1 (define faces (entity:faces b1)) ;; faces ; Make a hole in the block. (define uncover (face:uncover (list-ref faces 5))) ;; uncover (define b2 (entity:copy b1)) ;; b2 (entity:transform b2 (transform:rotation (position 0 0 0) (gvector 0 0 1) 180)) ;; #[entity 8 1] (entity:transform b2 (transform:translation (gvector 40 0 0))) ;; #[entity 8 1] (bool:start b2 b1) ;; #t (define f_1_0 (list-ref (entity:faces b1) 0)) ;; f_1_0 (define f_1_1 (list-ref (entity:faces b1) 1)) ;; f_1_1 (define f_1_2 (list-ref (entity:faces b1) 2)) ;; f_1_2 (define f_1_4 (list-ref (entity:faces b1) 4)) ;; f_1_4 (define f_2_0 (list-ref (entity:faces b2) 0)) ;; f_2_0 (define f_2_1 (list-ref (entity:faces b2) 1)) ;; f_2_1 (define f_2_2 (list-ref (entity:faces b2) 2)) ;; f_2_2 (define f_2_4 (list-ref (entity:faces b2) 4)) ;; f_2_4 ; Perform the local intersections. (bool:sel-intersect (list f_2_0 f_2_2 f_2_4 f_2_0 f_2_1 f_2_4 f_2_1 f_2_2 f_2_4 f_2_0 f_2_1 f_2_2) (list f_1_0 f_1_0 f_1_0 f_1_2 f_1_2 f_1_2 f_1_1 f_1_1 f_1_1 f_1_4 f_1_4 f_1_4)) ;; #[entity 14 1] ; Complete the imprint stitch. (bool:complete-imprint-stitch b2 b1) ;; #t ; Rebuild the graphic display. (render:rebuild) ;; () |
[Top]
tool-body | body |
blank-body | body |
acis-opts | acis-options |
Description
Completes the slice between two bodies containing Boolean attributes and ready
to be imprinted. Use in conjunction with bool:start
and bool:sel-intersect. The
intersection graph is returned as a specialized wire body.
; bool:complete-inter-graph (part:clear) ;; #t ; Create a body to slice. (define b1 (solid:block -10 -10 -10 10 10 30)) ;; b1 (define b2 (solid:block -10 -10 0 5 5 10)) ;; b2 (solid:subtract b1 b2) ;; #[entity 2270 1] (define c1 (solid:cylinder 0 0 -20 0 0 50 1)) ;; c1 (entity:set-color b1 1) ;; () (entity:set-color c1 1) ;; () ; Initialize the operation. (bool:start c1 b1) ;; #t ; Define all the faces to intersect. (define f_b_0 (list-ref (entity:faces b1) 0)) ;; f_b_0 (define f_b_1 (list-ref (entity:faces b1) 1)) ;; f_b_1 (define f_t (list-ref (entity:faces c1) 0)) ;; f_t ; Selectively intersect the chosen faces. (bool:sel-intersect (list f_t f_t) (list f_b_0 f_b_1)) ; Now return the slice. (define slice (bool:complete-inter-graph c1 b1)) ;; slice |
[Top]
tool-body | body |
blank-body | body |
acis-ops | acis-options |
Description
Completes the slice between two bodies. Returns a wire body designed for
general use. It does not contain any Boolean attributes.
; bool:complete-slice (part:clear) ;; #t ; Create a body to slice. (define b1 (solid:block -10 -10 -10 10 10 30)) ;; b1 (define b2 (solid:block -10 -10 0 5 5 10)) ;; b2 (solid:subtract b1 b2) ;; #[entity 2270 1] (define c1 (solid:cylinder 0 0 -20 0 0 50 1)) ;; c1 (entity:set-color b1 1) ;; () (entity:set-color c1 1) ;; () ; Initialize the operation. (bool:start c1 b1) ;; #t ; Define all the faces to intersect. (define f_b_0 (list-ref (entity:faces b1) 0)) ;; f_b_0 (define f_b_1 (list-ref (entity:faces b1) 1)) ;; f_b_1 (define f_t (list-ref (entity:faces c1) 0)) ;; f_t ; Selectively intersect the chosen faces. (bool:sel-intersect (list f_t f_t) (list f_b_0 f_b_1)) ; Now return the slice. (define slice (bool:complete-slice c1 b1)) ;; slice |
[Top]
wire | wire |
body | body | face | (face ...) |
tol | real |
acis-opts | acis-options |
Description
Embeds the given wire in the faces of another body. This is done with the
assumption that the wire lies exactly in the faces of the other body to within
the specified tolerance, i.e. if a wire edge meets the interior of a face, then
the edge is coincident with the surface of that face to within the given
tolerance. Edges intended to split a face must intersect with the face edges to
within the specified tolerance.
If the wire is not coincident everywhere with the other body to within the
specified tolerance, the results are undefined. A tolerance of less than
SPAresabs will be ignored and treated as
SPAresabs. If a tolerance is used, tolerant geometry may be
introduced.
If the whole body is specified, then it is assumed that each edge of the wire is coincident with every face that it comes into contact with. If the wire does come into contact with faces that should not be involved in the embedding, then the caller must supply a list excluding those faces. Particular care should be taken when a wire is coincident up to the boundary of one face but it is not coincident with the adjacent face.
Note that we actually imprint the intersection graph on "both" entities, so the given wire, for example, might acquire extra vertices where it crosses face boundaries.
Arguments; bool:embed-wire ; Create a solid block (define b (solid:block (position -30 -30 -30) (position 30 30 30))) ;; b ; Create a wire body from an edge. (define lin (edge:linear (position -40 -30 -10) (position 40 -30 10))) ;; lin (define w (wire-body lin)) ;; w ; Embed the wire in the block (bool:embed-wire w b) ;; #t (entity:check b) ;; checked: ;; 1 lumps ;; 1 shells ;; 0 wires ;; 7 faces ;; 7 loops ;; 30 coedges ;; 15 edges ;; 10 vertices ;; () |
[Top]
body1 | body |
body2 | body |
faces1 | face | (face ...) |
faces2 | face | (face ...) |
glue-opts | glue-options |
name-of-option | string |
value | boolean |
keep-opt | string |
acis-opts | acis-options |
Description
This extension performs a Boolean subtract operation on two bodies in the
special case where the intersection graph (see solid:slice)
lies precisely on a set of overlapping, coincident faces, and neither body
penetrates the faces of the other body.
This operation is designed to increase performance over the general Boolean operation, bool:subtract.
Two faces are coincident if the intersection of their interior point sets is non-empty and bounded by the edges of either face, and on this overlap, their surface geometries are coincident.
The glue operation performs only those face-face intersections deemed necessary by the list of pair-wise coincident faces, faces1 and faces2, of body1 and body2 respectively. There is no verification that each pair of faces is, indeed, coincident, so it is essential that these lists are accurate and complete.
Refer to glue:options for information on the options designed to enhance performance. The options may be specified directly or in a Scheme object.
; bool:glue-subtract (define block1 (solid:block (position -20 -20 -20) (position 20 25 25))) ;; block1 (define block2 (solid:block (position 0 -20 -10) (position 20 0 10))) ;; block2 (define faces1 (entity:faces block1)) ;; faces1 (define faces2 (entity:faces block2)) ;; faces2 ; Pick out the coincident faces (define f12 (list-ref faces1 2)) ;; f12 (define f15 (list-ref faces1 5)) ;; f15 (define f22 (list-ref faces2 2)) ;; f22 (define f25 (list-ref faces2 5)) ;; f25 ; change highlight color for images (env:set-highlight-color 1) ;; () ; Highlight each face pair to see they are coincident (entity:set-highlight (list f12 f22) #t) ;; (#[entity 20 1] #[entity 26 1]) (entity:set-highlight (list f15 f25) #t) ;; (#[entity 23 1] #[entity 29 1]) ; OUTPUT Original ; Define a glue options object for a subtract ; operation. ; "patch_and_face_cover" can be set to #t because f12 covers ; f22 and f15 covers f25. ; "blank_patches_strict_cover" can be set to #t because ; the patch consisting of f12 and f15 strictly covers ; the patch consisting of f22 and f25. The boundary ; edges of the smaller patch (f22 and f25) do not ; touch the boundary edges of the larger patch ; (f12 and f15). "non_trivial" can be set to #t because ; block2 lies inside block1. (define g (glue:options "patch_and_face_cover" #t "blank_patches_strict_cover" #t "non_trivial" #t)) ;; g (define glue-result (bool:glue-subtract block1 block2 (list f12 f15) (list f22 f25) g)) ;; glue-result (entity:check glue-result) ;checked: ; 1 lumps ; 1 shells ; 0 wires ; 10 faces ; 10 loops ; 48 coedges ; 24 edges ; 16 vertices ;; () ; OUTPUT Result |
[Top]
body1 | body |
body2 | body |
faces1 | face | (face ...) |
faces2 | face | (face ...) |
glue-opts | glue-options |
name-of-option | string |
value | boolean |
acis-opts | acis-options |
Description
This extension performs the first step of a Boolean subtract operation on two
bodies in the special case where the intersection graph (see
solid:slice) lies precisely on a set of overlapping,
coincident faces, and neither body penetrates the faces of the other body.
This operation is designed to increase performance over the general computation of a Boolean operation intersection graph, solid:inter-graph.
Two faces are coincident if the intersection of their interior point sets is non-empty and bounded by the edges of either face, and on this overlap, their surface geometries are coincident.
The glue operation performs only those face-face intersections deemed necessary by the list of pair-wise coincident faces, faces1 and faces2, of body1 and body2 respectively. There is no verification that each pair of faces is, indeed, coincident, so it is essential that these lists are accurate and complete.
Refer to glue:options for information on the options designed to enhance performance. The options may be specified directly or in a Scheme object.
; bool:glue-subtract-inter-graph ; Create the entities (define block1 (solid:block (position -20 -20 -20) (position 20 25 25))) ;; block1 (define block2 (solid:block (position -10 -20 15) (position 10 15 25))) ;; block2 (define faces1 (entity:faces block1)) ;; faces1 (define faces2 (entity:faces block2)) ;; faces2 (define f10 (list-ref faces1 0)) ;; f10 (define f12 (list-ref faces1 2)) ;; f12 (define f20 (list-ref faces2 0)) ;; f20 (define f22 (list-ref faces2 2)) ;; f22 (env:set-highlight-color 1) ;; () (entity:set-highlight (list f10 f20) #t) ;; (#[entity 3 1] #[entity 9 1]) (entity:set-highlight (list f12 f22) #t) ;; (#[entity 5 1] #[entity 11 1]) (define glue-opts (glue:options "patch_and_face_cover" #t "blank_patches_strict_cover" #t "non_trivial" #t)) ;; glue-opts (bool:start block1 block2) ;; #t (bool:glue-subtract-inter-graph block1 block2 (list f10 f12) (list f20 f22) glue-opts) ;; #[entity 30 1] (bool:complete "SUBTRACTION") ;; #[entity 1 1] (entity:check block1 70) ;; checked: ;; 1 lumps ;; 1 shells ;; 0 wires ;; 10 faces ;; 10 loops ;; 48 coedges ;; 24 edges ;; 16 vertices ;; () |
[Top]
body1 | body |
body2 | body |
faces1 | face | (face ...) |
faces2 | face | (face ...) |
glue-opts | glue-options |
name-of-option | string |
value | boolean |
keep-opt | string |
acis-opts | acis-options |
Description
This extension performs a Boolean unite operation on two bodies in the special
case where the intersection graph (see solid:slice)
lies precisely on a set of overlapping, coincident faces, and neither body
penetrates the faces of the other body. This operation is designed to
increase performance over the general Boolean operation,
bool:unite.
Intuitively, this operation (when non-trivial) can be viewed as gluing two solid objects together by pasting their coincident faces.
Two faces are coincident if the intersection of their interior point sets is non-empty and bounded by the edges of either face, and on this overlap, their surface geometries are coincident.
The glue operation performs only those face-face intersections deemed necessary by the lists of pair-wise coincident faces, faces1 and faces2, of body1 and body2 respectively. It is essential that the lists are accurate and complete because there is no verification that each pair of faces is coincident.
Refer to glue:options for information on the options designed to enhance performance. The options may be specified directly or in a Scheme object.
; Example 1 (part:clear) ;; #t ; bool:glue-unite ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 25 25))) ;; block1 ; Create a second solid block to glue to the first. (define block2 (solid:block (position -15 -30 -15) (position 15 -20 20))) ;; block2 ; Retrieve the list of faces for each body (define faces1 (entity:faces block1)) ;; faces1 (define faces2 (entity:faces block2)) ;; faces2 ; Pick out the coincident faces on each body (define f12 (list-ref faces1 2)) ;; f12 (define f24 (list-ref faces2 4)) ;; f24 (env:set-highlight-color 1) ;; () ; Highlight the face pair to see they are coincident (entity:set-highlight (list f12 f24) #t) ;; (#[entity 6 1] #[entity 14 1]) ; OUTPUT Original ; Now create a glue options object. ; patch_and_face_cover can be set to #t because ; f12 covers f24. blank_patches_strict_cover can be ; set to #t because the boundary edges of f24 do not ; touch the boundary edges of f12. non_trivial can be ; set to #t because block2 lies outside of block1. (define glue-opts (glue:options "patch_and_face_cover" #t "blank_patches_strict_cover" #t "non_trivial" #t)) ;; glue-opts ; Perform a glue unite (define glue-result (bool:glue-unite block1 block2 (list f12) (list f24) glue-opts)) ;; glue-result (part:clear) ;; #t (define block1 (solid:block (position -20 -20 -20) (position 20 25 25))) ;; block1 (define block2 (solid:block (position -10 -10 25) (position 30 10 35))) ;; block2 (define faces1 (entity:faces block1)) ;; faces1 (define faces2 (entity:faces block2)) ;; faces2 ; Pick out the coincident faces (define f10 (list-ref faces1 0)) ;; f10 (define f21 (list-ref faces2 1)) ;; f21 ; Highlight the face pair to see they are coincident (entity:set-highlight (list f10 f21) #t) ;; (#[entity 18 1] #[entity 25 1]) ; OUTPUT Original ; Define a glue options object for a unite operation. ; patch_and_face_cover cannot be set to #t because f10 ; does not cover f21 and f21 does not cover f10. ; blank_patches_strict_cover cannot be set to #t ; because patch_and_face_cover is not set to #t. ; non_trivial can be set to #t because the bodies ; lie outside one another. (define g (glue:options "non_trivial" #t)) ;; g ; g => #[Glue_Options patch_and_face_cover -1 ; blank_patches_strict_cover -1 non_trivial 1] (define glue-result (bool:glue-unite block1 block2 (list f10) (list f21) g)) ;; glue-result (entity:check glue-result) ; checked: ; 1 lumps ; 1 shells ; 0 wires ; 12 faces ; 12 loops ; 56 coedges ; 28 edges ; 18 vertices ;; () ; OUTPUT Result |
[Top]
body1 | body |
body2 | body |
faces1 | face | (face ...) |
faces2 | face | (face ...) |
glue-opts | glue-options |
name-of-option | string |
value | boolean |
acis-opts | acis-options |
Description
This extension performs the first step of the Boolean unite operation on two
bodies in the special case where the intersection graph (see
solid:slice) lies precisely on a set of overlapping,
coincident faces, and neither body penetrates the faces of the other body.
This operation is designed to increase performance over the general computation of a Boolean operation intersection graph, solid:inter-graph.
Intuitively, this operation (when non-trivial) can be viewed as gluing two solid objects together by pasting their coincident faces.
Two faces are coincident if the intersection of their interior point sets is non-empty and bounded by the edges of either face, and on this overlap, their surface geometries are coincident.
The glue operation performs only those face-face intersections deemed necessary by the lists of pair-wise coincident faces, faces1 and faces2, of body1 and body2 respectively. It is essential that the lists are accurate and complete because there is no verification that each pair of faces is coincident.
Refer to glue:options for information on the options designed to enhance performance. The options may be specified directly or in a Scheme object.
; bool:glue-unite-inter-graph ; Create the entities (define block1 (solid:block (position -10 -10 25) (position 35 10 35))) ;; block1 (define block2 (solid:block (position 20 -10 15) (position 35 10 25))) ;; block2 (define faces1 (entity:faces block1)) ;; faces1 (define faces2 (entity:faces block2)) ;; faces2 (define f11 (list-ref faces1 1)) ;; f11 (define f20 (list-ref faces2 0)) ;; f20 (env:set-highlight-color 1) ;; () (entity:set-highlight (list f11 f20) #t) ;; (#[entity 18 1] #[entity 23 1]) (define g (glue:options "non_trivial" #t)) ;; g (bool:start block1 block2) ;; #t (bool:glue-unite-inter-graph block1 block2 (list f11) (list f20) g) ;; (bool:complete UNION) ;; #[entity 15 1] (entity:check block1 70) |
[Top]
body1 | body |
bodyn | body |
keep-opt | string |
bool-opts | Bool_Options |
acis-opts | acis-options |
Description
This extension intersects two or more bodies. The resulting body is the space
that is inside or on all of the input bodies. By default, the result of the
intersection is returned as
body1
and all other bodies are deleted.
This extension performs a regularized intersection. Any faces, edges, and/or vertices not needed to support the topology of the intersection are removed before returning the resulting body.
; bool:intersect ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 20 20 20))) ;; block1 ; Create a solid sphere. (define sphere1 (solid:sphere (position 0 0 0) 20)) ;; sphere1 ; OUTPUT Original ; Intersect the block with the sphere. (define intersect (bool:intersect block1 sphere1)) ;; intersect ; OUTPUT Result |
[Top]
edgelist | edge | (edge ...) |
joinC1 | boolean |
acis-opts | acis-options |
Description
This extension takes a list of edges in a body and attempts to join them into a
single edge even if the underlying geometries of the edges are different. Edges
must meet end to end in a tangent continuous fashion, and only two edges should
meet at each "interior" vertex.
; bool:join-edges ; Create/build geometry to demonstrate command. ; Create 3 edges. (define edge1 (edge:linear (position 0 0 0) (position 50 0 0) )) ;; edge1 (define edge2 (edge:circular (position 50 25 0) 25 -90 90)) ;; edge2 (define edge3 (edge:linear (position 50 50 0) (position 0 50 0))) ;; edge3 ; Create a wire body that includes all three edges. (define w (wire-body (list edge1 edge2 edge3))) ;; w (length (entity:edges w)) ;; 3 ; Find the edges of the wire body. (define getedges (entity:edges w)) ;; getedges ; Join the edges into a single edge. (define join (bool:join-edges getedges)) ;; join (length (entity:edges w)) ;; 1 |
[Top]
entity | entity |
acis-opts | acis-options |
Description
Checks the geometric definitions of a body, face, or edge and merges adjacent
faces when they have an equivalent definition. Faces are merged if they are
adjacent, have equivalent geometry, and have the same sense. Faces are merged
by removing edges. Edges may be removed if they have the same surface on either
side of the edge. A vertex may be removed if all of its associated edges are
removed, if it separates edges which have the same geometrical support, and if
it is not needed to define an end point of another edge.
Note: Vertices on spline edges will not be merged unless the option merge_spline_vertex is turned on.
; bool:merge ; Create a planar face. (define plane1 (face:plane (position -20 -40 0) 40 60)) ;; plane1 ; Set the color of plane1. (entity:set-color plane1 2) ;; () ; Create another planar face. (define plane2 (face:plane (position -20 -40 0) 60 40)) ;; plane2 ; Set the color of plane2. (entity:set-color plane2 3) ;; () ; OUTPUT Original ; Define a surface from the 2 planes. (define one-surf (bool:nonreg-unite (sheet:face plane1) (sheet:face plane2))) ;; one-surf ; Use merge to remove unnecessary faces/edges. (define merge (bool:merge one-surf)) ;; merge ; OUTPUT Result |
[Top]
body | body |
type | string |
acis-opts | acis-options |
Description
Merge faces selectively by geometry type. The valid types are plane, cone,
cylinder, sphere and torus.
Checks the geometric definitions of a face and merges adjacent faces when they
have an equivalent definition. Faces are merged if they are adjacent, have
equivalent geometry, and have the same sense. Faces are merged by removing
edges. Edges may be removed if they have the same surface on either side of the
edge. A vertex may be removed if all of its associated edges are removed, if it
separates edges which have the same geometrical support, and if it is not
needed to define an end point of another edge.
; bool:merge-faces ; Create a solid block. (define block1 (solid:block (position -30 -30 -30) (position 10 10 10))) ;; block1 ; Create another solid block. (define block2 (solid:block (position -10 -10 -30) (position 30 30 10))) ;; block2 (define zoom (zoom-all)) ;; zoom ; OUTPUT Two Blocks ; Imprint the two bodies. (define imprint (solid:imprint block1 block2)) ;; imprint ; Remove one entity to see the imprint lines. (define delete (entity:delete block2)) ;; delete ; OUTPUT Imprint ; Use merge to remove unnecessary edges. (define merge (bool:merge-faces block1 "plane")) ;; merge ; OUTPUT Merged Faces |
[Top]
entity-list | list of entities |
acis-opts | acis-options |
; bool:merge-list ; Construct a body containing mergeable edges. (define by (solid:block (position -20 -20 -22) (position 20 20 0))) ;; by (define bi (solid:block (position -1 -1 -1) (position 1 1 1))) ;; bi (entity:move bi -1 -1 0) ;; #[entity 2 1] (bool:nonreg-unite bi (entity:move (entity:copy bi) 0 2 0)) ;; #[entity 2 1] (bool:nonreg-unite bi (entity:move (entity:copy bi) 2 0 0)) ;; #[entity 2 1] (bool:nonreg-unite bi (entity:move (entity:copy bi) 4 0 0)) ;; #[entity 2 1] (solid:imprint by bi) ;; #t (entity:delete bi) ;; () ; Pick two faces which share an edge. (ray:queue -1 1 1 0 0 -1 1) ;; #[ray (-1 1 1) (0 0 -1)] (define fa1 (pick-face)) ;; fa1 (ray:queue 1 1 1 0 0 -1 1) ;; #[ray (1 1 1) (0 0 -1)] (define fa2 (pick-face)) ;; fa2 ; bool:merge-list merges the edge common to the given pair of faces. (bool:merge-list (list fa1 fa2)) ;; () |
Figure. bool:merge-list
[Top]
body1 | body |
body2 | body |
keep-leftovers | boolean |
keep-opt | string |
bool-opts | Bool_Options |
acis-opts | acis-options |
Description
This extension chops the blank body (body1)
with the tool body (body2). The
returned list contains the result of intersecting the two bodies, the result of
subtracting
body2
from
body1, and (possibly) a body containing
any leftovers. None of these resulting bodies are regularized. Either of the
first two bodies returned may be empty. Leftovers can only exist if the tool
body is incomplete. If there is a body containing leftovers, the
keep-leftovers
argument controls whether it is deleted or not. If
keep-leftovers
is #f, any leftovers are deleted and the returned list is always of length 2.
If
keep-leftovers
is #t, the returned list is only of length 3 if there are some leftovers (that
is, an empty leftovers body is never returned).
; bool:nonreg-chop ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 25 25))) ;; block1 ; Create another solid block. (define block2 (solid:block (position -5 -20 -30) (position 30 15 35))) ;; block2 ; OUTPUT Original ; Imprint the faces of the two blocks. (define chop (bool:nonreg-chop block1 block2)) ;; chop ; (#[entity 2 1] #[entity 4 1]) (define erase (entity:erase block1)) ;; erase (view:refresh) ;; #[view 1076235512] ; OUTPUT Result |
[Top]
body1 | body |
bodyn | body |
keep-opt | string |
bool-opts | Bool_Options |
acis-opts | acis-options |
Description
This extension intersects two or more bodies. By default, the result of the
intersection is returned as
body1
and all other bodies are deleted. The input body is trimmed to be only
those parts inside or on all of the input bodies.
After the non-regularized intersection, the returned body may still have faces, edges, and/or vertices that are not needed to support the topology. Single-sided faces that become double-sided-both-inside faces, internal faces, and coincident regions are retained as part of the body. This extension does not merge edges or vertices at the end of the Boolean.
; bool:nonreg-intersect ; Create a solid block. (define block1 (solid:block (position -30 -20 0) (position 0 10 30))) ;; block1 ; Set color for block1. (entity:set-color block1 2) ;; () ; Create another solid block. (define block2 (solid:block (position 0 -20 0) (position 30 10 30))) ;; block2 ; Set color for block2. (entity:set-color block2 3) ;; () ; OUTPUT Original ; Nonregularize intersect blocks 1 with 2. (define intersect (bool:nonreg-intersect block1 block2)) ;; intersect ; #[entity 2 1] ; OUTPUT Result |
[Top]
body1 | body |
bodyn | body |
keep-opt | string |
bool-opts | Bool_Options |
acis-opts | acis-options |
Description
This extension subtracts one or more bodies from the first body, and it returns
the result as
body1. The other bodies are deleted.
The optional keep-opt specifies whether some or all input bodies should be
preserved.
This extension performs a non-regularized subtract. The resulting body may have
faces, edges, and/or vertices that are not needed to support the topology.
These are not removed before returning the resulting body.
Single-sided faces that become double-sided-both-inside faces, internal faces, and coincident regions are retained as part of the body. This extension does not merge edges or vertices at the end of the Boolean.
The following example creates two solid blocks that share three common face regions. The Boolean non-regularized subtract removes the smaller cube from the larger cube, leaving a 3D void; however, non-regularized Boolean operations retain coincident regions. The three coincident faces are retained as well. (A regularized subtract would remove these three faces.)
; bool:nonreg-subtract ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 0 0 0))) ;; block1 ; Set color for block1. (entity:set-color block1 2) ;; () ; Create another solid block. (define block2 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block2 ; Set color for block2. (entity:set-color block2 3) ;; () ; OUTPUT Original ; Nonregularize subtract blocks 1 from 2. (define subtract (bool:nonreg-subtract block2 block1)) ;; subtract ; #[entity 3 1] ; OUTPUT Result |
[Top]
body1 | body |
bodyn | body |
keep-opt | string |
bool-opts | Bool_Options |
acis-opts | acis-options |
Description
This extension unites two or more bodies. By default, the result of the unite
is returned as
body1
and the remaining bodies are deleted.
This extension performs a non-regularized unite. The resulting body may have faces, edges, and/or vertices not needed to support the topology. These are not removed before returning the resulting body.
Single-sided faces that become double-sided, both-inside faces, internal faces, and coincident regions are retained as part of the body. This extension does not merge edges or vertices at the end of the Boolean.
; bool:nonreg-unite ; Create a solid block. (define block1 (solid:block (position -30 -20 0) (position 0 10 30))) ;; block1 ; Set color for block1. (entity:set-color block1 2) ;; () ; Create another solid block. (define block2 (solid:block (position 0 -20 0) (position 30 10 30))) ;; block2 ; Set color for block2. (entity:set-color block2 3) ;; () ; OUTPUT Original ; Nonregularize unite blocks 1 and 2 (define unite (bool:nonreg-unite block1 block2)) ;; unite ; #[entity 2 1] ; OUTPUT Result |
[Top]
ncf_value | double |
merge_str | string |
bool-opts | Bool_Options |
Description
These options are designed to provide additional information to the Boolean
operations for improved accuracy and performance. The default value for these
options is set to 0, that is, "unset".
This object can be used to specify a "near coincidence fuzz" value. If this value is set and is greater than resabs, then it is used as a hint to the Boolean that pairs of entities which are coincident to within the fuzz value may be regarded as coincident. The Boolean may then force coincidence by adding tolerances where necessary. Depending on the situation, the fuzz value may be ignored by the Boolean (for instance, if forcing coincidence would result in the creation of bad geometry).
Also, the object can also be used to control whether merging is done by the Boolean ("on | off"), or controlled by a global option ("unset"). In addition, if no merging is carried out, it controls whether information about the entities which would have been considered for merging is retained for later use ("delayed"). This last possibility is intended to allow applications to implement a delayed merge.
Finally, it can also take a pre-existing Bool_Options object to set.
on | merging is performed after the Boolean operation |
off | merging is not performed |
delayed | the Boolean operation does not perform the merge but makes available a list of entities to be considered as candidates for merge |
unset | merging is controlled by the global option "merge", which is the same behavior as in previous versions of ACIS. This is the default. |
; bool:options ;; bool:options ; Create bool:options object (bool:options "near_coi_fuzz" 1.1e-5 "merge_type" "on") ;;#[Bool_Options "near_coi_fuzz" 1.1e-005 "merge_type" bool_merge_on] |
[Top]
entity | entity |
acis-opts | acis-options |
Description
This extension removes single-sided faces that become double-sided- both-inside
faces, internal faces and coincident regions. This extension also merges edges
and vertices.
; bool:regularise ; Create a solid block. (define block1 (solid:block (position -30 -20 0) (position 0 10 30))) ;; block1 ; Create another solid block. (define block2 (solid:block (position 0 -20 0) (position 30 10 30))) ;; block2 ; Nonregularize unite blocks 1 and 2. (define unite (bool:nonreg-unite block1 block2)) ;; unite ; OUTPUT Original ; Regularize the result. (define reg (bool:regularise block1)) ;; reg ; OUTPUT Result |
[Top]
entity | entity |
edge | edge |
tol | tol |
split_on_intersections | split_on_intersections |
acis-opts | acis-options |
Description
This extension scribes an edge in the faces of another body or a wire body.
; Create a series of edges (define ed1 (edge:linear (position -10 -10 0) (position -10 10 0))) (define ed2 (edge:linear (position -10 10 0) (position 10 10 0))) (define ed3 (edge:linear (position 10 10 0) (position 10 -10 0))) (define ed4 (edge:linear (position 10 -10 0) (position -10 -10 0))) ; Create a wire body from the first edge (define wire (wire-body ed1)) ; Add the remaining edges to the body to create a wire body with 4 edges (bool:scribe wire ed2 -1 #f) (bool:scribe wire ed3 -1 #f) (bool:scribe wire ed4 -1 #f) (length (entity:edges wire)) (part:clear) ; Create a single-face body and get its face (define blk (solid:block (position -20 -20 0) (position 20 20 0))) (define face (car (entity:faces blk))) ; Create a series of edges (define ed1 (edge:linear (position -10 -10 0) (position -10 10 0))) (define ed2 (edge:linear (position -10 10 0) (position 10 10 0))) (define ed3 (edge:linear (position 10 10 0) (position 10 -10 0))) (define ed4 (edge:linear (position 10 -10 0) (position -10 -10 0))) ; Imprint a closed loop of edges into the face to create a new face (bool:scribe face ed1) (bool:scribe face ed2) (bool:scribe face ed3) (bool:scribe face ed4) (length (entity:faces blk)) |
[Top]
tool-body-or-faces | body | face | (face ...) |
blank-body-or-faces | body | face | (face ...) |
split-check | boolean |
acis-opts | acis-options |
Description
This extension imprints the intersection graph of a set of faces on the tool
body and a set of faces on the blank body onto both bodies. If every face of
one body is to be used, that body may be supplied instead of a list of faces.
When split-check is true, additional checks are performed to ensure that all edges and vertices imprinted on the blank body contribute to the proper splitting of faces in the blank body. If they do not (for example, there are dangling edges imprinted on the faces), then an error is thrown. To allow the imprint to succeed in such a case, the split-check flag should be set to #f.
; bool:sel-imprint ; Create a blank body (define block1 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block1 ; Create a tool body (define block2 (solid:block (position -40 -5 -20) (position 40 5 25))) ;; block2 (iso) ;; #[view 16450392] ; Pick a face to imprint. (define faces (entity:faces block1)) ;; faces (define face (list-ref faces 3)) ;; face (entity:set-color face 3) ;; () ; OUTPUT Original (define imprint (bool:sel-imprint block2 face)) ;; imprint ; OUTPUT Result |
[Top]
tool-faces | (face ...) |
blank-faces | (face ...) |
acis-opts | acis-options |
Description
Given faces (tf-0, tf-1 ...) of a tool body and faces (bf-0, bf-1 ...) of a
blank body, this extension intersects tf-i with bf-i (where i = 0, 1, 2...).
Note: bool:start must be called before calling bool:sel-intersect, in order to prepare the intersection graph.
; bool:sel-intersect ; Create a tool body (define b1 (solid:block 0 0 0 10 10 10)) ;; b1 ; Create a blank body (define b2 (solid:block -5 -5 -5 5 5 5)) ;; b2 ; Define faces from tool and blank bodies. (define f1_1 (list-ref (entity:faces b1) 1)) ;; f1_1 (define f1_2 (list-ref (entity:faces b1) 2)) ;; f1_2 (define f1_3 (list-ref (entity:faces b1) 3)) ;; f1_3 (define f2_0 (list-ref (entity:faces b2) 0)) ;; f2_0 (define f2_4 (list-ref (entity:faces b2) 4)) ;; f2_4 (define f2_5 (list-ref (entity:faces b2) 5)) ;; f2_5 (bool:start b1 b2) ;; #t (bool:sel-intersect (list f1_1 f1_2 f1_3 f1_1 f1_2 f1_3 f1_1 f1_2 f1_3) (list f2_0 f2_0 f2_0 f2_4 f2_4 f2_4 f2_5 f2_5 f2_5)) ;; #[entity 132 1] (bool:complete "UNION") ;; #[entity 118 1] |
[Top]
tool-body | body |
blank-body | body |
acis-opts | acis-options |
Description
Used in conjunction with bool:sel-intersect and
bool:complete.
; bool:start ; Create a tool body (define b1 (solid:block 0 0 0 10 10 10)) ;; b1 ; Create a blank body (define b2 (solid:block -5 -5 -5 5 5 5)) ;; b2 ; Define faces from tool and blank bodies. (define f1_1 (list-ref (entity:faces b1) 1)) ;; f1_1 (define f1_2 (list-ref (entity:faces b1) 2)) ;; f1_2 (define f1_3 (list-ref (entity:faces b1) 3)) ;; f1_3 (define f2_0 (list-ref (entity:faces b2) 0)) ;; f2_0 (define f2_4 (list-ref (entity:faces b2) 4)) ;; f2_4 (define f2_5 (list-ref (entity:faces b2) 5)) ;; f2_5 (bool:start b1 b2) ;; #t (bool:sel-intersect (list f1_1 f1_2 f1_3 f1_1 f1_2 f1_3 f1_1 f1_2 f1_3) (list f2_0 f2_0 f2_0 f2_4 f2_4 f2_4 f2_5 f2_5 f2_5)) ;; #[entity 132 1] (bool:complete "UNION") ;; #[entity 118 1] |
[Top]
body1 | body |
bodyn | body |
keep-opt | string |
bool-opts | Bool_Options |
acis-opts | acis-options |
Description
This extension subtracts one or more bodies from the first body. By default,
the result of the subtract is returned as body1 and the remaining bodies
are deleted.
The optional
keep-opt
specifies whether some or all input bodies should be preserved.
This extension performs a regularized subtraction. Any faces, edges, and/or
vertices not needed to support the topology are removed before returning the
resulting body.
; bool:subtract ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 0 0 0))) ;; block1 ; Set color for block1. (entity:set-color block1 2) ;; () ; Create another solid block. (define block2 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block2 ; Set color for block2. (entity:set-color block2 3) ;; () ; OUTPUT Original ; Subtract solid blocks 1 from 2. (define subtract (bool:subtract block2 block1)) ;; subtract ; #[entity 3 1] ; OUTPUT Result |
[Top]
faces | face | (face ...) |
trim | string |
acis-opts | acis-options |
Description
Trims each input face in the following way:
If the surface on which this face lies is parametric, trim it back to the face boundaries. Whether the trimming is done by subsetting or by splitting the surface is controlled by the "trim" parameter, which specifies which surface types should be subset rather than split. This Scheme extension only affects spline or torus surfaces, and only splines can be split, so the following trim options are available:
"all" | subset both spline and tori, ignore all others |
"spline" | subset splines only, ignore all other types |
"torus" | subset tori only, split splines, ignore all others |
"none" | do not subset any surface type, split splines |
If any surface is not subsetted, it will be split explicitly. Any surface other than a spline or torus remains as is.
; bool:trim-faces ; create solid block. (define b (solid:block (position 0 0 0) (position -10 -10 -10))) ;; b ; Trim the surfaces of the defined faces. (define trim (bool:trim-faces (entity:faces b) "none")) ;; trim |
[Top]
body1 | body |
bodyn | body |
keep-opt | string |
bool-opts | Bool_Options |
acis-opts | acis-options |
Description
This extension unites two or more bodies. By default, the result of the unite
is returned as
body1
and the remaining bodies are deleted.
This extension checks for overlapping bodies. If it is known that the bodies do not overlap, use body:combine, because it does not perform intersection checks. If it is known that the bodies overlap, or if there is some uncertainty as to whether the bodies overlap, use bool:unite.
This extension performs a regularized unite. Any faces, edges, and/or vertices not needed to support the topology are removed before returning the resulting body.
"keep_blank" preserves body1 and returns the
result of the unite as a new body.
"keep_tool" preserves body2 ... bodyn.
"keep_both" preserves all input bodies and returns the result of the unite as a
new body.
; bool:unite ; Create a solid block. (define block1 (solid:block (position 30 10 20) (position -30 -10 -20))) ;; block1 ; Set color for block1. (entity:set-color block1 2) ;; () ; Create a solid cylinder. (define cyl2 (solid:cylinder (position 20 0 -20) (position 20 0 20) 20)) ;; cyl2 ; Set color for cyl2. (entity:set-color cyl2 3) ;; () ; OUTPUT Original ; Unite the block and cylinder (define unite (bool:unite block1 cyl2)) ;; unite ; #[entity 2 1] ; OUTPUT Result |
[Top]
blank | body |
tool | body |
acis-opts | acis-options |
Description
This Scheme command unites the wires of the tool body with the wires of the
blank body where they meet at common vertices. The result is the blank body.
The tool body is deleted.
; bool:unite-wires ; Create a tool body (define t (wire-body:points (list (position 0 0 0) (position 1 0 0) (position 1 1 0) (position 0 1 0)))) ;; t ; Create a blank body (define b (wire-body:points (list (position 1 1 0) (position 1 1 1) (position 1 2 1) (position 1 2 0)))) ;; b ; Unite the wires of both the bodies (bool:unite-wires b t) ; OUTPUT Result |
[Top]
tool-face | face |
ttransf | transform |
blank-face | face |
btransf | transform |
int-edges | (edge ...) |
check-rels | boolean |
acis-opts | acis-options |
Description
This routine is passed a tool face and blank face together with a list of edges, which represent the intersection of the two faces. A surf_surf_int structure is built using the geometry of these edges as the intersection of the two surfaces, thereby eliminating the need to intersect the faces themselves. To record this, an ATTRIB_FACEINT is attached to the tool face and no intersection will be performed when these faces are to be intersected
; bool:update-intersection (part:clear) ;; #t ; create solid blocks. (define b1 (solid:block 0 0 0 10 10 10)) ;; b1 (define b2 (solid:block -10 -10 -10 20 20 0)) ;; b2 ; Fix transforms (entity:fix-transform b1) ;; #[entity 28 1] (entity:fix-transform b2) ;; #[entity 29 1] (define f1_1 (list-ref (entity:faces b1) 1)) ;; f1_1 (define f1_2 (list-ref (entity:faces b1) 2)) ;; f1_2 (define f1_3 (list-ref (entity:faces b1) 3)) ;; f1_3 (define f1_4 (list-ref (entity:faces b1) 4)) ;; f1_4 (define f1_5 (list-ref (entity:faces b1) 5)) ;; f1_5 (define f2_0 (list-ref (entity:faces b2) 0)) ;; f2_0 ; Initializes the Boolean operation. (bool:start b1 b2) ;; #t ; Set the intersection records. (bool:update-intersection f1_1 f2_0 (entity:edges f1_1)) ;; #t (bool:update-intersection f1_2 f2_0 (cadr (entity:edges f1_2))) ;; #t (bool:update-intersection f1_3 f2_0 (cadr (entity:edges f1_3))) ;; #t (bool:update-intersection f1_4 f2_0 (cadr (entity:edges f1_4))) ;; #t (bool:update-intersection f1_5 f2_0 (cadr (entity:edges f1_5))) ;; #t (bool:sel-intersect (list f1_1 f1_2 f1_3 f1_4 f1_5) (list f2_0 f2_0 f2_0 f2_0 f2_0)) ;; #[entity 54 1] ; Completes the Boolean operation. (bool:complete "UNION") ;; #[entity 28 1] |
[Top]
wire | [edge | wire] |
face-list | (face... ) |
Description
Imprints the given wire or wire edge onto the given face (or faces)
of another. It is assumed that the wire lies exactly in the face (though
the wire might be longer or shorter than the face). If the wire is not
coincident with the face everywhere, the results are undefined.
Note that we actually imprint the intersection graph on both entities, so the given wire might, for example, acquire extra vertices where it crosses face boundaries.
; bool:wifa-imp ; Create a solid block (define b (solid:block (position -30 -30 -30) (position 30 30 30))) ;; b ; Create a wire body from an edge. (define lin (edge:linear (position -30 -30 -10) (position 30 -30 10))) ;; lin (define w (wire-body lin)) ;; w ; Select the face along which the wire body lies. (define fs (entity:faces b)) ;; fs (define f (list-ref fs 2)) ;; f ; Select the wire body's (only) edge. (define es (entity:edges w)) ;; es (define e (car es)) ;; e ; Imprint the edge onto the face. (bool:wifa-imp e f) ;; #t |
[Top]
edge-list | (edge ...) |
acis-opts | acis-options |
Description
This extension removes the
NO_MERGE_ATTRIB attribute from each edge in the input
edge-list.
; edge:remove-no-merge-attrib ; See example for edge:set-no-merge-attrib. |
[Top]
edge-list | (edge ...) |
acis-opts | acis-options |
Description
This extension sets the
NO_MERGE_ATTRIB attribute for each edge in the input
edge-list.
; edge:set-no-merge-attrib ; Create two blocks (define b1 (solid:block (position -10 -10 -10) (position 10 10 10))) ;; b1 (define b2 (solid:block (position 0 0 0 ) (position 10 10 10))) ;; b2 ; Imprint new faces and edges (solid:imprint b1 b2) ;; #t ; Remove one of the bodies for visual purposes (define erase (entity:erase b2)) ;; erase ; #[entity 3 1] ; Pick one of the new imprinted faces (define f1 (pick:face (ray (position 0 1 1) (gvector 1 0 0)) 1)) ;; f1 ; Get the edges of the face (define ed-list (entity:edges f1)) ;; ed-list ; Apply the NO_MERGE_ATTRIB to the face edges. (edge:set-no-merge-attrib ed-list) ;; () ; Merge out the common face and edges. Note that the ; face with the marked edges is not removed by the ; merge command. (define merge1 (bool:merge-faces b1 "plane")) ;; merge1 ; To test this, remove the NO_MERGE_ATTRIB from the ; edges. (edge:remove-no-merge-attrib ed-list) ;; () ; Repeat the merge command. Note that the edges ; now merge. (define merge2 (bool:merge-faces b1 "plane")) ;; merge2 |
[Top]
entity | entity |
refresh-list | (entity ...) |
pattern | pattern |
copy-pattern | boolean |
seed-index | integer |
no-cross-faces | (entity ...) |
check | integer | boolean |
ao | acis-options |
Description
This Scheme extension refreshes the elements of the
pattern
to incorporate changes made to one of them. The
entity
should be taken from the modified element, while
refresh-list
should contain all pattern entities to be refreshed. It should not include
anything from the modified element. By default, a copy of the pattern is made,
and it is the copy that is actually applied to the entity. This behavior can be
overridden by setting
copy-pattern
to FALSE. However, when copying is overridden and
pattern
is shared by multiple bodies, a transform placed upon the bodies is transferred
to the pattern multiple times, which is clearly undesirable. Also by default,
entity
is associated with the first pattern element (index 0), but it may be
associated with another element by furnishing the associated zero-based
seed-index.
For cases in which the pattern is applied to a bump on a substrate rather than to an autonomous entity, the limits of the bump are automatically computed, but the user may choose to override the default limits by furnishing a list of no-cross-faces.
For performance reasons, the extension does not check the generated pattern of
entities for intersection, containment, or compatibility unless the user sets
the flag
check.
When set to 1 (or #t), the operation will be undone if the resulting body is
invalid.
When set to 2, the invalid pattern elements are automatically dropped (if
necessary), and a valid body made from the valid elements.
A value of 0 (or #f) yields the default behavior.
; entity:refresh-pattern ; Create a body (define body (solid:block (position 0 0 0) (position 10 10 10))) ;; body ; Create a pattern. (define pat (pattern:linear (gvector 20 0 0) 4)) ;; pat ; Apply the pattern to the body. (define apply (entity:pattern body pat)) ;; apply ; Blend an edge. (define edge (list-ref (entity:edges body) 15)) ;; edge (define chamfer (blend:chamfer-on-edge (list edge) 5)) ;; chamfer (define fix (blend:fix edge)) ;; fix ; Refresh the pattern. (define lump_list (entity:lumps body)) ;; lump_list (define seed_lump (list-ref lump_list 1)) ;; seed_lump (define refresh_list (list (list-ref lump_list 0) (list-ref lump_list 2) (list-ref lump_list 3))) ;; refresh_list (define refresh (entity:refresh-pattern seed_lump refresh_list pat #t 1)) ;; refresh |
[Top]
entity | entity |
acis-opts | acis-options |
Description
Creates a new entity which is a spline equivalent of an entity containing
analytic faces, or a spline edge equivalent of an analytic edge. The original
entity must be a body, shell, face or edge.
Note: The option new_periodic_splitting controls how periodic faces are split before converting to a spline, for example, to avoid creating sliver faces. Please see the documentation for this option for further information.
Note: If the input entity is a face and it does not have owner, you must traverse through the entire partner coedges of the output entity (face) to get hold of all faces after spline convert. This is true only for periodic faces. For example, if the input entity is a face and its surface is a complete cylinder, the face splits into two after the spline conversion and you must traverse though the partner coedges of the return entity to get the other face.
; entity:spline-convert ; Example 1 ; Create solid block and blend one edge. (define block1 (solid:block (position 0 0 0) (position 20 20 20))) ;; block1 (define blend (solid:blend-edges (list-ref (entity:edges block1) 3) 3)) ;; blend (map face:spline? (entity:faces block1)) ;; (#f #f #f #f #f #f #f) (define block2 (entity:spline-convert block1)) ;; block2 (map face:spline? (entity:faces block2)) ;; (#t #t #t #t #t #t #t) (part:clear) ;; () ; Example 2 ; Create sphere 1. (define sphere1 (solid:sphere (position 0 0 0) 40)) ;; sphere1 ; Create sphere 2 (define sphere2 (solid:sphere (position 20 -20 0) 30)) ;; sphere2 ; Subtract one sphere from another to generate edges. (define combo (solid:subtract sphere1 sphere2)) ;; combo ; Spline convert the result and use debug to examine ; the unconverted and converted bodies. (define cnv1 (entity:spline-convert sphere1)) ;; cnv1 ; Should not show spline curves in the output. (entity:debug sphere1 3) ; 1 body record, 36 bytes ; 2 attrib records, 100 bytes ; 1 lump record, 36 bytes ; 1 transform record, 136 bytes ; 1 shell record, 44 bytes ; 2 face records, 96 bytes ; 2 loop records, 72 bytes ; 2 surface records, 368 bytes ; 2 coedge records, 104 bytes ; 1 edge records, 80 bytes ; 1 vertex records, 32 bytes ; 1 curve records, 216 bytes ; 1 point records, 64 bytes ; Total storage 1384 bytes ;; solid body ; Should now show newly generated spline curves ; in the output. (entity:debug cnv1 3) ; 1 body record, 36 bytes ; 2 attribute records, 100 bytes ; 1 lump record, 36 bytes ; 1 transform record, 136 bytes ; 1 shell record, 44 bytes ; 4 face records, 192 bytes ; 4 loop records, 144 bytes ; 4 surface records, 736 bytes ; 18 coedge records, 936 bytes ; 9 edge records, 720 bytes ; 18 pcurve records, 1872 bytes ; 7 vertex records, 224 bytes ; 9 curve records, 1944 bytes ; 7 point records, 448 bytes ; Total storage 7568 bytes ;; solid body |
[Top]
face1 | face |
face2 | face |
acis-opts | acis-options |
Description
This extension finds the intersection curve between two faces. It returns the
curve in the form of a wire-body.
; face:intersect ; Create a planar face. (define face1 (face:plane (position -30 -20 -10) 60 40)) ;; face1 ; Set color for face1. (entity:set-color face1 2) ;; () ; Create another planar face. (define face2 (face:plane (position 0 -20 20) 60 40 (gvector 1 0 0))) ;; face2 ; Set color for face2. (entity:set-color face2 3) ;; () ; OUTPUT Two Faces ; Find the intersection curve between the two faces. (define intersect1 (face:intersect face1 face2)) ;; intersect1 (entity:debug intersect1) ;; "wire body" ; OUTPUT Intersection |
[Top]
face | face |
edge | edge |
acis-opts | acis-options |
; face:intersect-edge (part:clear) (define b1 (solid:block (position 0 0 0) (position 10 10 10))) (define b2 (solid:block (position 5 5 5) (position 15 15 15))) (zoom-all) (ray:queue 10 5 10 1 0 0 1) (define e (pick-edge)) (entity:set-color e 1) (ray:queue 12 5 12 0 1 0 1) (define f (pick-face)) (entity:set-color (entity:edges f) 3) (define lists (face:intersect-edge f e)) ;;Check length of lists (define len (length lists)) ;; 1 (define vx (list-ref lists 0)) (entity:set-color vx 0) (vertex:position vx) ;; #[ position 10 5 10 ]
|
[Top]
face | face |
Description
This removes the face from its owning body. When edges and vertices are no
longer needed to support faces, they are also removed. This differs from
face:uncover.
; face:remove ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block1 ; Get a list of the block's faces. (define faces (entity:faces block1)) ;; faces ; OUTPUT Original ; Remove three of the faces to observe the result. (define remove1 (face:remove (car faces))) ;; remove1 (define remove2 (face:remove (car (cdr faces)))) ;; remove2 (define remove3 (face:remove (car (cdr (cdr faces))))) ;; remove3 ; OUTPUT Result |
[Top]
face | face |
split-along-u | boolean |
use-percent | boolean |
split-value | real |
acis-opts | acis-options |
Description
This extension splits a face along a constant u or v parameter
line specified by the supplied arguments. Set split-along-u to #t for a
constant u parameter line, #f for a constant v parameter line. If use-percent
is #t, the split occurs at a relative portion of the parameter range of the
surface of the face between 0 and 1, specified by the argument split-value
(for example, 0.5 splits a face at the midpoint of the parameter range). In
cases where the parameter range is not bounded (for example, when the surface
is a plane), the split occurs at a relative portion of the parameter box of the
face. If use-percent is #f, the split occurs at the explicit parameter
line specified by the argument split-value.
; face:split ; Create a block (define b (solid:block (position -10 -10 -10) (position 10 10 10))) ;; b ; OUTPUT Original ; Get the faces of the block (define faces (entity:faces b)) ;; faces ; Define two faces (define face1 (list-ref faces 2)) ;; face1 (define face2 (list-ref faces 4)) ;; face2 ; The first split is along an explicit u-parameter line (define facesplit1 (face:split face1 #t #f 7)) ;; facesplit1 ; OUTPUT Split 1 ; The second split is along a proportional v-parameter line (define facesplit2 (face:split face2 #f #t 0.25)) ;; facesplit2 ; OUTPUT Split 2 |
[Top]
face | face |
disc-order | integer |
acis-opts | acis-options |
Description
This extension splits a face along the u or v isoparametric lines
at G1 or G2 discontinuity parameters. The list of new faces is returned.
If the edges of the face being split have discontinuities of order 1 or 2, then a split of the edges is recommended before the split of the face is performed. Otherwise a correct outcome of the face split cannot be guaranteed.
(part:clear) ; create a curve discontinuous in G1 by creating a ; spline with duplicate knots in the interior (define ctrlpts_pos (list (position -2 0 0)(position -1.5 0 0) (position 0 0 0)(position .75 0.5 0) (position 1 0.5 0)(position 1.1 1 0) (position 1.2 1 0)(position 1.5 1 0) (position 1.9 .75 0)(position 2 0.5 0) (position 2.1 .25 0)(position 2.5 0 0) (position 3 0 0)(position 4 0 0)) ) ;; ctrlpts_pos (define knot_v (list 0 0 0 1 2 3 4 4 4 5 6 7 7 7 8 9 9 9) ) ;; knot_v (define spline (edge:spline-from-ctrlpts ctrlpts_pos knot_v) ) ;; spline (define spline (sweep:law spline (gvector 0 0 2) )) ;; spline (define f (list-ref (entity:faces spline)0)) ;; f (entity:check f) ;; checked: ;; 0 lumps ;; 0 shells ;; 0 wires ;; 1 faces ;; 1 loops ;; 4 coedges ;; 4 edges ;; 4 vertices ;;() (define splitfas (face:split-at-disc f)) ;; splitfas (entity:check spline) ;; checked: ;; 1 lumps ;; 1 shells ;; 0 wires ;; 3 faces ;; 3 loops ;; 12 coedges ;; 10 edges ;; 8 vertices ;;() |
[Top]
face | face |
acis-opts | acis-options |
Description
This extension removes a surface of a face leaving its supporting edges and
vertices. This results in a partly covered body. The return body is the owner
of the input face.
The input face is removed by deleting it and its surface, any associated loops, and any associated coedges. It leaves the face's edges. If removing a coedge leaves the edge with no coedges, it is kept. In addition, its immediate owner is changed either to the shell or to one of the wires in the newly created wireframe. This differs from the face:unhook, which removes the face's edges.
; face:uncover ; Create a solid block. (define block1 (solid:block (position -30 -15 -45) (position 20 5 40))) ;; block1 ; List the current faces of block1. (entity:faces block1) ;; (#[entity 3 1] #[entity 4 1] #[entity 5 1] ;; #[entity 6 1] #[entity 7 1] #[entity 8 1]) ; Create a list of faces from the block. (define faces (entity:faces block1)) ;; faces ; Uncover one of the faces. (face:uncover (list-ref faces 5)) ;; #[entity 2 1] ; Verify a face has been removed by listing current ; faces. (entity:faces block1) ;; (#[entity 3 1] #[entity 4 1] #[entity 5 1] ;; #[entity 6 1] #[entity 7 1]) |
[Top]
face | face |
copy | boolean |
acis-opts | acis-options |
Description
This Scheme extension removes a face from its owning body and puts a copy into
a new body. When edges and vertices are no longer needed to support faces, they
are also removed. The return body is the owner of the input face.
This differs from the face:uncover. face:unhook makes a copy of the face. It removes the face, its surface, its associated loops, its associated coedges, and the associated edges and vertices no longer needed to support the remaining faces. face:uncover leaves the face's edges.
The copy argument determines whether unhooked faces are to be produced. If the copy flag is set to TRUE, api_unhook_faces produces a copy of the unhooked faces and returns the original body unmodified. If the copy flag is set to FALSE, then no unhooked bodies are produced. api_combine_body produces a single body from the resulting unhooked bodies. Thus, api_combine_body returns a single entity instead of a list of entities.
; face:unhook ; Create a solid block. (define block1 (solid:block (position -10 -15 0) (position 5 10 10))) ;; block1 ; Create a list of faces from the block. (define faces (entity:faces block1)) ;; faces ; OUTPUT Original ; Unhook one of the faces. (define face1 (face:unhook (list-ref faces 2))) ;; face1 ; Verify one face has been unhooked. faces ;; (#[entity 3 1] #[entity 4 1] #[(deleted) entity 5] ;; #[entity 6 1] #[entity 7 1] #[entity 8 1]) (define move1 (transform:translation (gvector 0 -2 0))) ;; move1 (define transform (entity:transform face1 move1)) ;; transform (view:refresh) ;; #[view 10759869] ; OUTPUT Result |
[Top]
option_i | string |
value_i | boolean |
glue-opts | glue-options |
Description
Every option default value is set to #f (unset). These options are designed to
provide additional information to the glue operation for improved performance.
The information provided must be accurate because the glue operation relies
heavily on this information.
See bool:glue-unite for the definition of coincident faces.
Given bodies b1 and b2, a coincident patch P1 in b1 is a maximal set of connected faces of b1 such that there exists a corresponding maximal set P2 of connected faces in b2 and a (well-defined onto) coincidence mapping from P1 to P2.
Face f1 covers face f2 if the point set of f2 is a subset of the point set of f1. Patch P1 covers patch P2 if the point set of P2 is a subset of the point set of P1. Given a pair of coincident patches P1 and P2, P1 is a strict cover of P2 if the point set of P2 is a subset of the interior point set of P1.
The
option_i
argument can take one of the following values:
"patch_and_face_cover"
"blank_patches_strict_cover"
"single_face_patch"
"non_trivial"
Setting "patch_and_face_cover" to #t will induce a performance enhancement.
"patch_and_face_cover" may be set to #t if the following conditions are
satisfied:
for every pair of coincident faces (to be specified in the
glue operation), one face covers the other face;
for every pair of coincident patches, one patch covers the
other patch.
In addition to setting "patch_and_face_cover" to #t, setting
"blank_patches_strict_cover" to #t will induce another performance enhancement.
"blank_patches_strict_cover" may be set to #t if the following conditions are
satisfied:
"patch_and_face_cover" is set to #t;
every patch in the blank (first) body is a strict cover of
its corresponding patch in the tool (second) body.
In addition to setting "patch_and_face_cover" to #t, setting "single_face_patch"
to #t will induce another performance enhancement. "single_face_patch" may be
set to #t if the following conditions are met:
"patch_and_face_cover" is set to #t;
every patch consists of precisely one face;
for each patch, all edges are coincident and all vertices are
coincident. In other words, the corresponding pair of coincident faces are
geometrically and topologically identical.
Thus "blank_patches_strict_cover" and "single_face_patch" cannot both be set to #t.
"non_trivial" may be set to #t if it is guaranteed that the Boolean operation will be non-trivial. In the case of glue-unite, this is when the tool body lies outside the blank body. In the case of glue-subtract, this is when the tool body is completely contained in the blank body. This will induce another performance enhancement. It is not dependent on the previous flags.
; glue:options ; Create a block (define block1 (solid:block (position -10 -10 25) (position 35 10 35))) ;; block1 (define block2 (solid:block (position 20 -10 15) (position 35 10 25))) ;; block2 (define faces1 (entity:faces block1)) ;; faces1 (define faces2 (entity:faces block2)) ;; faces2 ; Pick out the coincident faces on each body (define f11 (list-ref faces1 1)) ;; f11 (define f20 (list-ref faces2 0)) ;; f20 ; change highlight color for images (env:set-highlight-color 1) ;; () ; Highlight the face pair to see they are coincident (entity:set-highlight (list f11 f20) #t) ;; (#[entity 33 1] #[entity 38 1]) ; Construct a glue options object. ; patch_and_face_cover can be set to #t because ; f11 covers f20. ; blank_patches_strict_cover cannot be set ; to #t because f11 (a patch with one face) does not ; strictly cover f20 (the corresponding patch with ; one face) -- the patches have coincident boundary ; edges. "non_trivial" can be set to #t because the ; bodies lie outside one another. (define g (glue:options "patch_and_face_cover" #t "non_trivial" #t)) ;; g (define glue-result (bool:glue-unite block1 block2 (list f11) (list f20) g)) ;; glue-result (entity:check glue-result) ; checked: ; 1 lumps ; 1 shells ; 0 wires ; 8 faces ; 8 loops ; 36 coedges ; 18 edges ; 12 vertices ;; () ; OUTPUT Original ; Now create another block (define block3 (solid:block (position -20 -20 -20) (position 20 25 25))) ;; block3 (define faces3 (entity:faces block3)) ;; faces3 (define faces4 (entity:faces glue-result)) ;; faces4 ; Pick out the coincident faces (define f30 (list-ref faces3 0)) ;; f30 (define f35 (list-ref faces3 5)) ;; f35 (define f42 (list-ref faces4 2)) ;; f42 (define f41 (list-ref faces4 1)) ;; f41 ; Highlight each face pair to see they are coincident (entity:set-highlight (list f30 f42) #t) (entity:set-highlight (list f35 f41) #t) ; Construct a glue options object. ; patch_and_face_cover can be set to #t because ; f30 covers f43 and f35 covers f41. ; blank_patches_strict_cover can be set to #t because ; the patch consisting of f30 and f35 strictly covers ; the patch consisting of f43 and f41. The boundary ; edges of the smaller patch (f43 and f41) ; do not touch the boundary edges of the larger ; patch (f30 and f35). "non_trivial" can be set to #t ; because the bodies lie outside one another. ; In this example, we re-use the previous glue ; options object. (define g (glue:options "blank_patches_strict_cover" #t g)) ;; g g ;; #[Glue_Options "patch_and_face_cover" 1 ;; "blank_patches_strict_cover" 1 "non_trivial" 1 ;; "single_face_patch" -1] ; g = > #[Glue_Options patch_and_face_cover 1 ; blank_patches_strict_cover 1 "non_trivial" 1] (define glueresult (bool:glue-unite block3 glue-result (list f30 f35) (list f42 f41) g) ;; glueresult (entity:check block3) ; checked: ; 1 lumps ; 1 shells ; 0 wires ; 12 faces ; 12 loops ; 60 coedges ; 30 edges ; 20 vertices ;; () ; OUTPUT Result |
[Top]
entity | entity |
file-name | string |
acis-opts | acis-options |
Description
This extension checks all faces for improper intersections.
; solid:check-ff-intersections ; Define a solid block (define b (solid:block (position 0 0 0) (position 20 20 20))) ;; b (solid:check-ff-intersections b) ;; () |
[Top]
body | body |
chk-lumps-and-shells | boolean |
make-wire-body | boolean |
acis-opts | acis-options |
Description
This extension checks all faces of a solid body for improper intersections. The
improper intersections are returned as a list of pairs of faces or edges. If chk-lumps-and-shells
is set to #t, then improper lump and shell containments are also reported. By
default, a wire body representing the improper intersections, colored white for
visual purposes, is returned, but this may be disabled by setting make-wire-body
to #f.
Note: It is recommended that a full check on the body using entity:check at level 70 is performed before calling this extension, since there may be other invalidities in the body. If improper intersections are reported by entity:check, then this extension may be used to return the actual pairs of faces or edges that intersect improperly.
; solid:check-ff-ints ; Define two overlapping solid blocks (define b1 (solid:block (position 0 0 0) (position 20 20 20))) ;; b1 (define b2 (solid:block (position 10 10 10) (position 30 30 30))) ;; b2 ; Combine the blocks to create an invalid body (define combine (body:combine (list b1 b2))) ;; combine ; Check for improper intersections (solid:check-ff-ints b1) ;; entid 527aa28 & 5274818: Error: improper face intersection ;; entid 527aa28 & 5274300: Error: improper face intersection ;; entid 527a568 & 5275b18: Error: improper face intersection ;; entid 527a568 & 5274300: Error: improper face intersection ;; entid 527a0a8 & 5275b18: Error: improper face intersection ;; entid 527a0a8 & 5274818: Error: improper face intersection ;; Body containing improper intersections created. ;; ((#[entity 4 1] . #[entity 3 1]) (#[entity 4 1] . #[entity 5 1]) ;; (#[entity 7 1] . #[entity 6 1]) (#[entity 7 1] . #[entity 5 1]) ;; (#[entity 8 1] . #[entity 6 1]) (#[entity 8 1] . #[entity 3 1]) #[entity 9 1]) |
[Top]
face_list1 | list of faces |
file-name | string |
face_list1 | list of faces |
acis-opts | acis-options |
Description
This extension is a specialized version of solid:check-ff-ints, as it checks
only selected faces of an entity for improper intersections. Pairs of faces are
intersected where one face belongs to face_list1 and another to face_list2.
; solid:check-list-ff-intersections (part:clear) ; Define two overlapping solid blocks (define b1 (solid:block (position 0 0 0) (position 20 20 20))) ;; b1 (define b2 (solid:block (position 10 10 10) (position 30 30 30))) ;; b2 ; Combine the blocks to create an invalid body (define combine (body:combine (list b1 b2))) ;; combine ;pick a face (define f1 (pick:face (ray (position 5 5 5) (gvector 0 0 1)))) ;;f1 ;pick a face (define f2 (pick:face (ray (position 5 5 5) (gvector 1 0 0)))) ;;f2 ;add picked faces to the first list (define f_list1 (list f1 f2)) ;;f_list1 ;pick a face (define f3 (pick:face (ray (position 25 25 25) (gvector 0 -1 0)))) ;;f3 ;add picked face to the second list (define f_list2 (list f3)) ;check for improper intersections for the given list of faces (solid:check-list-ff-intersections f_list1 f_list2 ) ;;(#[entity 6 1] #[entity 7 1]) |
[Top]
body1 | body |
body2 | body |
acis-opts | acis-options |
Description
Calculates the curves of intersection of the two bodies and imprints these
curves onto the faces of the two bodies. This results in the original faces
being split either by breaking the face into several pieces or by adding slits
to the face.
If no intersections exist between the bodies, a "no intersection" message occurs.
; solid:imprint ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 25 25))) ;; block1 ; Set color for block1. (entity:set-color block1 2) ;; () ; Create another solid block. (define block2 (solid:block (position -5 -20 -30) (position 30 15 35))) ;; block2 ; Set color for block2. (entity:set-color block2 3) ;; () ; OUTPUT Original ; Imprint the faces of the two blocks. (solid:imprint block1 block2) ;; #t (define erase (entity:erase block2)) ;; erase ; #[entity 3 1] (view:refresh) ;; #[view 1076235512] ; OUTPUT Result |
[Top]
body1 | body |
body2 | body |
acis-opts | acis-options |
Description
Joins
body1
and
body2
along edges or vertices of the intersection curve between the body's faces.
Like solid:stitch, solid:imprint-stitch
performs a local union operation when creating a nonmanifold edge and may
change face sidedness and containment. Bodies with no face-face intersections
will be grouped in the output body (body1)
regardless.
body2
is deleted.
; solid:imprint-stitch ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block1 ; Set color for block1. (entity:set-color block1 2) ;; () ; Create another solid block. (define block2 (solid:block (position -30 -30 -40) (position 10 10 0))) ;; block2 ; Change the color of block2. (entity:set-color block2 3) ;; () ; OUTPUT Original ; Imprint stitch the 2 blocks. (define imprint (solid:imprint-stitch block1 block2)) ;; imprint ; #[entity 2 1] ; Highlight new edges from intersection ; (not shown) ; OUTPUT Result |
[Top]
facelist | entity list |
pulldirection | unit_vector |
angle | real [degrees] |
imprint | boolean |
acis-opts | acis-options |
(part:clear) ;; #t (define s (solid:cylinder (position 0 0 0)(position 0 0 3) 1)) ;; s (solid:blend-edges (list-ref (entity:edges s) 1) 0.25) (define s2 (solid:cylinder (position 3 0 0)(position 3 0 3) 1)) ;; s2 (solid:blend-edges (list-ref (entity:edges s2) 1) 0.25) (view:dl) (front) (zoom-all) (define f (car (entity:faces s))) ;; f (define sils (solid:imprint-shadow-edges f (gvector 0 0 1) 45 #t)) ;; sils (entity:set-color sils 1) (define f2 (car (entity:faces s2))) ;; f2 ;; Note the difference in the angle, caused by the draft direction (define sil2 (solid:imprint-shadow-edges f2 (gvector 1 0 2) 45 #t)) ;; sil2 (entity:set-color sil2 1) |
[Top]
blank | body |
tool | body |
acis-opts | acis-options |
Description
Computes the intersection graph (or slice) between two bodies and returns it as
a specialized wire body with Boolean attributes and extra coedges. If no
intersections exist between the bodies, a no intersection message occurs.
; solid:slice ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block1 ; Set color for block1 (entity:set-color block1 2) ;; () ; Create another solid block (define block2 (solid:block (position -30 -30 -30) (position 10 10 10))) ;; block2 ; Set color for block2 (entity:set-color block2 3) ;; () ; Slice the two blocks (define slice (solid:inter-graph block1 block2)) ;; slice ; OUTPUT Original Sliced Blocks ; Remove the blocks to see the slice. (entity:delete (list block1 block2)) ;; () ; OUTPUT Resulting Slice |
[Top]
body1 | body |
body2 | body |
... | |
bodyn | body |
acis-opts | acis-options |
Description
This extension requires that a minimum of two solid bodies be specified. The
result is returned in the form of a modified body1 and all other bodies
are deleted.
; solid:intersect ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 20 20 40))) ;; block1 ; Set color for block1. (entity:set-color block1 2) ;; () ; Create a solid sphere. (define sphere1 (solid:sphere (position 10 10 0) 20)) ;; sphere1 ; Set color for sphere1. (entity:set-color sphere1 3) ;; () ; OUTPUT Original ; Intersect the two solids. (define intersect1 (solid:intersect block1 sphere1)) ;; intersect1 ; OUTPUT Result ; Example - 2 solid:intersect ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 20 20 40))) ;; block1 ; Set color for block1. (entity:set-color block1 2) ;; () ; Create another solid block. (define block2 (solid:block (position 10 10 10) (position 30 20 40))) ;; block2 ; Set color for block2. (entity:set-color block2 3) ;; () ; OUTPUT Example Original ; Intersect solid blocks 1 and 2. (define intersect2 (solid:intersect block1 block2)) ;; intersect2 ; OUTPUT Example Result |
[Top]
body | body |
plane-position | position |
plane-normal | gvector |
acis-opts | acis-options |
; solid:planar-slice ; Create a solid block. (define block1 (solid:block (position -10 -10 -10) (position 20 20 20))) ;; block1 ; OUTPUT Original ; Slice the solid block with a plane. (define slice (solid:planar-slice block1 (position 5 5 5) (gvector 0.5 1 0.25))) ;; slice ; OUTPUT Result |
[Top]
blank | body |
tool | body |
bool-opts | Bool_Options |
acis-opts | acis-options |
; solid:slice ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block1 ; Set color for block1. (entity:set-color block1 2) ;; () ; Create another solid block. (define block2 (solid:block (position -30 -30 -30) (position 10 10 10))) ;; block2 ; Set color for block2. (entity:set-color block2 3) ;; () ; Slice the two blocks. (define slice (solid:slice block1 block2)) ;; slice ; OUTPUT Original Sliced Blocks ; Remove the blocks to see the slice. (entity:delete (list block1 block2)) ;; () ; OUTPUT Resulting Slice |
[Top]
body | body |
acis-opts | acis-options |
Description
This command ensures that a body is well formed by splitting all periodic faces
of the body along u, v, or both. The periodic faces of the body are
split at the lower parameter limit, and halfway between the lower and upper
parameter limit. Analytic surfaces are handled, but periodic spline surfaces
are not.
; solid:split ; Create a solid cylinder. (define cyl1 (solid:cylinder (position 25 25 15) (position 15 -20 15) 20)) ;; cyl1 ; OUTPUT Original ; Split the cylinder. (define split (solid:split cyl1)) ;; split ; OUTPUT Result |
[Top]
body1 | body |
body2 | body |
split | boolean |
acis-opts | acis-options |
Description
Joins two face bodies,
body1
and
body2, along edges or vertices that are
identical. Stitching only operates on faces, not on wires, and only stitches
faces to faces. No faces are deleted in order to complete the stitch function.
If wires exist in one of the bodies being stitched, but do not participate in
the stitch (i.e., they do not coincide with edges in the other body), they will
transfer to the resulting body.
The argument body1 is returned as the resulting body. body2, is deleted unless it is the same as body1. For example, a body might need internal stitching. One can stitch body1 to itself. In such a case body1 is not deleted.
If the split option is not specified, the edges must be identical along their entire length, otherwise stitch splits edges along identical edge subregions. Single-sided faces that are stitched together to form a two-manifold edge must have compatible orientations. This is not required for double-sided faces.
Unlike extensions such as solid:unite, solid:stitch is not a Boolean operation. Stitching is simpler than a Boolean because it avoids face-face intersections and the evaluation of lump and shell containments.
; solid:stitch ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block1 ; Create a list of faces from the block. (define faces (entity:faces block1)) ;; faces ; Uncover a face. (define uncover (face:uncover (list-ref faces 5))) ;; uncover ; Copy the open block. (define block2 (entity:copy block1)) ;; block2 ; Flip and position the block to match open faces. (define transform1 (entity:transform block2 (transform:rotation (position 0 0 0) (gvector 0 0 1) 180))) ;; transform1 (define transform2 (entity:transform block2 (transform:translation (gvector 40 0 0)))) ;; transform2 ; Join block1 and block2 to form one lump. (Note: ; you can run (entity:check stitch) to check results. (define stitch (solid:stitch block1 block2)) ;; stitch |
[Top]
body-1 | body |
body-2 | body |
body-n | body |
acis-opts | acis-options |
Description
Subtracts a list of solids from a solid. All bodies must refer to solid bodies.
body-2
through
body-n
are subtracted from body-1. This extension returns the name of
body-1
and deletes
body-2
through
body-n.
; solid:subtract ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 10 10 10))) ;; block1 ; Set color for block1. (entity:set-color block1 2) ;; () ; Create another solid block. (define block2 (solid:block (position -12 -12 -12) (position 30 30 30))) ;; block2 ; Set color for block2. (entity:set-color block2 3) ;; () ; OUTPUT Original ; Subtract block 1 from 2. (define subtract (solid:subtract block1 block2)) ;; subtract ; OUTPUT Result |
[Top]
edge | edge |
acis-opts | acis-options |
Description
This extension unhooks an edge belonging to a wire from a body and returns a
new wire-body.
; solid:unhook-wire-edge ; Define a wire (define wire (wire-body:points (list (position 0 0 0) (position 40 0 0) (position 40 40 0) (position 40 40 40)))) ;; wire ; wire has 3 edges (entity:check wire) ;; checked: ;; 1 lumps ;; 1 shells ;; 1 wires ;; 0 faces ;; 0 loops ;; 3 coedges ;; 3 edges ;; 4 vertices ;; () (define edge0 (car (entity:edges wire))) ;; edge0 ; unhook the edge (define new_wire (solid:unhook-wire-edge edge0)) ;; new_wire ; new_wire has 1 edge (entity:check new_wire) ;; checked: ;; 1 lumps ;; 1 shells ;; 1 wires ;; 0 faces ;; 0 loops ;; 1 coedges ;; 1 edges ;; 2 vertices ;; () ; original wire has 2 edges (entity:check wire) ;; checked: ;; 1 lumps ;; 1 shells ;; 1 wires ;; 0 faces ;; 0 loops ;; 2 coedges ;; 2 edges ;; 3 vertices ;; () |
[Top]
body1 | body |
body2 | body |
... | |
bodyn | body |
acis-opts | acis-options |
Description
Unites two or more solid bodies. The result is returned in the form of a
modified body1 and all other bodies are deleted.
; solid:unite ; Create a solid block. (define block1 (solid:block (position -10 -10 -10) (position 40 40 40))) ;; block1 ; Set color for block1. (entity:set-color block1 2) ;; () ; Create another solid block. (define block2 (solid:block (position -30 -30 -30) (position 0 0 0))) ;; block2 ; Set color for block2. (entity:set-color block2 3) ;; () ; OUTPUT Blocks 1 and 2 ; Unite solid block 1 and 2. (define unite1 (solid:unite block1 block2)) ;; unite1 ; OUTPUT United blocks 1 and 2 ; Create another solid block. (define block3 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block3 ; Set color for block3. (entity:set-color block3 4) ;; () ; OUTPUT Additional block 3 ; Unite the previous entity with solid block 3. (define unite2 (solid:unite block1 block3)) ;; unite2 ; OUTPUT All blocks united |
[Top]
body | body |
acis-opts | acis-options |
Description
Decomposes the input body along nonmanifold edges and vertices, duplicating
edges and vertices and making each decomposed region a separate lump in the
output body. All lumps in the body become manifold unless they had
self-nonmanifold edges. The command also inserts all groups of wire edges into
the body's wire list if they were not already there. Returned list of bodies
contains original body separated into 3d bodies, sheet bodies, laminar bodies,
and wire bodies, as present. Refer to
api_unstitch_nonmani for additional information.
Note: The bodies returned in the decomposition list may not be suitable for modeling operations, since duplicate edges and vertices may be present. Use body:separate to create disjoint bodies.
; solid:unstitch-nm ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block1 (define block2 (solid:block (position 0 0 -10) (position 20 20 10))) ;; block2 (define union (bool:nonreg-unite block1 block2)) ;; union ; OUTPUT Union (solid:manifold? union) ;; #f (define unstitch (solid:unstitch-nm union)) ;; unstitch (define lumps (car unstitch)) ;; lumps (define sheets (cadr unstitch)) ;; sheets ; Transform the sheet body for visual purposes (entity:set-color sheets 3) ;; () (entity:move sheets 40 0 0) ;; #[entity 4 1] ; OUTPUT Result |
[Top]
entity | entity |
tolerance | real |
replace | boolean |
Description
This extension detects all edges of the supplied entity that are shorter than
the specified tolerance, and replaces them with tolerant vertices if replace
is set to #t. If replace is set to #f, the list of short edges is
returned and no short edges are replaced. Otherwise, the list of replacement
tolerant vertices is returned.
; tolerant:detect-short-edges ; Define a simple skin that results in a ; short edge being created (define edge1 (wire-body (list (edge:linear (position 0 0 0) (position 1 0 0))))) ;; edge1 (define edge2 (wire-body (list (edge:linear (position 0.5 1 0) (position 0.500001 1 0))))) ;; edge2 (define skin_ops (skin:options "arc_length" #f "no_twist" #t "align" #t "solid" #f)) ;; skin_ops (define skin (sheet:skin-wires (list edge1 edge2) skin_ops)) ;; skin ; Check the body before the short edge replacement (entity:check skin) ; checked: ; 1 lumps ; 1 shells ; 0 wires ; 1 faces ; 1 loops ; 4 coedges ; 4 edges ; 4 vertices ;; () ; Detect the short edge (define short_edges (tolerant:detect-short-edges skin #f)) ;; short_edges (edge:length (car short_edges)) ;; 1.00000000002876e-006 ; Replace the short edge (define replace_edges (tolerant:detect-short-edges skin #t)) ;; replace_edges (define v (car replace_edges)) ;; v (entity:debug v) ;; "tvertex" ; Validate the remaining body (entity:check skin) ; 1 lumps ; 1 shells ; 0 wires ; 1 faces ; 1 loops ; 3 coedges ; 3 edges ; 3 vertices ;; () (define tol_report (tolerant:report skin)) ; Vertex tolerance = 4.472138e-007 ; No tolerant edges ;; tol_report |
[Top]
entity | entity |
tolerance | real |
replace | boolean |
Description
This extension returns all sliver faces from the supplied entity whose maximum
distance among the edges is smaller than the specified tolerance. If no
tolerance is specified, the lesser of (10*resfit) and (minimum side of the
entity's bounding box divided by 1250) is used by default. If the third
argument replace is set to #t, the detected removable sliver faces will
be automatically replaced with tolerant edges.
When the option replace is set to #t, first, this extension detects all the short edges and replaces them with tolerant vertices. Next, it attempts to detect all the two-edge or three-edge sliver faces and replace them with tolerant edges. The list of tolerant edges is then returned.
Note: The Scheme extension tolerant:replace-face-with-tedge does not attempt to replace the short edges with tolerant vertices. Therefore, to successfully remove the sliver faces detected by this extension, use the option replace and not the Scheme extension tolerant:replace-face-with-tedge.
; tolerant:detect-sliver-faces (part:clear) ;; () ; Create two adjacent blocks (define b1 (solid:block (position 0 0 0) (position 20 20 20))) ;; b1 (define b2 (solid:block (position 20 0 0) (position 40 20 20))) ;; b2 ; Rotate one block by a tiny amount and subtract (define rotate (entity:rotate b2 20 0 0 0 0 1 0.05)) ;; rotate (define subtract (bool:subtract b1 b2)) ;; subtract (entity:check b1) ;; checked: ;; 1 lumps ;; 1 shells ;; 0 wires ;; 7 faces ;; 7 loops ;; 30 coedges ;; 15 edges ;; 10 vertices ;; () ; Identify the sliver faces (define sliver-faces (tolerant:detect-sliver-faces b1)) ;; sliver-faces (length sliver-faces) ;; 1 ; Remove the sliver face and replace with a tolerant edge (define replace (tolerant:detect-sliver-faces b1 #t)) ;; replace (entity:check b1) ;; checked: ;; 1 lumps ;; 1 shells ;; 0 wires ;; 6 faces ;; 6 loops ;; 24 coedges ;; 12 edges ;; 8 vertices ;; () (define tol-report (tolerant:report b1)) ;; Vertex tolerance = 4.363323e-003 ;; Edge tolerance = 7.615435e-006 ;; tol-report |
[Top]
edge-list | entity ... |
ao | acis-options ... |
Description
The argument
edge-list
specifies a list of edges that will be converted to tolerant vertices.
The extension returns a list of tolerant vertices that were created during the replacement. This extension does not take edge lengths into consideration. It simply replaces all edges specified unless the edges are in a closed loop. If the edges are closed, replacement is not performed. To specifically replace short edges, the extension tolerant:detect-short-edges with its replace option set to #t is recommended.
; tolerant:replace-edge-with-tvertex ; Define a wire body with an edge to be replaced (define wire (wire-body (list (edge:linear (position 0 0 0) (position 3 0 0)) (edge:linear (position 3 0 0) (position 3.1 0 0)) (edge:linear (position 3.1 0 0) (position 5 0 0))))) ;; wire ; Replace the middle edge with a tvertex. ; First use tolerant-detect-short-edges with ; a specified tolerance to detect it. (define short_edge (tolerant:detect-short-edges wire 0.2)) ;; short_edge (define replace (tolerant:replace-edge-with-tvertex short_edge)) ;; replace ; Check the resulting body and tvertex (entity:check wire) ;; checked: ;; 1 lumps ;; 1 shells ;; 1 wires ;; 0 faces ;; 0 loops ;; 2 coedges ;; 2 edges ;; 3 vertices ;; () (length (entity:tvertices wire)) ;; 1 |
[Top]
face | face |
Description
This extension replaces a face containing a single loop of two or three edges
with a tolerant edge. The face is removed, an edge of the face is converted
into a tolerant edge, and other subsequent topological manipulations are
performed.
Note: As this Scheme extension is restricted to faces with two or three edges, the recommended way to replace sliver faces detected by tolerant:detect-sliver-faces is to use its replace option, and not this Scheme extension.
; tolerant:replace-face-with-tedge ; Please note that this is an artificial example. ; The same result could be achieved more quickly ; using only tolerant:detect-sliver-faces with ; the replace option set to #t (part:clear) ;; () ; Create a block and imprint 4 sliver faces (define b1 (solid:block (position 0 0 0) (position 20 20 20))) ;; b1 (define sheet (sheet:2d (sheet:face (face:plane (position 0.000002 -10 30) 40 40 (gvector 1 0 0))))) ;; b2 (define imprint (solid:imprint b1 sheet)) ;; imprint (entity:delete sheet) ;; () ; Replace the short edges with tolerant vertices (define tol-verts (tolerant:detect-short-edges b1 #t)) ;; tol-verts ; We now have 4 two-edge faces (define sliver-faces (tolerant:detect-sliver-faces b1)) ;; sliver-faces (define fn-num-edges (lambda (f) (length (entity:edges f)))) ;; fn-num-edges (map fn-num-edges sliver-faces) ;; (2 2 2 2) ; Since each sliver face has two edges, we can replace them ; using tolerant:replace-face-with-tedge (define tedges (map tolerant:replace-face-with-tedge sliver-faces)) ;; tedges (entity:check b1) ;; checked: ;; 1 lumps ;; 1 shells ;; 0 wires ;; 6 faces ;; 6 loops ;; 24 coedges ;; 12 edges ;; 8 vertices ;; () (define tol-report (tolerant:report b1)) ;; Vertex tolerance = 1.000000e-006 ;; Edge tolerance = 0.000000e+000 ;; tol-report |
[Top]
wire | wire-body |
acis-opts | acis-options |
Description
This extension removes the attributes and extra coedges present on a wire body
generated by the section or slice operation. The optional
acis-opts
contains parameters for versioning and journaling.
; wire:clean ; Define a solid sphere (define b1 (solid:sphere (position 0 0 0) 1)) ;; b1 ; Define a solid block (define b2 (solid:block (position 0 0 0) (position 1 1 1))) ;; b2 ; compute the slice keeping all attributes (define sli1 (solid:inter-graph b1 b2)) ;; sli1 ; check that we have the attributes (entity:debug sli1 3) ;; 1 body record, 40 bytes ;; 21 attrib records, 1460 bytes ;; 1 wire record, 48 bytes ;; 1 transform record, 144 bytes ;; 12 coedge records, 672 bytes ;; 3 edge records, 240 bytes ;; 3 vertex records, 108 bytes ;; 3 curve records, 672 bytes ;; 3 point records, 216 bytes ;; Total storage 3600 bytes ;; wire body (wire:clean sli1) ;; #[entity 3 1] ; check that only display_attribute and id_attribute remain (entity:debug sli1 3) ;; 1 body record, 40 bytes ;; 2 attrib records, 108 bytes ;; 1 wire record, 48 bytes ;; 1 transform record, 144 bytes ;; 3 coedge records, 168 bytes ;; 3 edge records, 240 bytes ;; 3 vertex records, 108 bytes ;; 3 curve records, 672 bytes ;; 3 point records, 216 bytes ;; Total storage 1744 bytes ;; wire body |
[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.