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. |
token | integer |
body-list | body | (body ...) |
Description
This extension removes and deletes any IHL attributes with a matching view
token from the list of bodies. When bodies are cleaned, attributes are
removed and are not stored. These attributes cannot be retrieved using
the ihl:retrieve extension.
; ihl:clean ; Compute the hidden lines for two different views, ; storing the data in attributes attached to the ; body. Then retrieve and display each view. Clean ; the attributes and redraw. (define block1 (solid:block (position -10 -25 -35) (position 10 25 35))) ;; block1 ; Set a color for the block. (entity:set-color block1 2) ;; () (define cyl1 (solid:cylinder (position 0 0 -20) (position 0 0 20) 30)) ;; cyl1 ; Set a color for the cylinder. (entity:set-color cyl1 3) ;; () ; OUTPUT Original (define combo (bool:unite cyl1 block1)) ;; combo (define ihldata1 (ihl:compute 1 combo)) ;; ihldata1 (ihl:draw ihldata1) ;; #[ihl-data 40248e60] (ihl:clean 1 combo) ;; () (define ihldata1 (ihl:retrieve 1 combo)) ;; ihldata1 (ihl:draw ihldata1) ;; #[ihl-data 402471b8] ; OUTPUT Result Figure. ihl:clean |
[Top]
token | integer |
body-list | body | (body ...) |
view | view |
unfaceted | boolean |
Description
This extension computes the interactive hidden line data for the given
viewing parameters and list of bodies. The ihl-data returned is a list
of line segments with attached visibility information.
; ihl:compute ; Compute and draw hidden lines for a view. (define block1 (solid:block (position -10 -25 -35) (position 10 25 35))) ;; block1 (define cyl1 (solid:cylinder (position 0 0 -20) (position 0 0 20) 30)) ;; cyl1 (define combo (bool:unite block1 cyl1)) ;; combo (define ihldata1 (ihl:compute 1 combo #f)) ;; ihldata1 (ihl:draw ihldata1) ;; #[ihl-data 40248e60] |
[Top]
body-list | body | (body ...) |
unfaceted | boolean |
Description
This extension computes and displays the interactive hidden line data for
the list of bodies. The default views are the views defined in the current
viewport. The hidden line data is not attached to the bodies. If no bodies
are specified, all bodies in the currently active part are processed.
; ihl:display ; Display the hidden lines for the current view. (define block1 (solid:block (position -10 -25 -35) (position 10 25 35))) ;; block1 (define cyl1 (solid:cylinder (position 0 0 -20) (position 0 0 20) 30)) ;; cyl1 (define unite (bool:unite cyl1 block1)) ;; unite (ihl:display cyl1 #f) ;; () |
[Top]
ihl-data | ihl-data |
view | view |
clear | boolean |
Description
This extension draws ihl-data returned from the ihl:compute
or ihl:retrieve extensions.
; ihl:draw ; Compute and draw hidden lines for a view. (define block1 (solid:block (position -10 -25 -35) (position 10 25 35))) ;; block1 (define cyl1 (solid:cylinder (position 0 0 -20) (position 0 0 20) 30)) ;; cyl1 (define combo (bool:unite block1 cyl1)) ;; combo (define ihldata1 (ihl:compute 1 combo)) ;; ihldata1 (ihl:draw ihldata1) ;; #[ihl-data 40248f40] |
[Top]
ihl-data | ihl-data |
filename | string |
color | boolean |
x-size | real |
y-size | real |
view | view |
Description
ihl-data specifies IHL data from ihl:compute
or ihl:retrieve. This extension returns
the filename.
; ihl:postscript ; Create a cylinder. (define cyl1 (solid:cylinder (position -20 -25 -15) (position 25 35 20) 17.5)) ;; cyl1 ; Render the cylinder with ihl (ihl:postscript (ihl:compute cyl1)) ;; "plotfile.ps" |
[Top]
token | integer |
body-list | body | (body ...) |
Description
This extension retrieves the data stored in IHL attributes with a matching
view token and returns the list of hidden line segments as an ihl-data
object. All data returned is a copy of the data stored in attributes on
the body.
; ihl:retrieve ; Compute the hidden lines for two different views, ; storing the data in attributes attached to the ; body. Then retrieve and display each view. (define view1 (view:dl)) ;; view1 (define view2 (view:dl)) ;; view2 (view:set-eye (position 100 0 100) view2) ;; #[position 0 0 500] (define block1 (solid:block (position -10 -25 -35) (position 10 25 35))) ;; block1 (define cyl1 (solid:cylinder (position 0 0 -20) (position 0 0 20) 30)) ;; cyl1 (define combo (bool:unite cyl1 block1)) ;; combo (define ihldata1 (ihl:compute 1 combo view1)) ;; ihldata1 (define ihldata2 (ihl:compute 2 combo view2)) ;; ihldata2 (define ihldata3 (ihl:retrieve 1 combo)) ;; ihldata3 (ihl:draw ihldata3 view1) ;; #[ihl-data 40227c20] (define ihldata4 (ihl:retrieve 2 combo)) ;; ihldata4 (ihl:draw ihldata4 view2) ;; #[ihl-data 40227e50] |
[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.