Scheme Extensions |
|
|
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. Spatial's Scheme based demonstration application, Scheme ACIS Interface Driver Extension (Scheme AIDE), also uses these Scheme extensions and the Scheme Interpreter. |
body-or-face-list | body | face | (face ...) |
thickness | real |
box-height | position |
box-length | position |
lopt | lop_options |
acis-opts | acis-options |
Note: ENTITYs returned in the outcome standard_error_info object are highlighted.
Description
Offsets the owning body of given faces by the supplied thickness, using
the optional intersection box, omitting the open faces and subtracts the
original body.
Body faces with radial surfaces which cannot be offset by the thickness are removed and the resulting wound healed by the surrounding face surfaces. Radial surfaces are spheres, cones, and tori, blended edges and blended vertices.
This generally leads to shells which are locally overly thick. However in the case of vertex blends with large setbacks being removed, the shell may be locally too thin, or may even have a hole.
Multi-lump bodies may be shelled, but any lumps with more than one shell are not further shelled.
The optional intersection box limits the size of intersections between surfaces which might otherwise be very long. It can not be used to choose faces. Its main purpose is to speed up complicated cases where the intersection curves might be very long, thus improving performance. The box must contain the final faces and if omitted defaults to the size box.
Mergeable edges are retained provided they have a NO_MERGE_ATTRIB.
Topology Changes
Refer to the topology changes listed for the Scheme extension, lop:tweak-faces.
Geometry Changes
Refer to the geometry changes listed for the Scheme extension, lop:tweak-faces.
; shell:hollow-body ; Create a solid block. (define block1 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block1 ; OUTPUT Original (define face1 (car (entity:faces block1))) ;; face1 ; Hollow the body (define hollow (shell:hollow-body face1 10)) ;; hollow ; OUTPUT Result
Figure. shell:hollow-body
Figure. shell:hollow-body to the
outside
Figure. shell:hollow-body to the inside |
[Top]
body | body |
def-inside-off | (real ...) |
def-outside-off | (real ...) |
openface-list | (face ...) |
spec-inside-face-list | (face ...) |
spec-inside-off-list | (real ...) |
spec-outside-face-list | (face ...) |
spec-outside-off-list | (real ...) |
box-height | position |
box-length | position |
lopt | lop_options |
acis-opts | acis-options |
Note: that ENTITYs returned in the outcome standard_error_info object are highlighted.
Description
Shells the supplied body by the offset distances omitting the specified
open faces which thus generate openings into the internal void. The default
offsets are applied to all faces except the open faces, unless overridden
by specific offsets.
Body faces with radial surfaces which cannot be offset by the thickness are removed and the resulting wound healed by the surrounding face surfaces. Radial surfaces are spheres, cones, and tori, blended edges and blended vertices. This generally leads to shells which are locally overly thick. However, in the case of vertex blends with large setbacks being removed, the shell may be locally too thin, or may even have a hole.
Multi-lump bodies may be shelled, but any lumps with more than one shell are not further shelled.
The optional intersection box limits the size of intersections between surfaces which might otherwise be very long. It can not be used to choose faces. Its main purpose is to speed up complicated cases where the intersection curves might be very long, thus improving performance. The box must contain the final faces and if omitted, defaults to the size box.
Mergeable edges are retained provided they have a NO_MERGE_ATTRIB .
Topology Changes:
Refer to the topology changes listed for the Scheme extension, lop:tweak-faces.
Geometry Changes:
Refer to the geometry changes listed for the Scheme extension, lop:tweak-faces.
; shell:hollow-body-specific ; Build a model (view:set (position 75 25 50) (position 0 0 0) (gvector 0 0 1)) ;; #[view 1076829024] (view:set-perspective OFF) ;; #f (define block1 (solid:block (position -20 -20 -20) (position 20 20 20))) ;; block1 ; OUTPUT Original (define top-face (pick:face (ray (position 0 0 0) (gvector 0 0 1)))) ;; top-face (define front-face (pick:face (ray (position 0 0 0) (gvector 1 0 0)))) ;; front-face ; Hollow the body,default inside -5,top open, ; front outside 10 (define hollow3 (shell:hollow-body-specific block1 (list -5) (list) (list top-face) (list) (list) (list front-face) (list 10))) ;; hollow3 ; OUTPUT Result
Figure. shell:hollow-body-specific |
[Top]
def-face-list | face | (face ...) |
def-offset | real |
spec-face-list | face | (face ...) |
spec-offset-list | real | (real ...) |
box-height | position |
box-length | position |
lopt | lop_options |
acis-opts | acis-options |
Description
Offsets surfaces of the supplied faces by an offset distance specific
for each face. Creates a new sheet body out of those faces. The sheet
body is converted to sheet2d.
Radial faces with surfaces which cannot be so offset are removed and the resulting wound healed by the surrounding face surfaces.
Optionally repair body can be used during the offset.
Topology Changes:
In addition to the following, refer to the topology changes listed for the Scheme extension, lop:tweak-faces.
Faces with radial surfaces which cannot be offset by the distance without degenerating or inverting (spheres, cones, blended edges, blended vertices, and tori) are removed and the resulting wound healed by the surrounding face surfaces, before the offset.
Geometry Changes:
The geometry changes performed by tweak-faces on the tweaked faces and their neighbors are:
pipe_spl_sur spline surfaces will be converted to rb_blend_spl_sur spline surfaces in the supplied faces and their neighbors if the option lop_convert_pipe is set on, which is the default setting.
; shell:offset-make-sheet ; Set the position of the view. (define viewset (view:set (position 75 25 50) (position 0 0 0) (gvector 0 0 1))) ;; viewset ; Set the perspective of the view. (view:set-perspective #f) ;; #f (define b1 (solid:block (position -25 -25 -25) (position 25 25 25))) ;; b1 ; OUTPUT Original ; Offset bottom and back 10 (default), ; top 20 and front -10 (specific)s (define shl-off (shell:offset-make-sheet (list (pick:face (ray (position 0 0 0) (gvector 0 0 -1))) (pick:face (ray (position 0 0 0) (gvector -1 0 0)))) 10 (list (pick:face (ray (position 0 0 0) (gvector 0 0 1))) (pick:face (ray (position 0 0 0) (gvector 1 0 0)))) (list 20.0 -10.0))) ;; shl-off
Figure. shell:offset-make-sheet |
[Top]
body | body |
thickness | real |
both | boolean |
box-height | position |
box-length | position |
lopt | lop_options |
acis-opts | acis-options |
Note: ENTITYs returned in the outcome standard_error_info object are highlighted.
Description
The purpose of sheet thickening is to create a realistic, three-dimensional
sheet from an ideal two-dimensional sheet. Typically, the thickness supplied
is very small.
This extension makes a copy of the sheet to be thickened, offsets it, and fits new orthogonal side faces between the two copies. If the boolean both is false and the thickness supplied is positive, the sheet is thickened in the direction of the sheet normal. Supplying a negative thickness provokes thickening in the opposite direction from the sheet normal. If the boolean both is true the sheet is thickened in both directions by half the thickness. If both is not supplied, its default value is false.
The optional intersection box limits the size of intersections between surfaces which might otherwise be very long. It can not be used to choose faces. Its main purpose is to speed up complicated cases where the intersection curves might be very long, thus improving performance. The box must contain the final faces and if omitted defaults to the size box.
Topology Changes:
Refer to the topology changes listed for the Scheme extension, lop:tweak-faces.
Vertices may be split as a result of thickening the sheet.
Mergeable edges are removed unless they have a NO_MERGE_ATTRIB.
Geometry Changes:
Refer to the geometry changes listed for the Scheme extension, lop:tweak-faces.
; shell:sheet-thicken ; Thicken a sheet made up of two faces by 5 in the ; direction of the face normals. (define s1 (sheet:face (face:plane (position -60 50 -20) 50 50))) ;; s1 (define s2 (sheet:face (face:reverse (face:plane (position -60 50 -20) 50 50 (gvector 0 1 0))))) ;; s2 ; OUTPUT Original ; Convert the bodies to 2d and unite. (define convert1 (sheet:2d s1)) ;; convert1 (define convert2 (sheet:2d s2)) ;; convert2 (define unite (bool:unite s1 s2)) ;; unite ; Thicken the sheet body. (define thicken (shell:sheet-thicken s1 5 #f)) ;; thicken ; OUTPUT Result
Figure. shell:sheet-thicken |
[Top]
face-list | (face... ) |
growth-type | integer |
remove-faces | integer |
lopt | lop_options |
acis-opts | acis-options |
Description
Creates a solid from a list of faces and connecting or growing new faces in
the gaps between them. These faces are copied and separated to form a unique
manifold body. Each connected set of faces are then repaired by growing faces
to cover opening and a solid is created from the faces. These solids are then
return from the function along with a boolean flag that describes if the body
is the result of filling a hole (TRUE) or replicating a boss (FALSE).
; solid:make-from-face-list (part:clear) ;; #t (define b (solid:block (position -5 -2.5 0)(position 5 2.5 1))) ;; b (shell:hollow-body (list-ref (entity:faces b) 0) -0.1) ;; #[entity 1 1] (bool:unite b (solid:cylinder (position 0 0 0)(position 0 0 2) .25)) ;; #[entity 1 1] (bool:unite b (solid:sphere (position 0 0 2) 0.5)) ;; #[entity 1 1] ; OUTPUT Original ;; Select the faces needed (entity:fix-transform b) ;; #[entity 1 1] (ray:queue 0 0 1 1 0 0 0.1) ;; #[ray (0 0 1) (1 0 0)] (define f1 (pick-face)) ;; f1 (ray:queue 0 0 2 1 0 0 0.1) ;; #[ray (0 0 2) (1 0 0)] (define f2 (pick-face)) ;; f2 (define faces (list f1 f2)) ;; faces (entity:set-color faces 1) ;; () ; Make a new body from the selected faces, ; leaving the original body intact. (solid:make-from-face-list faces 0 0) ;; ((#f) (#[entity 12 1])) ; OUTPUT Result
Figure. solid:make-from-face-list |
[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.