Scheme Extensions Va thru Zz |
|
|
Technical Article |
Scheme is a public domain programming language, based on the LISP language,
that uses an interpreter to run commands. ACIS provides extensions (written
in C++) to the native Scheme language that can be used by an application
to interact with ACIS through its Scheme Interpreter. The C++ source files
for ACIS Scheme extensions are provided with the product. Spatials Scheme
based demonstration application, Scheme ACIS Interface Driver Extension
(Scheme AIDE), also uses these Scheme extensions and the Scheme Interpreter.
|
view | view |
on | boolean |
; view:axes ; work in HOOPS (define view1 (view:hoops)) ;;view1 ;create an axes (default length is 10) (view:axes) ;; #[view 1180742] ; create an axes (axes length is 20) (view:axes 20) ;; #[1180742] ; turn off coordinate axes display. (view:axes 0) ;; #[view 1180742] ; specify a specific viewpoint (view:axes 20 view1) ;; #[view 1180742] ; obtain the current axes length (or 0 when OFF) (view:axes?) ;; 20 |
[Top]
view | view |
; view:axes? ; work in HOOPS (define view1 (view:hoops)) ;;view1 ;create an axes (default length is 10) (view:axes) ;; #[view 1180742] ; create an axes with length of 20) (view:axes 20) ;; #[1180742] ; turn off coordinate axes display. (view:axes 0) ;; #[view 1180742] ; specify a specific viewpoint (view:axes 20 view1) ;; #[view 1180742] ; obtain the current axes length (or 0 when OFF) (view:axes?) ;; 20 |
[Top]
on-off |
|
view |
;; view:backface-culling ; Define a view. (define view1 (view:gl)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (view:backface-culling #f) ;; #[view 1075519372] (view:backface-culling?) ;; #f |
[Top]
view |
;; view:backface-culling? ; Define a view. (define view1 (view:gl)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (view:backface-culling #f) ;; #[view 1075519372] (view:backface-culling?) ;; #f |
[Top]
view |
|
on-off |
;; view:coedges ; Define a view. (define view1 (view:hoops)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Verify that coedges are turned on (view:coedges #t view1) ;; #[view 1075519376] ; If coedges are not turned on, you will not see ; anything when shading is turned off. ; Turn shading off. (view:shaded #f view1) ;; #[view 1075519376] ; The coedges of the model should be visible. ; Note that silhouettes are not visible on the ; cylinder. Verify that shading is turned on. (view:shaded #t view1) ;; #[view 1075519376] ; Turn on polygon offset to make coedges ; easier to see (view:polygonoffset #t view1) ;; #[view 1075519376] (view:coedges? view1) ;; #t |
[Top]
view |
;; view:coedges? ; Define a view. (define view1 (view:hoops)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Verify that coedges are turned on (view:coedges #t view1) ;; #[view 1075519376] ; If coedges are not turned on, you will not see ; anything when shading is turned off. ; Turn shading off. (view:shaded #f view1) ;; #[view 1075519376] ; The coedges of the model should be visible. ; Note that silhouettes are not visible on the ; cylinder. Verify that shading is turned on. (view:shaded #t view1) ;; #[view 1075519376] ; Turn on polygon offset to make coedges ; easier to see (view:polygonoffset #t view1) ;; #[view 1075519376] (view:coedges? view1) ;; #t |
[Top]
view | view |
Description
Pans the specified view or the
active view. This is performed by translating the views target and eye
position by the same gvector. Then the views width and height are reset
so the entities in the display fill as much of the view window as possible.
Use the view:refresh
extension to display the computed extrema.
If the argument is boolean false, then this procedure is silently ignored.
; view:compute-extrema ; Determine the extrema of the display list, ; then reset the view window to the extrema. (define block1 (solid:block (position 5 5 5) (position 15 15 15))) ;; block1 (define block2 (solid:block (position 0 0 0) (position 10 10 10))) ;; block2 ; OUTPUT Original (view:compute-extrema) ;; () (view:refresh) ;; #[view 1075533160] ; OUTPUT Result
Figure. view:compute-extrema |
[Top]
view | view |
; view:context ; Define a new view. (define view1 (view:dl)) ;; view1 ; Get the rendering context for a view. (view:context view1) ;; dl_context |
[Top]
event1 | pick-event |
event2 | pick-event |
Description
Copies a rectangular region to the clipboard of the given system. The rectangle
is defined by diagonally opposite corners of the rectangular region. If
a clipboard is not supported on the platform, a message is sent to the
output window.
; view:copy-to-clipboard ; Create a solid sphere. (define sphere1 (solid:sphere (position 0 0 0) 25)) ;; sphere1 ; Render the solid sphere. ; Set render mode to full. (render:set-mode full) ;; () ; Render the sphere (render) ;; () ; Copy the view to the clipboard. (view:copy-to-clipboard (read-event) (read-event)) ; With the mouse, select two positions on the screen ; diagonally so that the entity is in the box formed ; by the picked positions. ;; () |
[Top]
level | integer |
view | view |
Description
This extension returns debug information for the display list in the specified
or active view. If debug output
is directed to a filename, the debug information is sent to that file.
The optional argument level specifies
the amount of information to be displayed. The values and their meaning
are:
; view:debug ; Print debug information about the display list. (view:debug) ; Rendering Engine: HOOPS ;; () |
[Top]
view | view |
; view:detach ; Create a view (define view1(view:hoops)) ;; #[view 1075519376] (view:detach view1) ;; #t |
[Top]
view | view |
edges | boolean |
Displaying edges while shading of faces is turned off is not the same thing as a wire frame representation. An ACIS wire frame representation shows silhouette lines, whereas displaying edges does not. The following figure shows the silhouette lines of a wire frame representation of a cylinder (on the left) and the edges of a cylinder with face shading turned off (on the right).
Figure. Silhouette lines versus Edges
; view:edges ; Define a view. (define view1 (view:hoops)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Verify that edges are turned on (view:edges #t view1) ;; #[view 1075519376] ; If edges are not turned on, you wont see ; anything when shading is turned off. ; Turn shading off. (view:shaded #f view1) ;; #[view 1075519376] ; The edges of the model should be visible. ; Note that silhouettes are not visible on the ; cylinder. Verify that shading is turned on. (view:shaded #t view1) ;; #[view 1075519376] ; Turn on polygon offset to make edges easier to see (view:polygonoffset #t view1) ;; #[view 1075519376] (view:edges? view1) ;; #t |
[Top]
view | view |
; view:edges? ; Define a view. (define view1 (view:gl)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cyl1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cyl1 ; Verify that edges are turned on (view:edges #t view1) ;; #[view 10748640] ; If edges are not turned on, you wont see ; anything when shading is turned off. ; Turn shading off. (view:shaded #f view1) ;; #[view 1075519376] ; The edges of the model should be visible. ; Note that silhouettes are not visible on the ; cylinder. ; Verify that shading is turned on (view:shaded #t view1) ;; #[view 1075519376] ; Turn on polygon offset to make edges easier to see (view:polygonoffset #t view1) ;; #[view 1075519376] (view:edges? view1) ;; #t |
[Top]
view | view |
Description
This extension flushes the display buffer of the specified or active view. Use this extension only with
X Windows. If the view is associated with a file, this command writes
any buffered information to the file.
; view:flush ; Define a new view. (define view1 (view:dl)) ;; view1 ; Create a block. (define block1 (solid:block (position 5 5 5) (position 15 15 15))) ;; block1 ; Flush views display buffer. (view:flush view1) ;; #[view 1075519376] |
[Top]
on-off | boolean |
view | view |
; view:hiddenline ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cyl1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cyl1 ; Verify that shading is turned on (view:shaded #t) ;; #[view 1075519376] ; Verify that edges are turned on (view:edges #t) ;; #[view 1075519376] ; Turn on polygon offset to make edges easier to see (view:polygonoffset #t) ;; #[view 1075519376] ; Turn hidden line on. (view:hiddenline #t gl-view) ;; #[view 1075519376] ; The edges of the model should be visible. ; Note that silhouettes are not visible on the ; cylinder. Only the edges are visible. |
[Top]
view | view |
; view:hiddenline? ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Verify that shading is turned on (view:shaded #t) ;; #[view 1075519376] ; Verify that edges are turned on (view:edges #t) ;; #[view 1075519376] ; Turn on polygon offset to make edges easier to see (view:polygonoffset #t) ;; #[view 1075519376] ; Turn hidden line on. (view:hiddenline #t) ;; #[view 1075519376] ; The edges of the model should be visible. ; Note that silhouettes are not visible on the ; cylinder. Only the edges are visible. (view:hiddenline?) ;; #t |
[Top]
x-window | integer |
y-window | integer |
width | integer |
height | integer |
backup | boolean |
part | part |
If no arguments are specified, a window is created based on the size of the display used. The default for this extension displays the view with the y-axis up, the x-axis to the right, and the z-axis coming out of the screen.
The default values for the location and size arguments on Windows systems are (values in parentheses are for non-Windows):
; view:hoops ; Create a new view. (define view1 (view:hoops 0 0 200 200)) ;; view1 ; Create a block. (define block1 (solid:block (position 5 5 5) (position 15 15 15))) ;; block1 ; Get the eye position of view. (view:eye view1) ;; #[position 0 0 500] ; Change the eye position for better viewing. (view:set-eye (position 50 -100 50) view1) ;; #[position 0 0 500] ; Refresh view to see the results of ; the new eye position. (view:refresh view1) ;; #[view 1076012760] |
[Top]
window | integer |
parent | integer |
part | part |
; view:link-to-window ; Get a list of all current views. (env:views) ;; (#[view 1075533160]) ; Link a view to an externally created window. (view:link-to-window 1075488368) ;; #[view 1075533160] |
[Top]
filename | string |
view | view |
emf-wmf |
|
header |
;
view:metafile |
[Top]
view | view |
Description
Returns the part object for the specified or active window. This is useful
in determining the part displayed in one window, so that the same part
can be displayed in another window with the view:set-part
command.
; view:part ; Define a new view. (define view1 (view:dl)) ;; view1 ; Get the part displayed in a view. (view:part view1) ;; #[part 1] (define next-view (view:dl)) ;; next-view (view:set-part (view:part view1) next-view) ;; () |
[Top]
on-off | boolean |
view | view |
; view:polygonoffset ; Define a view. (define view1 (view:gl)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Verify that edges are turned on (view:edges #t view1) ;; #[view 1075519376] ; Turn on polygon offset to make edges easier to see (view:polygonoffset #t view1) ;; #[view 1075519376] ; If edges are not turned on, you wont see ; anything when shading is turned off. |
[Top]
view | view |
; view:polygonoffset? ; Define a view. (define view1 (view:gl)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Verify that edges are turned on (view:edges #t view1) ;; #[view 1075519376] ; Turn on polygon offset to make edges easier to see (view:polygonoffset #t view1) ;; #[view 1075519376] ; If edges are not turned on, you wont see ; anything when shading is turned off. (view:polygonoffset?) ;; #t |
[Top]
on-off |
|
view |
;
view:polygon-edges |
[Top]
view |
; view:polygon-edges? |
[Top]
on-off |
|
view |
; view:polygon-faces |
[Top]
view |
; view:polygon-faces? |
[Top]
filename | string |
color | boolean |
x-size | real |
y-size | real |
view | view |
; view:postscript ; Define a new view. (define view1 (view:dl)) ;; view1 ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 35 35 35))) ;; block1 ; Create a PostScript view. (view:postscript 'geom.ps 100 100 view1) ;; #[view 1073761432] |
[Top]
x-resolution | integer |
y-resolution | integer |
view |
;
view:print |
[Top]
view | view |
Description
Call this extension after changing viewing parameters. This displays changes
made to the part in the specified or active window.
; view:refresh ; Define a top view. (define top (view:dl)) ;; top ; Alter the perspective for better viewing (view:set (position 50 -100 50) (position 0 0 0) (gvector 0 0 1) top) ;; #[view 1076063416] ; Define a solid block. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 ; Define rendering parameters so it does it in color. (entity:set-material-color block1 6) ;; () ; Perform rendering in the top view. (render top) ;; () ; Refresh the display list for the top view. (view:refresh #f) ;; #[view 1075519376] |
[Top]
view | view |
Description
Computes the width and height of a view after the window has been resized
so the aspect ratio remains correct and the model is re-centered. The
viewport is reset so that it coincides with the windows client area. Resets
the view height and width so the scale remains unchanged. Centers the
model within the viewport. However, view:refresh
makes these changes visible.
; view:resize ; Define a new view. (define view1 (view:dl)) ; Resize the current view. ;; view1 ; Create a solid block. (define block1 (solid:block (position 0 0 0) (position 35 35 35))) ;; block1 ; Resize the active view. (view:resize) ;; #[view 1075533160] ; Recompute a views width and height after ; window resizing, and recenter the model. (view:resize view1) ;; #[view 1075519376] (view:refresh view1) ;; #[view 1075519376] |
[Top]
view | view |
part | part |
Description
Sets the view in which a part is displayed. Uses the specified view
or the active view. Also uses the specified part
or the active part. If necessary, creates a new rendering context of the
same type to which the view initially belonged. Refreshes the view in
a window with all the elements in its display list. If the view is a file,
it writes a new page instruction to the file; then it writes information
to the file according to the displayed objects of the new part.
; view:set-part ; Define a new view. (define v1 (view:dl)) ;; v1 ; Define a new part. (define p1 (part:new)) ;; p1 ; Get the part displayed in the view. (view:part v1) ;; #[part 1] ; Set the new part to be displayed in the view. (view:set-part v1 p1) ;; () ; Get the part displayed in a view. (view:part v1) ;; #[part 2] |
[Top]
view | view |
on-off | boolean |
Figure. Silhouette lines versus Edges
; view:shaded ; Define a view. (define view1 (view:hoops)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cyl1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cyl1 ; Verify that edges are turned on (view:edges #t view1) ;; #[view 1075519376] ; If edges are not turned on, you wont see ; anything when shading is turned off. ; Turn shading off. (view:shaded #f view1) ;; #[view 1075519376] ; The edges of the model should be visible. ; Note that silhouettes are not visible on the ; cylinder. ; Verify that shading is turned on (view:shaded #t view1) ;; #[view 1075519376] ; Turn on polygon offset to make edges easier to see (view:polygonoffset #t view1) ;; #[view 1075519376] |
[Top]
view | view |
; view:shaded? ; Define a view. (define view1 (view:hoops)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Verify that edges are turned on (view:edges #t view1) ;; #[view 1075519376] ; If edges are not turned on, you wont see ; anything when shading is turned off. ; Turn shading off. (view:shaded #f view1) ;; #[view 1075519376] ; The edges of the model should be visible. ; Note that silhouettes are not visible on the ; cylinder. ; Verify that shading is turned on (view:shaded #t view1) ;; #[view 1075519376] ; Turn on polygon offset to make edges easier to see (view:polygonoffset #t view1) ;; #[view 1075519376] (view:shaded?) ;; #t |
[Top]
view | view |
sil | boolean |
; view:sil ; Define a view. (define view1 (view:gl)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Verify that edges are turned on (view:edges #t view1) ;; #[view 1075519376] ; If edges are not turned on, you wont see ; anything when shading is turned off. ; Turn shading off. (view:shaded #f view1) ;; #[view 1075519376] ; The edges of the model should be visible. ; Note that silhouettes are not visible on the ; cylinder. ; Verify that shading is turned on (view:shaded #t view1) ;; #[view 1075519376] ; Turn on polygon offset to make edges easier to see (view:polygonoffset #t view1) ;; #[view 1075519376] (view:sil #t view1) ;; #[view 1075519376] (view:sil? view1) ;; #t |
[Top]
view | view |
; view:sil? ; Define a view. (define view1 (view:hoops)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Verify that edges are turned on (view:edges #t view1) ;; #[view 1075519376] ; If edges are not turned on, you wont see ; anything when shading is turned off. ; Turn shading off. (view:shaded #f view1) ;; #[view 1075519376] ; The edges of the model should be visible. ; Note that silhouettes are not visible on the ; cylinder. ; Verify that shading is turned on (view:shaded #t view1) ;; #[view 1075519376] ; Turn on polygon offset to make edges easier to see (view:polygonoffset #t view1) ;; #[view 1075519376] (view:sil #t view1) ;; #[view 1075519376] (view:sil? view1) ;; #t |
[Top]
view | view |
edge-on-off | boolean |
Description
This extension enables (#t) and disables (#f) a models tolerant coedges
within an view. When enabled and when shading (view:shaded)
is disabled, the result is similar to a wireframe representation only
without the silhouette lines.
; view:tcoedges ; Define a view. (define view1 (view:hoops)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cylinder1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cylinder1 ; Verify that edges are turned on (view:tcoedges #t view1) ;; #[view 1075519376] ; If tcoedges are not turned on, you will not see ; anything when shading is turned off. ; Turn shading off. (view:shaded #f view1) ;; #[view 1075519376] ; The tcoedges of the model should be visible. ; Note that silhouettes are not visible on the ; cylinder. Verify that shading is turned on. (view:shaded #t view1) ;; #[view 1075519376] ; Turn on polygon offset to make tcoedges ; easier to see (view:polygonoffset #t view1) ;; #[view 1075519376] (view:tcoedges? view1) ;; #t |
[Top]
view | view |
; view:tcoedges? ; Define a view. (define view1 (view:hoops)) ;; #[view 1075519376] ; Define a block. (define block1 (solid:block (position 0 0 0) (position 25 20 30))) ;; block1 (define cyl1 (solid:cylinder (position -10 -10 -10) (position -10 -10 30) 5)) ;; cyl1 ; Verify that tcoedges are turned on (view:tcoedges #t view1) ;; #[view 1075519376] ; If tcoedges are not turned on, you will not see ; anything when shading is turned off. ; Turn shading off. (view:shaded #f view1) ;; #[view 1075519376] ; The tcoedges of the model should be visible. ; Note that silhouettes are not visible on the ; cylinder. ; Verify that shading is turned on (view:shaded #t view1) ;; #[view 1075519376] ; Turn on polygon offset to make tcoedges easier ; to see (view:polygonoffset #t view1) ;; #[view 1075519376] (view:tcoedges? view1) ;; #t |
[Top]
view | view |
vertices | boolean |
; view:vertices ; Display vertices in the active view. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 (view:vertices #t) ;; #[view 1075519376] |
[Top]
view | view |
; view:vertices? ; Display vertices in the active view. (define block1 (solid:block (position 0 0 0) (position 10 10 10))) ;; block1 (view:vertices?) ;; #f |
[Top]
event1 | pick-event |
event2 | pick-event |
view | view |
Description
Zooms the specified view or the active view to a size defined by two pick
events. The pick events define a rectangle. The area within the rectangle
is modified to fit as tightly as possible within the associated viewport
while maintaining the aspect ratio.
; view:zoom-window ; Define a solid block. (define block1 (solid:block (position 0 0 0) (position 15 15 15))) ;; block1 ; OUTPUT Original (view:zoom-window (read-event) (read-event)) ; Use the mouse to select diagonal ; corners of the block. ;; #[view 1075533160] (view:refresh) ;; #[view 1075533160] ; OUTPUT Result
Figure. view:zoom-window |
[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.