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:axes

Action
Enables and disables display of coordinate axes.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:axes [view=active] [on=#t])

Arg Types
view view
on boolean

Returns
view

Arguments
view specifies the active view.

Define on argument with #t to enable the viewing of coordinate axes.
; 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:axes?

Action
Returns the option to enable or disable coordinate axes (#f = do not draw).

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:axes? [view=active])

Arg Types
view view

Returns
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 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]


view:backface-culling

Action
Enables and disables backface culling of polygons.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:backface-culling [on-off] [view=active])

Arg Types

on-off

boolean

view

view


Returns
view
Arguments
     The on-off argument enables (#t) and disables (#f) a models edges within a 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:backface-culling?

Action
Queries if backface culling is on or off.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:backface-culling? [view=active])

Arg Types

view

view


Returns
boolean

Description

    Returns #t if view is enabled or #f if view is disabled.
;; 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:coedges

Action
Enables and disables display of tolerant coedges within an view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:coedges [view=active] [edges])

Arg Types

view

view

on-off

boolean


Returns
string

Description

This extension enables (on-off = #t) and disables (on-off = #f) a model's tolerant coedges within a view. When enabled and when shading (view:shaded) is disabled, the result is similar to a wireframe representation only without the silhouette lines.
;; 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:coedges?

Action
Determines if coedges are displayed in a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:coedges [view=active])

Arg Types

view

view


Returns
boolean
;; 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:compute-extrema

Action
Sets the view window size to the extrema of the part.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:compute-extrema [view=active])

Arg Types
view view

Returns
unspecified

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:context

Action
Gets the name of the rendering context that is displayed in a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:context [view=active])

Arg Types
view view

Returns
string

Description
This extension returns a string that describes the type of rendering_context used to display a part in the 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]


view:copy-to-clipboard

Action
Copies a region of a window to the clipboard.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:copy-to-clipboard event1 event2)

Arg Types
event1 pick-event
event2 pick-event

Returns
unspecified

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.

Arguments
The corners are obtained by the event arguments, event1 and event2. They must be events in the same view window. They identify the type of event used, which is typically, the mouse (read event).
; 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]


view:debug

Action
Gets debug information for the display list.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:debug [level] [view=active])

Arg Types
level integer
view view

Returns
unspecified

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:

0,
displays the rendering context and display list parent header.
1,
displays parent info and solids header.
2,
displays solids info and lumps header.
3,
displays lumps info and shells header.
4,
displays shells info and faces header.
5,
displays faces info and loops header.
6,
displays loops info and edges header.
7,
displays edges info and display list polyline header.
8,
displays display list polyline fill and points info.

Arguments
The argument view identifies which view is used to determine the display list.
; view:debug
; Print debug information about the display list.
(view:debug)
; Rendering Engine: HOOPS
;; ()

[Top]


view:detach

Action
Detaches a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:detach view)

Arg Types
view view

Returns
boolean
; view:detach
; Create a view
(define view1(view:hoops))
;; #[view 1075519376]

(view:detach view1)
;; #t

[Top]


view:edges

Action
Enables and disables display of edges.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:edges [edges] [view=active])

Arg Types
view view
edges boolean

Returns
view

Description

Shading (view:shaded) and edge (view:edges) display must be enabled for doing fake hidden line (view:hiddenline).

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

Arguments
The edges argument enables (#t) and disables (#f) a models edges within a
view. When enabled and when shading (view:shaded) is disabled, the result is similar to a wireframe
representation only without the silhouette lines.
; 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:edges?

Action
Determines if edges are displayed in a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:edges? [view=active])

Arg Types
view view

Returns
boolean
; 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:flush

Action
Flushes the display buffer for a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:flush [view=active])

Arg Types
view view

Returns
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.

Arguments
The optional argument view specifies the view to flush.
; 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]


view:hiddenline

Action
Enables and disables fake hidden line.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:hiddenline [on-off] [view=active])

Arg Types
on-off boolean
view view

Returns
view

Description

Shading (view:shaded) and edge (view:edges) display must be enabled. Faces are being rendered, but with the background. To help improve visibility, turning view:polygonoffset pushes the faceted polygon edges used in rendering back so the models edges become more visible.

Arguments

The on-off argument enables (#t) and disables (#f) fake hidden line display on a per model basis. Multiple models within a scene may not produce a correct hidden line display.
; 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:hiddenline?

Action
Determines if hiddenline is enabled in a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:hiddenline? [view=active])

Arg Types
view view

Returns
boolean
; 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]


view:hoops

Action
Creates a new view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:hoops [x-window y-window width height]
    [backup] [part])

Arg Types
x-window integer
y-window integer
width integer
height integer
backup boolean
part part

Returns
view

Description

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):

x-window = 1 (0)
y-window = 1 (0)
width = 256 (600)
height = 256 (600)


Any arguments specified are assumed to belong to parameters at the beginning of the argument list; therefore, any unspecified arguments receive their default values from the remainder of the default list. For example, (view:dl 10 30 #t) on a Windows system becomes:
(view:dl 10 30 256 256 #t)

Arguments
The optional arguments x-window and y-window specify the xy location on the screen of the upper left-hand corner of the view window.
 
The optional argument width specifies the horizontal size of the window in pixels.
 
The optional argument height specifies the vertical size of the window in pixels.
 
The optional argument backup, when #t, buffers display information in memory, so that refresh operations to rendered images, for example, are not converted back to wireframe
representations; the rendered image is refreshed. The default is #f.

The optional argument part specifies which part is to be displayed in the view window.

; 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]


view:link-to-window

Action
Maps a view to an externally-created window.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:link-to-window window [parent] [part])

Arg Types
window integer
parent integer
part part

Returns
view

Description

Maps a view to an externally-created window. To associate a window with an external application, use this extension to assign the external (parent) application to the window.

Arguments
The argument window specifies the window identification number assigned to that window. To determine the current viewing parameters, use the env:views extension.
 
The optional argument parent specifies the external window ID to associate with the visible window. It is used to resolve ambiguities in cases where the external application generates 16-bit window handles.
 
If the optional argument part is specified, then the view is associated with that part; otherwise, it is associated with the active 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]


view:metafile

Action
Writes a view to a file in Windows Enhanced Metafile format.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:metafile [filename] [view=active] [emf-wmf]
                    [header=#f])
Arg Types
filename string
view view

emf-wmf

boolean

header

boolean


Returns
view

Description

When running on the Windows NT platform, this extension writes a view in Windows Enhanced Metafile format to a file or to the clipboard and returns the specified view. view:metafile sends the wireframe image to the output file, while render:metafile renders the image sent to the output file.

Arguments

         The optional argument filename specifies the path of the metafile.

         The optional argument view specifies the view object to send to the filename. If view is not specified, the default is the active view.

         The optional argument emf-wmf controls whether an old style metafile (wmf) is made or the new enhanced format (emf) is made. If an old style is specified (#t).

         The optional argument header is used to add some extra header information that is required for some Windows programs such as Word. Metafile type defaults to #t which is an
         enhanced metafile. Header type defaults to #f which does not add the extra header.       

Limitations
         
This extension works on the MS Windows platform only; on other platforms the extension returns "Metafile output not supported for this platform." 

; view:metafile
; Create a new view.
(define view1 (view:dl))
;; view1
(view:set-title "view1" view1)
;; #[view 1076886864]
(define view2 (view:dl))
;; view2
(view:set-title "view2" view2)
;; #[view 1076892048]
(define body (solid:subtract
 (solid:cylinder (position 0 0 -10)
 (position 0 0 10) 10)
 (solid:sphere (position 0 0 20) 20)
 (solid:cylinder (position 10 0 -10)
 (position 10 0 10) 5)
 (solid:cylinder (position -10 0 0)
 (position 10 0 0) 3)
 (solid:cylinder (position 0 -10 0)
 (position 0 10 0) 3)))
;; body
; These are the metafile test cases.
; The following generates an enhanced metafile
(view:metafile "c:/tmp/dltest1.emf")
;; #[view 1076886864]
; The following generates an enhanced metafile
; for view2
(view:metafile "c:/tmp/dltest2.emf" view2)
;; #[view 1076892048]
; The following generates an enhanced metafile
; as specified from arg 3
(view:metafile "c:/tmp/dltest3.emf" #t)
;; #[view 1076886864]
; The following generates an enhanced metafile
; for view2. arg 4 says enhanced metafile
(view:metafile "c:/tmp/dltest4.emf" view2 #t)
;; #[view 1076892048]
; The following generates an old metafile format
; without the extra header information
(view:metafile "c:/tmp/dltest5.wmf" #f)
;; #[view 1076892048]
; The following generates an old metafile format for
; view2 without the extra header information
(view:metafile "c:/tmp/dltest6.wmf" view2 #f)
;; #[view 1076892048]
; The following generates an old metafile format
; with the extra header information
(view:metafile "c:/tmp/dltest7.wmf" #f #t)
;; #[view 1076892048]
; The following generates an old metafile format
; for view2 with the extra header information
(view:metafile "c:/tmp/dltest8.wmf" view2 #f #t)
;; #[view 1076892048]
; The following generates an enhanced metafile that
; is sent to the clipboard (suggested format for
; clipboard transfers)
(view:metafile)
;; #[view 1076892048]

[Top]


view:part

Action
Gets the part that is displayed in a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:part [view=active])

Arg Types
view view

Returns
part

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]


view:polygonoffset

Action
Enables and disables polygonoffset within an view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:polygonoffset [on-off] [view=active])

Arg Types
on-off boolean
view view

Returns
view

Arguments
The on-off argument enables (#t) and disables (#f) polygon offsetting. The polygons refer to those used in faceting a model, which is a requirement for rendering. When enabled and when model edges (view:edges) enabled, this command pushes the faceted polygon edges back so the model edges become more visible. Prevents z-buffer problems when displaying edges on top of the shaded object.

Limitations
view:edges should be enabled to see any effect.
; 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:polygonoffset?

Action
Determines if polygonoffest is enabled in a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:polygonoffset? [view=active])

Arg Types
view view

Returns
boolean
; 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]


view:polygon-edges

Action
Turns on or turns off edge viewing of polygons.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:polygon-edges [on-off] [view=active])

Arg Types

on-off

boolean

view

view


Returns
view
Arguments
       The on-off argument enables (#t) and disables (#f) a models polygon edges within a view.

; view:polygon-edges
; 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
(view:polygon-edges #t view1)
;; #[view 1075519376]

[Top]


view:polygon-edges?

Action
Queries edge viewing of polygons. Returns #t if they can be viewed.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:polygon-edges? [view=active])

Arg Types

view

view


Returns
boolean

; view:polygon-edges?
; 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
(view:polygon-edges #t view1)
;; #[view 1075519376]
(view:polygon-edges? view1)
;; #t

[Top]


view:polygon-faces

Action
Turns on or turns off shaded viewing of polygon faces.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:polygon-faces [on-off] [view=active])

Arg Types

on-off

boolean

view

view


Returns
view
Arguments
        The on-off argument enables (#t) and disables (#f) a models polygon faces within a view.

; view:polygon-faces
; 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
(view:polygon-faces #f view1)
;; #[view 1075519376]

[Top]


view:polygon-faces?

Action
Queries shaded viewing of polygon faces. Returns #t if they are shaded.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:polygon-faces? [view=active])

Arg Types

view

view


Returns
boolean

; view:polygon-faces?
; 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
(view:polygon-faces #f view1)
;; #[view 1075519376]
(view:polygon-faces? view1)
;; #f

[Top]


view:postscript

Action
Creates a PostScript file of a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:postscript [filename=plotfile.ps] [color=#f]
    [x-size=190 y-size=254] [view=active])

Arg Types
filename string
color boolean
x-size real
y-size real
view view

Returns
view

Description

The scale of a representation is determined by the relationship between the size of the viewport and the view width and height. For example, a default viewport size of 500 by 500 pixels, the default view can be doubled in viewed size by changing the view width and height from 200 to 100 units.

The resolution of the printed image is determined by the relationship between the size of the viewport and the maximum image size, specified when the file view is created.

Arguments
The optional argument filename specifies a string for the filename where the displayed objects are saved; the default filename is plotfile.ps. Wireframe images are written in vector graphics format. Temporary text uses PostScript fonts rather than as graphical images. Rendered images are written in raster form.
 
The argument color specifies whether the view should be drawn in color (#t) or black and white (#f). This always uses a white background for wireframe images. Backgrounds for rendered images are treated as graphics.
 
The optional arguments x-size and y-size specify the dimensions of the rectangle within which the image will be placed. These arguments need to be positive and represent millimeters. The defaults are 190. mm by 254 mm, which gives a half inch border when printed on 8.5 by 11 paper.
 
The optional argument view specifies the view object to send to the filename. If view is not specified, the default is the active 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]


view:print

Action
Prints the contents of a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:print [x-resolution=300 y-resolution=300]
            [view=active])
Arg Types
x-resolution integer
y-resolution integer

view

view


Returns
view

Description

For example, if the output laser printer has a resolution of 300 dots per inch, and the x-resolution and y-resolution values are both 300, the image output to the laser printer is one square inch. A Print box displays requesting information for the desired printer and output port or the filename if the image is to be output to a file. If the image is output to a file, a dialog box will pop up asking for the name of the file.

Change the printer setup information by selecting the Print Setup button. Modify page orientation and paper size to accommodate specific requirements. The image is sent to the specified printer and an image file is created and stored in the current directory; the default is PostScript. This extension also returns the view where the file was saved.

Note
:  This extension requires Windows and a Personal Computer (PC). If the PC is not attached to a printer, a Print To File window automatically displays to specify an output filename. dl:print sends the wireframe image to the output file, while render:print renders the image sent to the output file.

Arguments

        The optional x-resolution specifies the x-value in pixel dots per inch; the default is 300 dots per inch.

        The optional y-resolution specifies the y-value in pixel dots per inch; the default is 300 dots per inch.

        The optional view specifies the view orientation at the specified x-resolution and y-resolution to be printed on a laser printer; the default is the active view.

Limitations
        
This extension works on the MS Windows or Windows NT platforms only; on other platforms the extension returns "Printing is not supported on this platform." 

; view:print
; Print a view in Windows.
(define ISO (view:dl))
;; ISO
(view:print 1500 1500 ISO)
;; #[view 1075840784]

[Top]


view:refresh

Action
Refreshes the display list for a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:refresh [view=active])

Arg Types
view view

Returns
view

Description
Call this extension after changing viewing parameters. This displays changes made to the part in the specified or active window.

Arguments
The optional argument view specifies the view to refresh. If view is not specified, the active view is used.
; 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:resize

Action
Sets correct aspect ratio and centers model after the window has been resized.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:resize [view=active])

Arg Types
view view

Returns
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.

Arguments
The optional argument view specifies the view to resize. If view is not specified, the active view is used.
; 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:set-part

Action
Sets the view in which a part is displayed.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:set-part [view=active] [part])

Arg Types
view view
part part

Returns
unspecified

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:shaded

Action
Enables and disables shading of faces within an view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:shaded [on-off] [view=active])

Arg Types
view view
on-off boolean

Returns
view

Description

Shading (view:shaded) and edge (view:edges) display must be enabled for doing fake hidden line (view:hiddenline).

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

Arguments
The on-off argument enables (#t) and disables (#f) shading within a view. When disabled and model edges (view:edges) enabled, the result is similar to a wireframe representation only
without the silhouette lines.

Limitations
When shading is turned off, view:edges should be enabled, otherwise nothing will be visible.
; 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:shaded?

Action
Determines if shading is on for a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:shaded? [view=active])

Arg Types
view view

Returns
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:sil

Action
Enables and disables display of silhouettes.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:sil [view=active] [sil])

Arg Types
view view
sil boolean

Returns
view

Arguments
The sil argument enables (#t) and disables (#f) a models silhouettes within a view. The result is similar to a wireframe representation.
; 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:sil?

Action
Determines if silhouettes are displayed in a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:sil? [view=active])

Arg Types
view view

Returns
boolean
; 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:tcoedges

Action
Enables and disables display of tolerant coedges within an view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:tcoedges [view=active] [edge-on-off])

Arg Types
view view
edge-on-off boolean

Returns
view

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:tcoedges?

Action
Determines if tolerant coedges are displayed in a view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:tcoedges? [view=active])

Arg Types
view view

Returns
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:vertices

Action
Enables and disables display of vertices.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:vertices [view=active] [vertices])

Arg Types
view view
vertices boolean

Returns
view

Arguments
The vertices argument enables (#t) and disables (#f) vertex display on a per model basis.
; 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:vertices?

Action
Determines if vertices are displayed in the view.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:vertices? [view=active])

Arg Types
view view

Returns
boolean
; 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]


view:zoom-window

Action
Zooms a view to a size defined by two pick events.

Filename
scm/scmext/habridge/view_scm.cpp

APIs
None

Syntax
(view:zoom-window event1 event2 [view=active])

Arg Types
event1 pick-event
event2 pick-event
view view

Returns
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.

Arguments
The arguments event1 and event2 specify the type of pick event used, typically, the mouse (read event).
 
The optional argument view specifies the view to zoom, and it defaults to the active view. This allows the user to specify a region in one view, yet zoom a different view. The two events must be within the same window. The zoom affect is achieved by panning the view and offsetting both the eye position and the target by the same gvector. It then enlarges the display image and reduces the view width and height by the same factor. A view:refresh is needed to visualize the changes.
; 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]