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-list | body | (body ...) | ao | acis-options |
; body:combine ; Create block 1. (define block1 (solid:block (position 0 0 0) (position 10 20 20))) ;; block1 ; Set a color for block1 (entity:set-color block1 2) ;; () ; Create block 2. (define block2 (solid:block (position 20 0 0) (position 30 40 40))) ;; block2 ; Set a color for block2 (entity:set-color block2 3) ;; () ; OUTPUT Original ; Combine the blocks into a single body ; with two lumps. (define comb (body:combine (list block1 block2))) ;; comb ; OUTPUT Result Figure. body:combine |
[Top]
body-list | body | (body ...) | acis-opts | acis-options |
(part:clear) (define prism (solid:prism 30 8 8 24)) (define p (pattern:linear (gvector 20 0 0) 10 (gvector 0 20 0) 10 )) (define prism_pat (entity:pattern prism p)) (define box (solid:block (position -10 -10 -10) (position 205 205 20))) (bool:subtract box prism_pat) ;; the result of the Boolean operation does not contain any subshells (entity:debug box 3) ;; using command body:expand introduces 126 subshells (body:expand box) ;; #t (entity:debug box 3) ;; using command body:flatten removes the 126 subshells (body:flatten box) ;; #t (entity:debug box 3) |
[Top]
body-list | body | (body ...) | acis-opts | acis-options |
(part:clear) (define prism (solid:prism 30 8 8 24)) (define p (pattern:linear (gvector 20 0 0) 10 (gvector 0 20 0) 10 )) (define prism_pat (entity:pattern prism p)) (define box (solid:block (position -10 -10 -10) (position 205 205 20))) (bool:subtract box prism_pat) ;; the result of the Boolean operation does not contain any subshells (entity:debug box 3) ;; using command body:expand introduces 126 subshells (body:expand box) (entity:debug box 3) ;; using command body:flatten removes the 126 subshells (body:flatten box) (entity:debug box 3) |
[Top]
body | body |
; body:separate ; Create a solid block. (define block1 (solid:block (position -30 -30 -30) (position 5 10 15))) ;; block1 ; Set a color for block (entity:set-color block1 2) ;; () ; Create a solid cylinder. (define cyl1 (solid:cylinder (position 20 15 30) (position 20 20 20) 15 1 (position 0 0 0))) ;; cyl1 ; Set a color for cyl (entity:set-color cyl1 3) ;; () ; Combine entities 1 and 2. ; Result becomes one body with disjoint pieces. (define combo (body:combine (list block1 cyl1))) ;; combo ; OUTPUT Original ; Separate entities 1 and 2. (define sep (body:separate combo)) ;; sep ; OUTPUT Result Figure. body:separate |
[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.