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.

acis:test

Action
Initiates and runs the current functionality tests in the examples test suite.

Filename
scm/scmext/smoke/acis_test_scm.cpp

APIs
None

Syntax
(acis:test type | date | test-name)

Arg Types
type string
date string
test-name string

Returns
boolean

Description
This Scheme extension executes one or more of the available example tests. The Scheme extensions in the example test suite can be used to test API functionality, and are sometimes known as "smoke tests." The source code for these Scheme extensions illustrates the way APIs can be used in C++ applications.

This Scheme extension is for test purposes only. Entities created here are temporary and cannot be retained.

Arguments
The optional arguments allow you to specify one of three types of testing: run a predefined set of examples by level of functionality (type); or display a previously run set of examples by date (date); or run a specific test by name (test-name).

The string type defines the level of functionality to be tested. The valid strings are:
"fast" Runs a minimum level of tests
"smoke" Runs an intermediate level of tests
"all" Runs all of the tests in the example test suite

Passing in a date returns the tests run on or before the specified date. date must be a numeric string of the format "yyyymmdd", where yyyy is the year, mm is the month, and dd is the day.

The string test-name allows you to specify an individual test or level of functionality to be tested. A quoted question mark ("?") generates a list of valid strings for this argument. Also, running any of the "fast", "smoke", or "all" tests displays the name of the individual tests as each one is executed.

Limitations
The functionality tests are currently only available for blending, skinning/lofting, and sweeping.
; acis:test
; Initiate and run the functionality tests.
(acis:test "fast")
; Running test: blend_diamante
;Demonstrates:
;      chamfering
;      api_delete_blends
;      api_set_const_rounds
; .
; .
; .
;; #t

[Top]


blend:test

Action
Tests and demonstrates the blending functionality.

Filename
scm/scmext/smoke/blend_examples_scm.cpp

APIs
None

Syntax
(blend:test [type | date | test-name] [dojournal])

Arg Types
type string
date string
test-name string
dojournal boolean

Returns
integer | boolean

Description
This Scheme extension tests and demonstrates the blending functionality by running a series of examples. This Scheme extension is for test purposes only. Entities created here are temporary and cannot be retained.

Arguments
The optional arguments allow you to specify one of three types of testing: run a predefined set of examples by level of functionality (type); or display a previously run set of examples by date (date); or run a specific test by name (test-name).

The string type defines the level of functionality to be tested. The valid strings are:
"fast" Runs a minimum level of tests
"smoke" Runs an intermediate level of tests
"all" Runs all of the blend tests in the example test suite

Passing in a date returns the tests run on or before the specified date. date must be a numeric string of the format "yyyymmdd", where yyyy is the year, mm is the month, and dd is the day.

The string test-name allows you to specify an individual test or level of functionality to be tested. When no arguments are defined with this command, the list of valid strings for this argument are displayed. Also, running any of the "fast", "smoke", or "all" tests displays the name of the individual tests as each one is executed. The name string of an option demonstrates that particular option. The name string of an obsolete API demonstrates how it can be replaced with the newer function.

The dojournal function generates the journaling file of the examples executed.
; blend:test
; Tests the blending functionality.
; Display list of blend options.
(blend:test)
; The list of blend tests and options are displayed.
; Please pass in one of the following strings.
; To test options or functionality:
; variable_radius_blend
; chamfering
; lop_attribute
; blending_splines
; blend_entities
; To test APIs:
; api_smooth_edge_seq
; .
; .
; .
; For thorough testing pass in "all". For faster
; but less thorough testing (smoke test) pass
; in "smoke". For fast testing pass in "fast".
; Pass in a date (yyyymmdd) to run tests
; that were made prior to or on that date.
;; 0

[Top]


journal:test

Action
Tests and demonstrates the journaling functionality.

Filename
scm/scmext/smoke/journaling_examples_scm.cpp

APIs
None

Syntax
(journal:test [type | date | test-name])

Arg Types
type string
date string
test-name string

Returns
integer | boolean
; journal:test
; No example available at this time

[Top]


lop:test

Action
Tests and demonstrates the local operations functionality.

Filename
scm/scmext/smoke/lop_examples_scm.cpp

APIs
None

Syntax
(lop:test name [do-journal])

Arg Types
name string
do-journal boolean

Returns
integer | boolean

Description
This extension tests and demonstrates the local operations functionality. The name string allows you to specify which functionality to demonstrate. Other parameters are all optional and specific to the test. If no name string is defined, a list of the possible options is displayed.

Arguments
The name string "all" generates a test which runs through every routine automatically.

The logical flag do-journal specifies to journal the example, which will be created in the working directory (must be the last argument).
; lop:test
; Test the local operations functionality
; Display list of local operations options
(lop:test)
; The list of local operations options is displayed
;; 0
; Test all the local operations option routines at
; once
(lop:test "all")
;; 30

[Top]


pattern:test

Action
Tests and demonstrates the pattern functionality of ACIS.

Filename
scm/scmext/smoke/pattern_examples_scm.cpp

APIs
None

Syntax
(pattern:test [type | date | test-name] [index=-1])

Arg Types
type string
date string
test-name string
index integer

Returns
integer | integer

Description
This Scheme extension tests and demonstrates the pattern functionality of ACIS by running a series of examples. The first set of optional arguments allows the user to specify one of three types of testing: run a predefined set of examples by level of functionality (type); display a previously run set of examples by date (date); or run a specific test by name (test-name). As there is more than one set of pattern tests, the user may supply an additional argument index to specify which set is to be run. If index is omitted, or set to -1, all sets are run. Other valid values are currently 0, 1, and 2. The extension returns the number of bodies created by the test.

This Scheme extension is for test purposes only. Entities created here are temporary and cannot be retained.

Arguments
The string type defines the level of functionality to be tested. The valid strings are:
"fast" runs a minimum level oftests
"smoke" runs an intermediate level of tests
"all" runs all of the tests in the example test suite

Passing in a date runs the tests created on or before the specified date. The argument date must be a numeric string in the format "yyyymmdd", where yyyy is the year, mm is the month, and dd is the day.

The string test-name allows the user to specify an individual test or level of functionality to be tested. When no arguments are supplied with this command, the list of valid strings for this argument is displayed. Running any of the "fast", "smoke", or "all" tests displays the name of the individual tests as each one is executed. The name string of an option demonstrates that particular option. The name string of an obsolete API demonstrates how it can be replaced with a newer function.
; pattern:test
; Test the pattern functionality
; Display list of pattern options
(pattern:test)
; The list of pattern options is displayed
;; 0
; Display and run the "pat_linear_1d"
; functionality test
(pattern:test "pat_linear_1d")
;; Running test: pat_linear_1d
;; Demonstrates:
;;  api_linear_pattern?Entity check results:
;;  checks clean1
; Clear the image.
(part:clear)
;; #t
; Display and run the "api_linear_pattern"
; functionality test
(pattern:test "api_linear_pattern")
; Each routine using "api_linear_pattern" is
; tested and displayed consecutively.
;; 48
; Test all the pattern option routines
(pattern:test "all")
; Each routine is tested and displayed consecutively.
;; 123
; Clear the image.
(part:clear)
;; #t
; Test all the pattern option routines in set #1
(pattern:test "all" 1)
; Each routine in set #1 is tested and
; displayed consecutively.
;; 36

[Top]


skin:test

Action
Tests and demonstrates the skinning and lofting functionality (in the Advanced Surfacing Component).

Filename
scm/scmext/smoke/skin_examples_scm.cpp

APIs
None

Syntax
(skin:test [type | date | test-name])

Arg Types
type string
date string
test-name string

Returns
(entity | entity ...) | boolean

Description
This Scheme extension tests and demonstrates the skinning and lofting (Advanced Surfacing) functionality by running a series of examples. The optional arguments allow you to specify one of three types of testing: run a predefined set of examples by level of functionality (type); or display a previously run set of examples by date (date); or run a specific test by name (test-name).

This command tests the following options: ruled, virtual guides, perpendicular, periodic, and closed.  This command tests the following functionality: path, draft, guide, laws, mapping curves, vertex modification, tanfac estimation, skinning interface, and lofting interface.

The two required files are: scm/scmext/smoke/test_utl.cpp, skin/skin_scm/test_utl.hxx

This Scheme extension is for test purposes only. Entities created here are temporary and cannot be retained.

Arguments
The string type defines the level of functionality to be tested. The valid strings are:
"fast" Runs a minimum level of tests
"smoke" Runs an intermediate level of tests
"all" Runs all of the skinning tests in the example test suite

Passing in a date returns the tests run on or before the specified date. date must be a numeric string of the format "yyyymmdd", where yyyy is the year, mm is the month, and dd is the day.

The string test-name allows you to specify an individual test or level of functionality to be tested. When no arguments are defined with this command, the list of valid strings for this argument are displayed. Also, running any of the "fast", "smoke", or "all" tests displays the name of the individual tests as each one is executed. The name string of an option demonstrates that particular option. The name string of an obsolete API demonstrates how it can be replaced with the newer function.
; skin:test
; Run test command without argument to display list
; of valid tests.
(skin:test)
; Please pass in one of the following strings.
; To test options or functionality:
; closed
; path
; draft
; guide
; virtual guides
; periodic
; .
; .
; .
; skin_flower
; For thorough testing pass in "all". For faster
; but less thorough testing (smoke test) pass
; in "smoke". For fast testing pass in "fast".
; Pass in a date (yyyymmdd) to run tests
; that were made prior to or on that date.
;; 0

[Top]


sweep:test

Action
Tests and demonstrates the sweeping functionality.

Filename
scm/scmext/smoke/sweep_examples_scm.cpp

APIs
None

Syntax
(sweep:test [type | date | test-name])

Arg Types
type string
date string
test-name string

Returns
integer | boolean

Description
This Scheme extension tests and demonstrates the sweeping functionality by running a series of examples. The optional arguments allow you to specify one of three types of testing: run a predefined set of examples by level of functionality (type); or display a previously run set of examples by date (date); or run a specific test by name (test-name).

This Scheme extension is for test purposes only. Entities created here are temporary and cannot be retained.

Arguments
The string type defines the level of functionality to be tested. The valid strings are:
"fast" Runs a minimum level of tests
"smoke" Runs an intermediate level of tests
"all"  Runs all of the sweeping tests in the example test suite

Passing in a date returns the tests run on or before the specified date. date must be a numeric string of the format "yyyymmdd", where yyyy is the year, mm is the month, and dd is the day.

The string test-name allows you to specify an individual test or level of functionality to be tested. When no arguments are defined with this command, the list of valid strings for this argument are displayed. Also, running any of the "fast", "smoke", or "all" tests displays the name of the individual tests as each one is executed. The name string of an option demonstrates that particular option. The name string of an obsolete API demonstrates how it can be replaced with the newer function.
; sweep:test
; Test the sweeping functionality.
; Display list of sweep options.
(sweep:test)
; The list of sweep options is displayed.
;; 0
; Display and run the "bool_type"
; functionality test.
(define test1 (sweep:test "bool_type"))
;; test1
; Clear the image.
(part:clear)
;; #t
; Display and run the "api_rsw_face_path"
; functionality test.
(define test2 (sweep:test "api_rsw_face_path"))
;; test2
; Clear the image.
(part:clear)
;; #t
; Test all the sweep option routines at once
(sweep:test "all")
;; 30

[Top]


warp:test

Action
Tests and demonstrates warping functionality.

Filename
scm/scmext/smoke/warp_examples_scm.cpp

APIs
None

Syntax
(warp:test name)

Arg Types
name string

Returns
entity | entity ...

Description
This extension tests and demonstrates the warping functionality. The string name allows the user to specify which functionality is going to be tested. If no string is passed, a list of possible input is displayed.

; warp:test
; No example available at this time.

[Top]