Scheme Extensions Aa thru Ez

 

 

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.

acisoptions:set

Action
Sets the parameters in an acis_options scheme object.

Filename
scm/scmext/kern/acisoptions_scm.cpp

APIs
api_set_acis_options

Syntax
(acisoptions:set [acis-opts] [["option-name" option] | ...])

Arg Types
acis-opts1 acis-options
"option-name" string
acis-opts2 acis-options

Returns
acis-options

Description
Makes or edits an acis-options object, sets the option arguments, and returns a new acis-options object if no parameters are specified. If an acis-options object is passed, it is modified and returns that object.

Arguments
acis-opts1 specifies the acis-options object that has to be modified.
 
option-name is a string indicating the field in the acis-options object.
 
acis-opts2 contains the value to be set.
; acisoptions:set
; This example creates  versiontag and journal
; Scheme objects that are going to be applied
; to a sweeping operation.
(define j (acis_journal:set "file"
    "sweep_journal_example"))
;; j
(define v (versiontag 7 0 0))
;; v
(define ao (acisoptions:set "journal" j "version" v))
;; ao
(define profile (solid:block
    (position 0 0 0) (position 2 2 0)))
;; profile
(define path (wire-body:points (list (position 0 0 0)
    (position 0 0 2) (position 1 1 4))))
;; path
(define opts (sweep:options ))
;; opts
(acis_journal:start ao)
;; #t
(define journal (sweep:law profile path opts ao))
;; journal
(acis_journal:end ao)
;; #t

[Top]


acis_journal:end

Action
Ends the journaling mechanism.

Filename
scm/scmext/kern/journal_scm.cpp

APIs
api_end_journal

Syntax
(acis_journal:end acis-opts)

Arg Types
acis-opts acis-options

Returns
scheme-object

Description
Returns TRUE if operation was successful.

Arguments
acis-opts object contains the journaling information that has to be stopped.
; acis_journal:end
; set a journal file
(define j (acis_journal:set "file"
    "sweep_journal_example"))
;; j
(define v (versiontag 7 0 0))
;; v
(define ao (acisoptions:set "journal" j "version" v))
;; ao
(define b1 (solid:block (position 0 0 0)
    (position 3 1 1)))
;; b1
(define b2 (solid:block (position 2 0 0)
    (position 3 6 1)))
;; b2
(define b3 (solid:block (position 0 5 0)
    (position 3 6 1)))
;; b3
(define b4 (solid:block (position 0 0 0)
    (position 1 6 1)))
;; b4
(zoom-all)
;; #[view 1049866]
(acis_journal:start ao)
;; #t
(define u (bool:unite b1 b2 ao))
;; u
(acis_journal:pause ao)
;; #t
(define u1 (bool:unite b1 b3 ao))
;; u1
(acis_journal:resume ao)
;; #t
(define u2 (bool:unite b1 b4 ao))
;; u2
(acis_journal:end ao)
;; #t

[Top]


acis_journal:pause

Action
Pauses the journaling mechanism.

Filename
scm/scmext/kern/journal_scm.cpp

APIs
api_pause_journal

Syntax
(acis_journal:pause acis-opts)

Arg Types
acis-opts acis-options

Returns
scheme-object

Description
Returns TRUE if operation was successful.

Arguments
acis-opts object contains the journaling information that has to be paused.
; acis_journal:pause
; set a journal file
(define j (acis_journal:set "file"
    "sweep_journal_example"))
;; j
(define v (versiontag 7 0 0))
;; v
(define ao (acisoptions:set "journal" j "version" v))
;; ao
(define b1 (solid:block (position 0 0 0)
    (position 3 1 1)))
;; b1
(define b2 (solid:block (position 2 0 0)
    (position 3 6 1)))
;; b2
(define b3 (solid:block (position 0 5 0)
    (position 3 6 1)))
;; b3
(define b4 (solid:block (position 0 0 0)
    (position 1 6 1)))
;; b4
(zoom-all)
;; #[view 1049866]
(acis_journal:start ao)
;; #t
(define u (bool:unite b1 b2 ao))
;; u
(acis_journal:pause ao)
;; #t
(define u1 (bool:unite b1 b3 ao))
;; u1
(acis_journal:resume ao)
;; #t
(define u2 (bool:unite b1 b4 ao))
;; u2
(acis_journal:end ao)
;; #t

[Top]


acis_journal:resume

Action
Resumes the journaling mechanism after a pause.

Filename
scm/scmext/kern/journal_scm.cpp

APIs
api_resume_journal

Syntax
(acis_journal:resume acis-opts)

Arg Types
acis-opts acis-options

Returns
scheme-object

Description
Resumes the journaling mechanism after a pause. Returns TRUE if the operation is successful.

Arguments
acis-opts object contains the journaling information that has to be resumed.
; acis_journal:resume
; set a journal file
(define j (acis_journal:set "file"
    "sweep_journal_example"))
;; j
(define v (versiontag 7 0 0))
;; v
(define ao (acisoptions:set "journal" j "version" v))
;; ao
(define b1 (solid:block (position 0 0 0)
    (position 3 1 1)))
;; b1
(define b2 (solid:block (position 2 0 0)
    (position 3 6 1)))
;; b2
(define b3 (solid:block (position 0 5 0)
    (position 3 6 1)))
;; b3
(define b4 (solid:block (position 0 0 0)
    (position 1 6 1)))
;; b4
(zoom-all)
;; #[view 1049866]
(acis_journal:start ao)
;; #t
(define u (bool:unite b1 b2 ao))
;; u
(acis_journal:pause ao)
;; #t
(define u1 (bool:unite b1 b3 ao))
;; u1
(acis_journal:resume ao)
;; #t
(define u2 (bool:unite b1 b4 ao))
;; u2
(acis_journal:end ao)
;; #t

[Top]


acis_journal:set

Action
Sets the parameters for journaling functions.

Filename
scm/scmext/kern/journal_scm.cpp

APIs
api_set_journal_name

Syntax
(acis_journal:set [journal | acis-opts]
    ["file "filename"])

Arg Types
journal acis-journal
acis-opts acis-options
"file" string
"filename" string

Returns
acis-journal

Description
Makes or edits an acis-journal object, sets the file name, and returns a new journal object if no parameters are specified. If an acis-journal or acis-options object is passed, it is modified and returns that object.

Arguments
journal specifies the acis-journal object that has to be modified.
 
acis-opts specifies the acis-options object that has to be modified.
 
file is a string indicating the field in the acis-options or acis-journal object.
 
filename is a string containing the name of the file for the journaling operation.
; acis_journal:set
; set a journal file
(define j (acis_journal:set "file"
    "sweep_journal_example"))
;; j
(define v (versiontag 7 0 0))
;; v
(define ao (acisoptions:set "journal" j "version" v))
;; ao
(define b1 (solid:block (position 0 0 0)
    (position 3 1 1)))
;; b1
(define b2 (solid:block (position 2 0 0)
    (position 3 6 1)))
;; b2
(define b3 (solid:block (position 0 5 0)
    (position 3 6 1)))
;; b3
(define b4 (solid:block (position 0 0 0)
    (position 1 6 1)))
;; b4
(zoom-all)
;; #[view 1049866]
(acis_journal:start ao)
;; #t
(define u (bool:unite b1 b2 ao))
;; u
(acis_journal:pause ao)
;; #t
(define u1 (bool:unite b1 b3 ao))
;; u1
(acis_journal:resume ao)
;; #t
(define u2 (bool:unite b1 b4 ao))
;; u2
(acis_journal:end ao)
;; #t

[Top]


acis_journal:start

Action
Creates an acis_journal scheme-object.

Filename
scm/scmext/kern/journal_scm.cpp

APIs
api_start_journal

Syntax
(acis_journal:start acis-opts)

Arg Types
acis-opts acis-options

Returns
scheme-object

Description
Returns True if the operation is successful.

Arguments
acis-opts object contains the journaling information that has to be started.
; acis_journal:start
; set a journal file
(define j (acis_journal:set "file"
    "sweep_journal_example"))
;; j
(define v (versiontag 7 0 0))
;; v
(define ao (acisoptions:set "journal" j "version" v))
;; ao
(define b1 (solid:block (position 0 0 0)
    (position 3 1 1)))
;; b1
(define b2 (solid:block (position 2 0 0)
    (position 3 6 1)))
;; b2
(define b3 (solid:block (position 0 5 0)
    (position 3 6 1)))
;; b3
(define b4 (solid:block (position 0 0 0)
    (position 1 6 1)))
;; b4
(zoom-all)
;; #[view 1049866]
(acis_journal:start ao)
;; #t
(define u (bool:unite b1 b2 ao))
;; u
(acis_journal:pause ao)
;; #t
(define u1 (bool:unite b1 b3 ao))
;; u1
(acis_journal:resume ao)
;; #t
(define u2 (bool:unite b1 b4 ao))
;; u2
(acis_journal:end ao)
;; #t

[Top]


annotation:assert

Action
Returns an error if the specified annotation does not exist.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
None

Syntax
(annotation:assert anno-save-name [history]
    [member-name entity] ...)

Arg Types
anno-save-name string
history history
member-name string
entity entity

Returns
boolean

Errors
Annotation not found

Description
Searches the history stream for annotations of the given type as specified by the name used to save it in a SAT file. If the history stream is not specified, the stream from the active part is used. The remaining arguments are (member-name, entity) pairs. You may have as many as necessary to fully describe which entities should be in specific fields of the annotation.

If an annotation matching the description is not found, a sys_error (NO_ANNOTATION) is issued. If the described annotation does not exist, the operation returns a #t and aborts via an exception.

Arguments
anno-save-name is a string that appears in the SAT file if the annotation is saved.
 
history is the history stream where the annotation is found.
 
member-name is a string indicating the name of the entity within the annotation.
 
entity is an entity that should have the given member-name within the candidate annotation.
; annotation:assert
; Turn on annotation options
(option:set "annotation" #t)
;; #f
(option:set "unhook_annotations" #f)
;; #t
; Sweep open wire along vector
(define profile (wire-body:points
    (list (position 0 0 0) (position 10 0 0))))
;; profile
(define sweep (sweep:along-vector profile #f
    (gvector 0 0 10)))
;; sweep
; Additional Example
; Turn on annotation options
(part:clear)
;; #t
(option:set "annotation" #t)
;; #f
; Sweep open wire along vector
(define profile (wire-body:points
    (list (position 0 0 0) (position 10 0 0))))
;; profile
(define profile-edge (car (entity:edges profile)))
;; profile-edge
(define sweep (sweep:along-vector profile #f
    (gvector 0 0 10)))
;; sweep
; Pick the top-edge
(ray:queue 206.331 -403.49 211.434
    -0.408248 0.816497 -0.408248 1)
;; #[ray (206.331 -403.49 211.434)
;; (-0.408248 0.816497 -0.408248)]
; Left mouse click on the top edge
(define top-edge (pick-edge))
;; top-edge
; Assert that the profile-edge is part of a
; profile annotation. The full save name, not just
; the leaf name, followed by pairs of annotation
; member names and the entities to which they refer,
; should be there.
(define sweep_anno_edge (annotation:assert
    'sweep_anno_edge_top-sweep_annotation-annotation
    'profile profile-edge 'top_edge top-edge))
;; sweep_anno_edge

[Top]


annotation:assert-not

Action
Returns an error if the specified annotation DOES exist.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
None

Syntax
(annotation:assert-not anno-save-name [history]
    [member-name entity] ...)

Arg Types
anno-save-name string
history history
member-name string
entity entity

Returns
boolean

Errors
Bad annotation found

Description
Searches the history stream for annotations of the given type as specified by the name used to save it in a SAT file. If the history stream is not specified, the stream from the active part is used. The remaining arguments are (member-name, entity) pairs. You can have as many as necessary to fully describe which entities should be in which fields of the annotation.

If an annotation matching the description is found, a sys_error (BAD_ANNOTATION_FOUND) is issued. Returns a #t if the described annotation does not exist.

Arguments
anno-save-name argument is a string that appears in the SAT file if the annotation is saved.
 
history argument defines which history stream to search.
 
member-name argument is a string indicating the name of the entity within the annotation.
 
entity argument is an entity that should have the given member-name within the candidate annotation.
; annotation:assert-not
; annotate tests on bending.
; some resulting faces should have annotations,
; others should not.
(option:set "match_paren" #f)
;; #t
(cond ((= 0 (length (part:views))) (view:dl)))
;; #f
(define view (view:set-bg-color 7))
;; view
(part:clear)
;; #t (define block1 (solid:block (position -30 -2 -10)
    (position 40 2 10)))
;; block1
(define view-edges (view:edges #t))
;; view-edges
(define view-poly (view:polygonoffset #t))
;; view-poly
(define radius 20)
;; radius
(define bend-angle -100)
;; bend-angle
(define width 0)
;; width
(define center-bend #f)
;; center-bend
; set annotations to on
(option:set "annotation" #t)
;; #f
(option:set "unhook_annotations" #f)
;; #t
(define bend (entity:bend block1 (position 20 0 0)
    (gvector 0 0 1) (gvector 0 1 0) radius bend-angle
    width center-bend))
;; bend
; pick 6 different faces from the body with
; 6 different rays.
(define isovec
    (gvector -0.408248 0.816497 -0.408248))
;; isovec
(define r1 (ray (position 107 -247 103) isovec ))
;; r1
(define r2 (ray (position 110 -244 107) isovec ))
;; r2
(define r3 (ray (position 122 -235 113) isovec ))
;; r3
(define r4 (ray (position 142 -225 111) isovec ))
;; r4
(define r5 (ray (position 151 -221 111) isovec ))
;; r5
(define r6 (ray (position 110 -238 119) isovec ))
;; r6
(define f1 (pick:face r1 1))
;; f1
(define f2 (pick:face r2 1))
;; f2
(define f3 (pick:face r3 1))
;; f3
(define f4 (pick:face r4 1))
;; f4
(define f5 (pick:face r5 1))
;; f5
(define f6 (pick:face r6 1))
;; f6
; check for transform annotations on f1 f2 f6.
(annotation:assert
    "warp_anno_face-warp_annotation-annotation"
    "transformed_faces" f1)
;; #[entity 9 1]
(annotation:assert
    "warp_anno_face-warp_annotation-annotation"
    "transformed_faces" f2)
;; #[entity 9 1]
(annotation:assert
    "warp_anno_face-warp_annotation-annotation"
    "transformed_faces" f6)
;; #[entity 9 1]
; check for no transform annotations on f3 f4 f5.
(annotation:assert-not
    "warp_anno_face-warp_annotation-annotation"
    "transformed_faces" f3)
;; #t
(annotation:assert-not
    "warp_anno_face-warp_annotation-annotation"
    "transformed_faces" f4)
;; #t
(annotation:assert-not
    "warp_anno_face-warp_annotation-annotation"
    "transformed_faces" f5)
;; #t

[Top]


annotation:clear-all

Action
Removes all annotations.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
api_clear_annotations

Syntax
(annotation:clear-all)

Arg Types
None

Returns
unspecified
; annotation:clear-all
; Create a swept part with annotations turned on.
(option:set "annotation" #t)
;; #f
(option:set "unhook_annotations" #f)
;; #t
(define prof (edge:ellipse (position 0 0 0)
    (gvector 0 0 1) (gvector 1 0 0)))
;; prof
(define path (gvector 0 0 1))
;; path
(define swp (sweep:law prof path))
;; swp
(define face1 (list-ref (entity:faces swp) 0))
;; face1
; Confirm annotation on face.
(entity:annotations face1)
;; (#[entity 7 1])
; Unhook annotations.
(annotation:unhook-all)
;; ()
; Annotation no longer accessible through face.
(entity:annotations face1)
;; ()
; Hook annotations.
(annotation:hook-all)
;; ()
; Annotation again accessible through face.
(entity:annotations face1)
;; (#[entity 7 1])
; Clear annotations
(annotation:clear-all)
;; ()
; Annotations no longer present.
(entity:annotations face1)
;; ()

[Top]


annotation:hook-all

Action
Hooks all annotations.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
api_hook_annotations

Syntax
(annotation:hook-all)

Arg Types
None

Returns
unspecified
; annotation:hook-all
; Create a swept part with annotations turned on.
(option:set "annotation" #t)
;; #f
(option:set "unhook_annotations" #f)
;; #t
(define prof (edge:ellipse (position 0 0 0)
    (gvector 0 0 1) (gvector 1 0 0)))
;; prof
(define path (gvector 0 0 1))
;; path
(define swp (sweep:law prof path))
;; swp
(define face1 (list-ref (entity:faces swp) 0))
;; face1
; Confirm annotation on face.
(entity:annotations face1)
;; (#[entity 7 1])
; Unhook annotations.
(annotation:unhook-all)
;; ()
; Annotation no longer accessible through face.
(entity:annotations face1)
;; ()
; Hook annotations.
(annotation:hook-all)
;; ()
; Annotation again accessible through face.
(entity:annotations face1)
;; (#[entity 7 1])
; Clear annotations
(annotation:clear-all)
;; ()
; Annotations no longer present.
(entity:annotations face1)
;; ()

[Top]


annotation:inputs

Action
Returns the list of input entities for the given annotation entity.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
None

Syntax
(annotation:inputs entity [no-tags])

Arg Types
entity entity
no-tags boolean

Returns
(entity ...)

Description
Returns the list of input entities for the given annotation entity. A profile edge is an input to a sweep annotation, for example.

The option for annotation should be turned on (#t) in order for the annotations to be created during a sweep or blend operation. Likewise, the option for unhook_annotations should be turned off (#f) in order to view the annotations after the operation, otherwise they are automatically cleared out.

Arguments
entity specifies the annotation entity.
 
no-tags is an optional argument that specifies whether or not ATTRIB_TAGs is returned. If the value is false (#f), ATTRIB_TAGs is returned. Otherwise, only live entities are returned.
; annotation:inputs
; Turn on annotation options
(option:set "annotation" #t)
;; #f
(option:set "unhook_annotations" #f)
;; #t
; Create an ellipse edge.
(define profile (edge:ellipse
    (position 0 0 0) (gvector 0 0 1)
    (gvector 1 0 0)))
;; profile
; Create a linear edge.
(define path (edge:linear (position 0 0 0)
    (position 0 0 10)))
;; path
; Sweep the profile and path.
(define swp (sweep:law profile path))
;; swp
; Get a list of the edges in swp.
(define edge1 (list-ref (entity:edges swp) 0))
;; edge1
; Get a list of the annotation entities attached
; to edge1.
(define anno1 (list-ref
    (entity:annotations edge1) 0))
;; anno1
; Get the list of input entities for anno1.
(define anno_inputs (annotation:inputs anno1))
;; anno_inputs
; Get the lists of annotation names attached to
; anno_inputs.
(entity:annotation-names (list-ref anno_inputs 0))
;; ("profile" "profile")
(entity:annotation-names (list-ref anno_inputs 1))
;; ("path" "path" "path")

[Top]


annotation:member-name

Action
Returns the name of the selected entity as determined by an attached annotation attribute.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
None

Syntax
(annotation:member-name annotation entity)

Arg Types
annotation entity
entity entity

Returns
string

Description
The option for annotation should be turned on (#t) in order for the annotations to be created during a sweep or blend operation. Likewise, the option for unhook_annotations should be turned off (#f) in order to view the annotations after the operation, otherwise they are automatically cleared out.

Arguments
The annotation argument is technically an entity which is also an ANNOTATION.
 
entity specifies an entity that should have the member-name within the candidate annotation.
; annotation:member-name
; Turn on annotation options
(option:set "annotation" #t)
;; #f
(option:set "unhook_annotations" #f)
;; #t
; Create a sweep path from a wire body of edges.
(define path1 (wire-body (list (edge:linear
    (position 0 0 0) (position 0 20 0))
    (edge:ellipse (position 10 20 0)
    (gvector 0 0 -1) (gvector -10 0 0) 1 0 90)
    (edge:linear (position 10 30 0)
    (position 20 30 0)))))
;; path1
; Create the profile to use in sweeping
(define profile1 (wire-body:points (list
    (position 3 0 3) (position 3 0 -3)
    (position -3 0 -3) (position -3 0 3)
    (position 3 0 3))))
;; profile1
; Sweep the profile along the path.
(define sweep1 (sweep:law profile1 path1))
;; sweep1
(entity:set-color path1 2)
;; ()
(entity:set-color profile1 3)
;; ()
(iso)
;; #[view 10814340]
(zoom-all)
;; #[view 10814340]
; OUTPUT Original
; Create some lists for verification purposes.
(define out-sw-faces (entity:faces sweep1))
;; out-sw-faces
(define out-sw-edges (entity:edges sweep1))
;; out-sw-edges
; Select a face resulting from the sweep.
(ray:queue 89.9693 -121.78 74.672 -0.408248
    0.816497 -0.408248 1)
;; #[ray (89.9693 -121.78 74.672)
;; (-0.408248 0.816497 -0.408248)]
(define face1 (pick-face))
;; face1
(entity:set-color profile1 2)
;; ()
(entity:set-color face1 BLUE)
;; ()
(system:sleep 3500)
;; 3500
; Get the annotations associated with the face.
(define face1_annos (entity:annotations face1))
;; face1_annos
(define anno1 (list-ref face1_annos 0))
;; anno1
(entity:debug anno1)
;; "sweep_anno_edge_lat"
; Get the inputs for this annotation.
(define anno1_inputs (annotation:inputs anno1))
;; anno1_inputs
(define edge1 (list-ref anno1_inputs 0))
;; edge1
(annotation:member-name anno1 edge1)
;; "profile"
(entity:set-color edge1 6)
;; ()
(define edge2 (list-ref anno1_inputs 1))
;; edge2
(annotation:member-name anno1 edge2)
;; "path"
; Get the outputs for this annotation
(define anno1_outputs (annotation:outputs anno1))
;; anno1_outputs
(annotation:member-name anno1
    (list-ref anno1_outputs 0))
;; "lateral_face"
(annotation:member-name anno1 face1)
;; "lateral_face"
; Find member names of a specific entity for
; all the associated annotations.
(entity:annotation-names edge1)
;; ("profile" "profile" "profile" "profile")
(entity:annotation-names edge2)
;; ("path" "path" "path" "path" "path" "path" "path"
;; "path" "path" "path" "path" "path" "path" "path"
;; "path" "path")

Figure. annotation:member-name

[Top]


annotation:outputs

Action
Returns the list of output entities for the given annotation entity.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
None

Syntax
(annotation:outputs annotation)

Arg Types
annotation entity

Returns
(entity ...)

Description
Returns the list of output entities for the given annotation entity. A lateral face from a profile edge is an output from a sweep annotation, for example.

The option for annotation should be turned on (#t) in order for the annotations to be created during a sweep or blend operation. Likewise, the option for unhook_annotations should be turned off (#f) in order to view the annotations after the operation, otherwise they are automatically cleared out.

Arguments
The annotation argument is technically an entity which is also an ANNOTATION.
; annotation:outputs
; Turn on annotation options
(option:set "annotation" #t)
;; #f
(option:set "unhook_annotations" #f)
;; #t
; Create a sweep path from a wire body of edges.
(define path1 (wire-body (list (edge:linear
       (position 0 0 0) (position 0 20 0))
    (edge:ellipse (position 10 20 0)
       (gvector 0 0 -1) (gvector -10 0 0) 1 0 90)
    (edge:linear (position 10 30 0)
       (position 20 30 0)))))
;; path1
; Create the profile to use in sweeping
(define profile1 (wire-body:points (list
    (position 3 0 3) (position 3 0 -3)
    (position -3 0 -3) (position -3 0 3)
    (position 3 0 3))))
;; profile1
; Sweep the profile along the path.
(define sweep1 (sweep:law profile1 path1))
;; sweep1
(entity:set-color path1 2)
;; ()
(entity:set-color profile1 3)
;; ()
(iso)
;; #[view 10814340]
(zoom-all)
;; #[view 10814340]
; OUTPUT Original
; Create some lists for verification purposes.
(define out-sw-faces (entity:faces sweep1))
;; out-sw-faces
(define out-sw-edges (entity:edges sweep1))
;; out-sw-edges
; Select a face resulting from the sweep.
(ray:queue 89.9693 -121.78 74.672 -0.408248
    0.816497 -0.408248 1)
;; #[ray (89.9693 -121.78 74.672)
;;  (-0.408248 0.816497 -0.408248)]
(define face1 (pick-face))
;; face1
(entity:set-color profile1 2)
;; ()
(entity:set-color face1 BLUE)
;; ()
(system:sleep 3500)
;; 3500
; Get the annotations associated with the face.
(define face1_annos (entity:annotations face1))
;; face1_annos
(define anno1 (list-ref face1_annos 0))
;; anno1
(entity:debug anno1)
;; "sweep_anno_edge_lat"
; Get the inputs for this annotation.
(define anno1_inputs (annotation:inputs anno1))
;; anno1_inputs
(define edge1 (list-ref anno1_inputs 0))
;; edge1
(annotation:member-name anno1 edge1)
;; "profile"
(entity:set-color edge1 6)
;; ()
(define edge2 (list-ref anno1_inputs 1))
;; edge2
(annotation:member-name anno1 edge2)
;; "path"
; Get the outputs for this annotation
(define anno1_outputs (annotation:outputs anno1))
;; anno1_outputs
(annotation:member-name anno1
    (list-ref anno1_outputs 0))
;; "lateral_face"
(annotation:member-name anno1 face1)
;; "lateral_face"
; Find member names of a specific entity for
; all the associated annotations.
(entity:annotation-names edge1)
;; ("profile" "profile" "profile" "profile")
(entity:annotation-names edge2)
;; ("path" "path" "path" "path" "path" "path" "path"
;; "path" "path" "path" "path" "path" "path" "path"
;; "path" "path")

[Top]


annotation:unhook-all

Action
Unhooks all annotations.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
api_unhook_annotations

Syntax
(annotation:unhook-all)

Arg Types
None

Returns
unspecified
; annotation:unhook-all
; Create a swept part with annotations turned on.
(option:set "annotation" #t)
;; #f
(option:set "unhook_annotations" #f)
;; #t
(define prof (edge:ellipse (position 0 0 0)
    (gvector 0 0 1) (gvector 1 0 0)))
;; prof
(define path (gvector 0 0 1))
;; path
(define swp (sweep:law prof path))
;; swp
(define face1 (list-ref (entity:faces swp) 0))
;; face1
; Confirm annotation on face.
(entity:annotations face1)
;; (#[entity 7 1])
; Unhook annotations.
(annotation:unhook-all)
;; ()
; Annotation no longer accessible through face.
(entity:annotations face1)
;; ()
; Hook annotations.
(annotation:hook-all)
;; ()
; Annotation again accessible through face.
(entity:annotations face1)
;; (#[entity 7 1])
; Clear annotations
(annotation:clear-all)
;; ()
; Annotations no longer present.
(entity:annotations face1)
;; ()

[Top]


arc:center

Action
Gets the center position of a circular curve or edge of an elliptical curve or edge.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(arc:center arc)

Arg Types
arc elliptical-curve | elliptical-edge

Returns
position

Description
Circular curves and edges are subsets of elliptical curves and edges.

Arguments
arc specifies an elliptical-curve or an elliptical-edge.
; arc:center
; Create a circular edge.
(define arc1
    (edge:circular
    (position 15 25 0) 25 0 185))
;; arc1
; Get the center of the edge.
(arc:center arc1)
;; #[position 15 25 0]

[Top]


arc:end-angle

Action
Gets the end angle of a circular curve or edge or an elliptical curve or edge.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(arc:end-angle arc)

Arg Types
arc elliptical-curve | elliptical-edge

Returns
real

Description
This extension returns the end angle of the elliptical curve or edge in degrees. Circular curves and edges are subsets of elliptical curves and edges.

Arguments
arc specifies an elliptical-curve or an elliptical-edge.
; arc:end-angle
; Create a circular edge.
(define arc1
    (edge:circular
    (position 15 25 0) 25 0 185))
;; arc1
; Get the end angle of the edge.
(arc:end-angle arc1)
;; 185

[Top]


arc:major-axis

Action
Gets the gvector of the major axis of an elliptical curve or edge.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(arc:major-axis arc)

Arg Types
arc elliptical-curve | elliptical-edge

Returns
gvector

Description
Returns the gvector of the major axis of an elliptical curve or edge. The gvector is measured from the center position to the starting position of the underlying full curve. If the ellipse has a ratio greater than 1 (major axis to minor axis), then the returned gvector specifies the direction of the ellipse's minor axis.

Arguments
arc specifies an elliptical-curve or an elliptical-edge.
; arc:major-axis
; Create a circular edge.
(define arc1
    (edge:circular
    (position 15 25 0) 25 0 185))
;; arc1
; Get the gvector of the major axis of the edge.
(arc:major-axis arc1)
;; #[gvector 25 0 0]

[Top]


arc:radius

Action
Gets the radius of a circular curve or edge or an elliptical curve or edge.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(arc:radius arc)

Arg Types
arc elliptical-curve | elliptical-edge

Returns
real

Description
Circular curves and edges are subsets of elliptical curves and edges. The radius is measured from the center position to the starting position of the underlying full curve. If the ellipse has a ratio greater than 1 (major axis to minor axis), then the returned value specifies half of the ellipse's minor axis length.

Arguments
arc specifies an elliptical-curve or an elliptical-edge.
; arc:radius
; Create a circular edge.
(define arc1
    (edge:circular
    (position 15 25 0) 25 0 185))
;; arc1
; Get the radius of the edge.
(arc:radius arc1)
;; 25

[Top]


arc:start-angle

Action
Gets the start angle of a circular curve or edge or an elliptical curve or edge.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(arc:start-angle arc)

Arg Types
arc elliptical-curve | elliptical-edge

Returns
real

Description
This extension returns the start angle in degrees. Circular curves and edges are subsets of elliptical curves and edges.

Arguments
arc specifies an elliptical-curve or an elliptical-edge.
; arc:start-angle
; Create a circular edge.
(define arc1
    (edge:circular
    (position 15 25 0) 25 0 185))
;; arc1
; Get the start angle of the edge.
(arc:start-angle arc1)
;; 0
; Set the start angle of the edge.
(define arc (arc:set-start arc1 45))
;; arc
(arc:start-angle arc1)
;; 45

[Top]


body?

Action
Determines if a scheme-object is a body.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
None

Syntax
(body? object)

Arg Types
object scheme-object

Returns
boolean

Description
This extension returns #t if the object is a body; otherwise, it returns #f.

Arguments
object specifies a scheme-object that has to be queried for a body.
; body?
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 15 15 15)))
;; block1
; Determine if the solid block is a body.
(body? block1)
;; #t

[Top]


body:copy

Action
Copies any body and all bodies attached to it.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_copy_body

Syntax
(body:copy body [part] [ao])

Arg Types
body body
part part
ao acis-options

Returns
entity

Description
This extension returns a single body, which is the copy of the original body.

Arguments
body specifies the body whose transformation has to be returned.
part is an optional argument. If part is specified, then the copies are added to the part. Otherwise, the copies are added to the same part that the original body was in.
ao is an optional argument that enables journaling and versioning options.
; body:get-transform
; create a solid block
(define block1 (solid:block (position 0 0 0) (position 10 10 5)))
;; block1
; make a copy of block1
(define copy1 (body:copy block1))
; copy1

[Top]


body:get-transform

Action
Returns the transform attached to a body.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
None

Syntax
(body:get-transform body)

Arg Types
body body

Returns
transform | boolean

Description
If there is not a transform the command will return a #f.

Arguments
body specifies the body whose transformation has to be returned.
; body:get-transform
; Define and body and get the transform
; attached to it.
(define b
    (solid:block
    (position 0 0 0)
    (position 10 10 10)))
;; b
(body:get-transform b)
;; #[transform 761912]

[Top]


cache:stats

Action
Displays int_cur and spl_sur global cache statistics.

Filename
kern/kern_scm/gcmgr_scm.cpp

APIs
None

Syntax
(cache:stats)

Arg Types
None

Returns
List of pairs (( str1 . int1) (str2 . int2) ... ) where str1, str2, ... are strings and int1, int2, ... are associated integer values.

Description
Displays int_cur and spl_sur global cache statistics.

Example

; get cache statistics
(cache:stats)
;; (("ic-actual-size" . 98) ("ic-alloc-size" . 100) ("ic-max-size" . 100)
;; ("ic-run-mode" . 1) ("ss-actual-size" . 85) ("ss-alloc-size" . 100)
;; ("ss-max-size" . 100) ("ss-run-mode" . 1))

[Top]


coedge?

Action
Determines if a scheme-object is a coedge.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(coedge? object)

Arg Types
object scheme-object

Returns
boolean

Description
This extension returns #t if the object is a coedge; otherwise, it returns #f.

Arguments
object specifies a scheme-object that has to be queried for a coedge.
; coedge?
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 10 10 10)))
;; block1
; Determine if the solid block is a coedge.
(coedge? block1)
;; #f
; Find the coedges of the solid block.
(define coedges1 (entity:coedges block1))
;; coedges1
; Determine if a coedge of the solid block is
; actually a coedge.
(coedge? (car coedges1))
;; #t

[Top]


coedge:types

Action
Prints a table of all coedges in the current part, including their containing entities and pcurve types.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
api_get_active_part, api_get_coedges

Syntax
(coedge:types)

Arg Types
None

Returns
string
; coedge:types
; Create a solid cylinder
(define solid (solid:cylinder
    (position 0 0 0) (position 0 0 30) 30))
;; solid
; get a list of the coedge types
(coedge:types)
;; #t

[Top]


curve:bs3-eval-arc-3curve

Action
Returns the radius and center of an arc tangent to three co-planar bs3curves. One or two of the curves may degenerate to a point.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:bs3-eval-arc-3curve curve-list point-list
    param-list normal)

Arg Types
curve-list edge | (edge ...)
point-list position | (position ...)
param-list real | (real ...)
normal gvector

Returns
boolean

Description
All three B-splines must lie in the same plane. There are potentially many circles lying tangent to the three curves. param-list provides starting guesses for the parameter value at the point of tangency.

Arguments
curve-list is a list containing the input bs3curves.
 
point-list is a list containing the input points if one or two of the curves is a point.
 
param-list is a list that provides starting guesses for the parameter value at the point of tangency.
 
normal is a gvector representing the normal to the plane of the curves.
; curve:bs3-eval-arc-3curve
; Create spline edges.
(define spl1 (edge:spline (list
    (position 0 0 0) (position 5 5 0)
    (position 10 15 0) (position 15 20 0)
    (position 20 15 0) (position 25 5 0)
    (position 30 0 0))))
;; spl1
(define spl2 (edge:spline (list
    (position -20 20 0) (position -15 25 0)
    (position -10 30 0) (position -5 35 0)
    (position -10 40 0) (position -15 45 0)
    (position -20 50 0))))
;; spl2
(define spl3 (edge:spline (list
    (position 50 20 0) (position 45 25 0)
    (position 40 30 0) (position 35 35 0)
    (position 40 40 0) (position 45 45 0)
    (position 50 50 0))))
;; spl3
(curve:bs3-eval-arc-3curve (list spl1 spl2
    spl3) (list) (list 10 10 10) (gvector 0 0 1))
; radius = 20.756587
; center = (15.000000 40.756587 0.000000)
;; #t

[Top]


curve:bs3-eval-tan-pt

Action
Evaluates the straight line, which is tangent to a planar bs3curve, and passes it through the given point.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:bs3-eval-tan-pt curve point guess-param)

Arg Types
curve edge
point position
guess-param real

Returns
position

Description
Determines a position on a bs3_curve where a line from a given position is tangent to the curve. Uses a guess parameter value to aid the solution (especially where there are multiple solutions).

Arguments
curve is the input bs3_curve whose tangent position has to be determined.
 
point is the input position that lies on the required line.
 
guess-param is the guess parameter value to aid the solution (especially where there are multiple solutions).
; curve:bs3-eval-tan-pt
; Create a spline edge.
(define spl (edge:spline (list
    (position 0 0 0) (position 5 5 0)
    (position 10 15 0) (position 15 20 0)
    (position 20 15 0) (position 25 5 0)
    (position 30 0 0))))
;; spl
; Determine the tangent point on the curve that
; passes through the position (0 25 0).
(curve:bs3-eval-tan-pt spl (position 0 25 0) 20)
;; #[position 15.6785064292946 19.8870807275491 0]

[Top]


curve:circular?

Action
Determines if a scheme-object is a curve:circular.

Filename
scm/scmext/kern/qgom_scm.cpp

APIs
None

Syntax
(curve:circular? object)

Arg Types
object scheme-object

Returns
boolean

Description
This extension returns #t if the object is a curve:circular; otherwise, it returns #f.

Arguments
object specifies the scheme-object that has to be queried for circularity.
; curve:circular?
; Create a circular curve.
(define curve1
    (curve:circular
    (position 0 0 0) 25 (gvector 0 1 0)))
;; curve1
; Determine if it is indeed a circular curve.
(curve:circular? curve1)
;; #t

[Top]


curve:domain

Action
Determines the domain of an edge's curve.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(curve:domain edge)

Arg Types
edge edge

Returns
unspecified

Description
Given an edge, returns the underlying curve's domain.

Arguments
edge specifies an edge.
; curve:domain
; ; Create a circular curve.
; Define an edge
(define ellipse1
    (edge:elliptical (position 15 15 0)
    (position 25 15 0) 2 0 270))
;; ellipse1
; Determine the domain of the edge
(curve:domain ellipse1)
; -3.1415926535898 : 3.1415926535898
;; ()

[Top]


curve:elliptical?

Action
Determines if a scheme-object is a curve:elliptical.

Filename
scm/scmext/kern/qgom_scm.cpp

APIs
None

Syntax
(curve:elliptical? object)

Arg Types
object scheme-object

Returns
boolean

Description
This extension returns #t if the object is a curve:elliptical; otherwise, it returns #f.

Arguments
object specifies the scheme-object that has to be queried for ellipticity.
; curve:elliptical?
; Create elliptical edge 1.
(define edge1
    (edge:elliptical (position 0 0 0)
    (position 20 0 0) .75 0 180))
;; edge1
; Create circular edge 2.
(define edge2
    (edge:circular
    (position 0 0 0) 20 0 180))
;; edge2
; Determine if edge1 is an elliptical curve.
(curve:elliptical? (curve:from-edge edge1))
;; #f
; Determine if edge2 is an elliptical curve.
(curve:elliptical? (curve:from-edge edge2))
;; #t

[Top]


curve:end-param

Action
Gets the end parameter of an edge or a curve.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:end-param edge-or-curve)

Arg Types
edge-or-curve curve | edge

Returns
real

Errors
EDGE with no CURVE

Description
The parameterization of all curves is normalized to lie in the interval 0 to 1; therefore, a return parameter=0 indicates the start point of the curve. This extension returns the end parameter as a real.

Arguments
edge-or-curve specifies an edge or a curve.
; curve:end-param
; Create a circular edge.
(define edge1
    (edge:circular
    (position 0 0 0) 25 0 185))
;; edge1
; Get the end parameter of the edge.
(curve:end-param edge1)
;; 3.22885911618951

[Top]


curve:end-pos

Action
Gets the end position of an edge or a curve.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:end-pos edge-or-curve)

Arg Types
edge-or-curve curve | edge

Returns
position

Errors
EDGE with no CURVE

Description
Returns the end position of an edge or a curve.

Arguments
edge-or-curve specifies an edge or a curve.
; curve:end-pos
; Create a circular edge.
(define edge1
    (edge:circular
    (position 0 0 0) 25 0 185))
;; edge1
; Get the end position of the edge.
(curve:end-pos edge1)
;; #[position -24.9048674522936 -2.17889356869144 0]

[Top]


curve:end-tan

Action
Gets the end tangent of an edge or a curve.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:end-tan edge-or-curve)

Arg Types
edge-or-curve curve | edge

Returns
gvector

Errors
EDGE with no CURVE

Description
Returns the end tangent of an edge or a curve.

Arguments
edge-or-curve specifies an edge or a curve.
; curve:end-tan
; Create a circular edge.
(define edge1
    (edge:circular
    (position 0 0 0) 25 0 185))
;; edge1
; Get the tangent end of the edge.
(curve:end-tan edge1)
;; #[gvector 0.0871557427476575 -0.996194698091746 0]

[Top]


curve:eval

Action
Evaluates an edge or a curve at the specified parameter and number of derivatives.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:eval edge-or-curve parameter [integer-type])

Arg Types
edge-or-curve curve | edge
parameter real
integer-type integer

Returns
(position) | (position gvector) | (position gvector gvector)

Errors
EDGE with no CURVE

Description
This extension expects a normalized parameter value; that is, a value that has been mapped from the true parameter range of the curve to the interval 0 to 1. For example, evaluating at parameter=0 returns the start point of the curve.

Arguments
edge-or-curve specifies an edge or a curve.
 
parameter specifies the length of the curve to evaluate. If the specified parameter lies outside the range 0 to 1, this extension returns an implicit position. A spline can only reliably be evaluated for parametric values from 0 to 1; if parameter is outside of this range for a spline edge, the returned value is meaningless.
 
integer-type is 0, 1, or 2 and specifies how many derivatives to compute. 0 evaluates only the position on the curve; 1 evaluates the position and first derivative [tangent]; or 2 evaluates the position and the first and second derivatives.
; curve:eval
; Create a circular edge.
(define edge1
    (edge:circular
    (position 0 0 0) 25 0 185))
;; edge1
; Evaluate the edge at various
; parameters and derivatives.
(curve:eval edge1 0.45 0)
;; (#[position 2.93843493644595 24.8267114238732 0])
(curve:eval edge1 0.45 1)
;; (#[position 2.93843493644595 24.8267114238732 0]
;; #[gvector -80.1619535059791 9.48779243187324 0])
(curve:eval edge1 0.45 2)
;; (#[position 2.93843493644595 24.8267114238732 0]
;; #[gvector -80.1619535059791 9.48779243187324 0]
;; #[gvector -30.6347450861677 -258.83165434934 0])

[Top]


curve:eval-curvature

Action
Evaluates the curvature vector of an edge at the specified parameter.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:eval-curvature edge parameter)

Arg Types
edge-or-curve curve | edge
parameter real

Returns
gvector

Errors
EDGE with no CURVE

Description
The parameterization of all curves is normalized to lie in the interval 0 to 1; therefore, evaluating at parameter=0 indicates the start point of the curve.

Arguments
edge-or-curve specifies an edge or a curve.
 
parameter specifies the length of the curve to evaluate. If the specified parameter lies outside the range 0 to 1, this extension returns an implicit position. A spline can only reliably be evaluated for parametric values from 0 to 1; if parameter is outside of this range for a spline edge, the returned value is meaningless.
; curve:eval-curvature
; Create a circular edge.
(define edge1 edge:circular
(position 0 0 0) 38 0 100))
;; edge1
; Evaluate the curvature at a specific parameter.
(curve:eval-curvature edge1 0.23)
;; #[gvector -0.024223811932959 -0.0102823981181388 0]

[Top]


curve:eval-pos

Action
Evaluates an edge or a curve at the specified parameter.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:eval-pos edge-or-curve parameter)

Arg Types
edge-or-curve curve | edge
parameter real

Returns
position

Errors
EDGE with no CURVE

Description
The parameterization of all curves is normalized to lie in the interval 0 to 1; therefore, evaluating at parameter=0 indicates the start point of the curve.

Arguments
edge-or-curve specifies an edge or a curve.
 
parameter specifies the position on the curve to evaluate. If the specified parameter lies outside the range 0 to 1, this extension returns an extrapolated position. A spline can only reliably be evaluated for parametric values from 0 to 1; if parameter is outside of this range for a spline edge, the returned value is meaningless.
; curve:eval-pos
; Create a circular edge.
(define edge1
    (edge:circular
    (position 0 0 0) 38 0 100))
;; edge1
; Evaluate the edge at a specific parameter.
(curve:eval-pos edge1 0.75)
;; #[position 9.83512371389579 36.7051813989846 0]

[Top]


curve:eval-tan

Action
Evaluates the tangent gvector of an edge or a curve at the specified parameter.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:eval-tan edge-or-curve parameter)

Arg Types
edge-or-curve curve | edge
parameter real

Returns
gvector

Errors
EDGE with no CURVE

Description
The parameterization of all curves is normalized to lie in the interval 0 to 1; therefore, evaluating at parameter=0 indicates the start point of the curve.

Arguments
edge-or-curve specifies an edge or a curve.
 
parameter specifies the position on the curve to evaluate. If the specified parameter lies outside the range 0 to 1, this extension returns an implicit gvector. A spline can only reliably be evaluated for parametric values from 0 to 1; if parameter is outside of this range for a spline edge, the returned gvector is meaningless.
; curve:eval-tan
; Create a circular edge.
(define edge1
    (edge:circular
    (position 0 0 0) 38 0 100))
;; edge1
; Evaluate the tangent at a specific parameter.
(curve:eval-tan edge1 0.23)
;; #[gvector -0.390731128489274 0.92050485345244 0]

[Top]


curve:from-edge

Action
Creates a curve from an edge entity.

Filename
scm/scmext/kern/qgom_scm.cpp

APIs
None

Syntax
(curve:from-edge edge)

Arg Types
edge edge

Returns
curve

Description
This extension creates a scheme-object containing an ACIS geometry curve class from an ENTITY class item (for example, edge).

Geometry classes must be attached to derived ENTITY class items (for example, edge) to be displayed and saved. By themselves, curve scheme-objects are useful for evaluating positional, directional, or curvature information without creating a (topology) entity.

Arguments
edge specifies an edge.
; curve:from-edge
; Create a linear edge.
(define edge1
    (edge:linear (position 0 0 0)
    (position 30 30 30)))
;; edge1
; Convert the edge to a curve data structure.
(curve:from-edge edge1)
;; #[curve 1075640854]

[Top]


curve:from-tcoedge

Action
Creates a curve from an tcoedge entity.

Filename
scm/scmext/kern/qgom_scm.cpp

APIs
None

Syntax
(curve:from-tcoedge tcoedge)

Arg Types
tcoedge tcoedge

Returns
curve

Description
This extension creates a scheme-object containing an ACIS geometry curve class from an ENTITY class item (for example, tcoedge).

Geometry classes must be attached to derived ENTITY class items (for example, tcoedge) to be displayed and saved. By themselves, curve scheme-objects are useful for evaluating positional, directional, or curvature information without creating a (topology) entity.

Arguments
tcoedge specifies a coedge.
; curve:from-tcoedge
; example not available

[Top]


curve:length

Action
Gets the length of an edge or a curve.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:length edge-or-curve [start] [end])

Arg Types
edge-or-curve curve | edge
start real
end real

Returns
real

Errors
EDGE with no CURVE
Arguments
edge-or-curve specifies an edge or a curve.
 
start is a start parameter.
 
end is an end parameter.

Note: If the parameter values for start and end are outside of 0 and 1, the curve is extrapolated. Spline curves cannot be reliably evaluated for parametric values outside of the interval 0 and 1.

; curve:length
; Create a circular edge.
(define edge1
    (edge:circular (position 0 0 0)
    35 5 205))
;; edge1
; Determine the length of the edge.
(curve:length edge1)
;; 122.173047639603

[Top]


curve:linear?

Action
Determines if a scheme-object is a linear curve.

Filename
scm/scmext/kern/qgom_scm.cpp

APIs
None

Syntax
(curve:linear? object)

Arg Types
object scheme-object

Returns
boolean

Description
This extension returns #t if the object is a linear curve; otherwise, it returns #f.

Arguments
object specifies the scheme-object that has to be queried for linearity.
; curve:linear?
; Create a linear curve, and determine if the
; resulting object is actually a linear curve.
(define curve1
    (curve:linear (position 0 0 0)
    (position 30 30 30)))
;; curve1
(curve:linear? curve1)
;; #t
(define edge1
    (edge:linear (position 0 0 0)
    (position 30 30 30)))
;; edge1
(curve:linear? edge1)
;; #f

[Top]


curve:normal

Action
Gets the normal of a given planar edge or curve.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:normal edge-or-curve)

Arg Types
edge-or-curve edge | curve

Returns
gvector

Description
This extension returns a gvector that is normal to the given curve.

Arguments
edge-or-curve specifies an edge or a curve. If the curve is linear, #f is returned. #f is also returned if the curve is nonplanar
; curve:normal
; Create a circular edge.
(define edge1
    (edge:circular
    (position 0 0 0) 25 0 185))
;; edge1
; Determine the normal to the edge.
(curve:normal edge1)
;; #[gvector 0 0 1]
; Create a linear edge.
(define edge2
    (edge:linear (position -10 -10 0)
    (position 20 20 0)))
;; edge2
; Determine the normal to the edge, which
; should return #f because it is not a curve.
(curve:normal edge2)
;; #f

[Top]


curve:param

Action
Gets the parameter value at a specified position on an edge or a curve.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:param edge-or-curve param-pos)

Arg Types
edge-or-curve edge | curve
param-pos position

Returns
real

Errors
EDGE with no CURVE

Description
This extension returns the parameter as a normalized real, ranging from 0 to 1.

Arguments
edge-or-curve specifies an edge or a curve.
 
param-pos specifies the location to compute the parameter on the curve.
; curve:param
; Create a circular edge.
(define edge1 (edge:circular
    (position 0 0 0) 25))
;; edge1
; Determine the parameter value of the curve
; at a specific position.
(curve:param edge1 (position 6 6 0))
;; 0.125

[Top]


curve:param-at-dist

Action
Gets the parameter value of a curve at an arc length distance along the curve.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:param-at-dist edge-or-curve distance [parameter=0])

Arg Types
edge-or-curve curve | edge
distance real
parameter real

Returns
real

Errors
EDGE with no CURVE

Description
This extension returns the normalized parameter as a real, ranging from 0 to 1.

Arguments
edge-or-curve specifies an edge or a curve.
 
distance specifies the arc length to compute.
 
parameter is an optional argument ranging from 0 to 1, specifying where on the curve to compute the distance. If parameter is not specified, the distance is computed from the start of the curve. If parameter is specified, the distance is computed from the input distance value and is always applied in the positive parameter direction.
; curve:param-at-dist
; Create a circular curve.
(define edge1 (edge:circular
    (position 0 0 0) 25 0 185))
;; edge1
; Determine the parameter values at specific
; distances along the curves.
(curve:param-at-dist edge1 2.5)
;; 0.0309706916286932
(curve:param-at-dist edge1 2.5 0.44)
;; 0.470970691628693
(curve:param-at-dist edge1 3 1)
;; 1.03716482995443

[Top]


curve:project-pos

Action
Gets the normal projection of a position onto an edge or curve.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:project-pos edge-or-curve in-pos [parameter=0])

Arg Types
edge-or-curve curve | edge
in-pos position
parameter real

Returns
pair (position . real)

Errors
EDGE with no CURVE

Description
This extension returns a pair (position . real). The first term position is the orthogonal projection of the input test-position onto the input curve curve. The second term real is the corresponding parameter value in the range 0 to 1.

Arguments
edge-or-curve specifies an edge or a curve.
 
in-pos specifies the location to compute the parameter on the curve.
 
parameter is an optional argument specifying the location on the curve to compute from the in-pos. If parameter is not specified, the closest parameter is computed from the start of the curve. If parameter is specified, the parameter is computed from the input in-pos value and is always applied in the positive parameter direction.
; curve:project-pos
; Create a circular edge.
(define edge1
    (edge:circular
    (position 0 0 0) 25 0 185))
;; edge1
; Compute the normal projection of two positions
; onto the edge.
(curve:project-pos edge1 (position 0 0 0) 0.63)
;; (#[position -11.174465516778 22.3636159959506 0]
;; . 0.63)
(curve:project-pos edge1 (position 25 25 25))
;; (#[position 17.6776695296637 17.6776695296637 0]
;; . 0.243243243243243)

[Top]


curve:ray-pos

Action
Gets the position on a curve closest to the pick-ray.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:ray-pos [curve pick-ray] | [entray])

Arg Types
curve curve
pick-ray ray
entray entray

Returns
pair

Errors
EDGE with no CURVE

Description
The gvector on the curve can determine which end of a curve has been picked. If (< 0.5 (cdr (curve:ray-pos pick))), the curve is picked near the start position; otherwise, it is picked near the end position. This extension returns a pair-pair, where the first element is the position on the curve closest to the input ray. The second element is the corresponding parameter of the position in the range 0 to 1.

Arguments
curve specifies the curve.
 
pick-ray specifies the ray. The ray is a position on the curve and a gvector closest to the pick.
 
entray specifies the curve and the ray. entray could be used in place of curve and pick-ray.
; curve:ray-pos
; Create a spline edge.
(define edge1
    (edge:spline (list (position 0 0 0)
    (position 0 -30 0) (position -30 18 0)) 0 45))
;; edge1
; Determine the position on the edge that
; is closest to the specified position.
(curve:ray-pos (entray edge1
    (ray (position 0 -30 0) (gvector 0 0 1))))
;; (#[position 8.88178419700125e-16 -30 0] .
;; 0.346404775941922)

[Top]


curve:start-param

Action
Gets the start parameter of an edge or curve.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:start-param edge-or-curve)

Arg Types
edge-or-curve curve | edge

Returns
real

Errors
EDGE with no CURVE

Description
This extension returns the normalized parameter value of the start of a curve or edge as a real.

Arguments
edge-or-curve specifies an edge or a curve.
; curve:start-param
; Create circular edge 1.
(define edge1
    (edge:circular
    (position 0 0 0) 25 0 185))
;; edge1
; Find circular edge 1's start parameter.
(curve:start-param edge1)
;; 0
; Create circular edge 2.
(define edge2
    (edge:circular
    (position 12 15 -3) 45 66 205))
;; edge2
; Find circular edge 2's start parameter.
(curve:start-param edge2)
;; 1.15191730631626

[Top]


curve:start-pos

Action
Gets the start position of an edge or curve.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:start-pos edge-or-curve)

Arg Types
edge-or-curve curve | edge

Returns
position

Errors
EDGE with no CURVE

Description
Returns the start position of an edge or curve.

Arguments
edge-or-curve specifies an edge or a curve.
; curve:start-pos
; Create circular edge 1.
(define edge1
    (edge:circular
    (position 0 0 0) 25 0 185))
;; edge1
; Determine circular edges 1's start position.
(curve:start-pos edge1)
;; #[position 25 0 0]
; Create circular edge 2.
(define edge2
    (edge:circular
    (position 5 10 10) 45 15 205))
;; edge2
; Determine circular edge 2's start position.
(curve:start-pos edge2)
;; #[position 48.4666621830081 21.6468570296134 10]

[Top]


curve:start-tan

Action
Gets the tangent at the start of an edge or curve.

Filename
scm/scmext/kern/crv_scm.cpp

APIs
None

Syntax
(curve:start-tan edge-or-curve)

Arg Types
edge-or-curve curve | edge

Returns
gvector

Errors
EDGE with no CURVE

Description
Returns the tangent at the start of an edge or curve.

Arguments
edge-or-curve specifies an edge or a curve.
; curve:start-tan
; Create circular edge 1.
(define edge1
    (edge:circular
    (position 0 0 0) 15 0 145))
;; edge1
; Determine circular edge 1's start tangent vector.
(curve:start-tan edge1)
;; #[gvector 0 1 0]
; Create circular edge 2.
(define edge2
    (edge:circular
    (position -5 -10 10) 35 25 245))
;; edge2
; Determine circular edge 2's start tangent vector.
(curve:start-tan edge2)
;; #[gvector -0.422618261740699 0.90630778703665 0]

[Top]


curve:transform

Action
Modifies a curve or edge by applying a transform.

Filename
scm/scmext/kern/qgom_scm.cpp

APIs
None

Syntax
(curve:transform edge-or-curve transform)

Arg Types
edge-or-curve curve | edge
transform transform

Returns
curve | edge
Arguments
edge-or-curve specifies a curve or an edge.
 
transform specifies a transformation to be applied to the curve.
; curve:transform
; Create a circular curve.
(define curve1
    (curve:circular (position 0 0 0) 8))
;; curve1
; To view this curve, attach it to an entity.
(define edge1 (edge:from-curve curve1))
;; edge1
; Modify the curve with a transform
(curve:transform curve1
    (transform:translation (gvector 0 5 0)))
;; #[curve 1075640854]
; OUTPUT Original
; To view this curve, attach it to an entity.
(define edge1 (edge:from-curve curve1))
;; edge1
; OUTPUT Result

Figure. curve:transform

[Top]


curve?

Action
Determines if a scheme-object is a curve.

Filename
scm/scmext/kern/qgom_scm.cpp

APIs
None

Syntax
(curve? object)

Arg Types
object scheme-object

Returns
boolean

Description
This extension returns #t if the object is one of the types of curves: circular, elliptical, or linear. Otherwise, it returns #f.

Arguments
object specifies the scheme-object that has to be queried for a curve.
; curve?
; Create a circular curve.
(define curve1 (curve:circular (position 0 0 0) 25))
;; curve1
; Determine if the entity is a curve.
(curve? curve1)
;; #t

[Top]


debug:all-modules

Action
Sets the debug level for all modules that have debugging turned on.

Filename
scm/scmext/kern/dbg_scm.cpp

APIs
None

Syntax
(debug:all-modules level=0 [base-level])

Arg Types
level string | integer
base-level string | integer

Returns
integer | string
Arguments
level specifies the debug level for all modules, where level is greater than or equal to the base level. The possible level values are the strings "off", "calls", "flow", "details", or "all" or an integer (0-4) corresponding to one of these strings. The default level is "off" (or 0). If level is set to 0, all modules are turned off for debug.
 
base-level is an optional argument that is set equal to level.
; debug:all-modules
; Enable all debugging levels for all modules.
(debug:all-modules "all" "all")
;; ()
(debug:all-modules "off" "off")
;; ()

[Top]


debug:file

Action
Sets debug output to be printed to the specified output device.

Filename
scm/scmext/kern/dbg_scm.cpp

APIs
None

Syntax
(debug:file [filename | "stderr" | "stdout"])

Arg Types
filename string

Returns
boolean

Description
entity:check, entity:debug, part:debug, roll:debug, and view:debug are Scheme extensions that generate debug information.

If no permissions are granted for the directory or file in question, this extension generates an error and returns #f.

Arguments
filename is an optional argument that defines the name of the path and output file. If no file extension is given for the file, a .dbg extension is added. If no filename is provided, the default for standard output is stderr. By default, stderr is the same as stdout. stdout is set by default to be the Scheme AIDE command window.
; debug:file
; Create entity 1.
(define block1
    (solid:block (position 0 0 0)
    (position 30 30 30)))
;; block1
; Redirect the debugging output to
; a file called errinfo.dbg.
(debug:file "errinfo")
;; #[file-input-output-port "errinfo.dbg"]
; Set the debug level.
(entity:debug block1 4)
;; "solid body"
; Redirect the debugging output to standard output.
(debug:file "stdout")
;; #[file-input-output-port "stdout"]

[Top]


debug:list-modules

Action
Displays the current debug level for all modules with debugging turned on. Also prints a number of such modules.

Filename
scm/scmext/kern/dbg_scm.cpp

APIs
None

Syntax
(debug:list-modules [level=off])

Arg Types
level string | integer

Returns
(pair ...)

Description
This extension returns a list of module names together with their current debug levels.

Arguments
level is an optional argument that specifies the amount of information to be supplied. The possible level values are the strings "off", "calls", "flow", "details", or "all" or an integer (0-4) corresponding to one of these strings. The default level is "off" (or 0). When level is provided, the list contains those modules at that level or greater. Otherwise, the list includes all modules.
; debug:list-modules
; List the debugging levels for all modules.
; Limit the list to 10 modules.(fluid-let ((print-length 10))
    (print (debug:list-modules "off")))
;; (("acis_to_vda" . "off")
;; ("annotation" . "off")
;; ("api" . "off")
;; ("at-pat" . "off")
;; ("atbool" . "off")
;; ("atndbool" . "off")
;; ("attrib" . "off")
;; ("bhl_anal_simg" . "off")
;; ("bhl_anal_stitch" . "off")
;; ("bhl_bend_surf" . "off") ...)

[Top]


debug:module

Action
Sets the debugging level for a module.

Filename
scm/scmext/kern/dbg_scm.cpp

APIs
None

Syntax
(debug:module module-name [level=off])

Arg Types
module-name string
level string | integer

Returns
string
Arguments
module-name specifies the name of the module. A list of possible module names can be obtained using the debug:list-modules extension.
 
level is an optional argument that specifies the amount of information to be supplied. The possible level values are the strings "off", "calls", "flow", "details", or "all" or an integer (0-4) corresponding to one of these strings. The default level is "off" (or 0).
; debug:module
; List the debugging levels for all modules.
(fluid-let ((print-length 10))
    (print (debug:list-modules)))
; Found 292 modules
; (("acis_to_vda" . "off")
; ("annotation" . "off")
; ("api" . "off")
; ("at-pat" . "off")
; ("atbool" . "off")
; ("atndbool" . "off")
; ("attrib" . "off")
; ("bhl_anal_simg" . "off")
; ("bhl_anal_stitch" . "off")
; ("bhl_bend_surf" . "off") ...)
; Set the debugging level for a module.
(debug:module "boolean" "flow")
;; "off"
; Set the debugging level for a module.
(debug:module "boolean" "off")
;; "flow"

[Top]


derived-tag:string

Action
Returns the string stored in the derived_tag.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
None

Syntax
(derived-tag:string tag)

Arg Types
tag string

Returns
string

Description
Returns the string stored in the derived_tag.

Arguments
Useful for debugging annotations since the user can tag entities before an operation and verify the correct tags are copied into the input of the annotation.
; derived-tag:string
; Create block.
(define block (solid:block (position -10 -10 -10)
    (position 10 10 10)))
;; block
; Pick an edge.
(define e (pick:edge (ray (position 0 0 0)
    (gvector 1 1 0))))
;; e
; Attach derived tag to an edge.
(define attach (entity:attach-derived-tag e
    "blend_edge"))
;; attach
; Attach a constant radius blend attribute to edge.
(define const-rad (blend:const-rad-on-edge e 6))
;; const-rad
; Set annotation option to on.
(define option1 (option:set "annotations" #t))
;; option1
(define option2 (option:set "unhook_annotations" #f))
;; option2
; Create a blend function on a blend network/list of
; edges).
(define blend (blend:network e))
;; blend
; Pick a face.
(define f (pick:face (ray (position 0 0 0)
    (gvector 1 1 0))))
;; f
(define anno (annotation:assert
    "blend_anno_edge-blend_annotation-annotation"
    "blend_face" f))
;; anno
; Get a tag string from anno.
(derived-tag:string (car
    (annotation:inputs anno #f)))
;; "blend_edge"

[Top]


dummy-name:add

Action
Adds a dummy naming attribute which can be used to test the annotation callbacks.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
None

Syntax
(dummy-name:add entity string)

Arg Types
entity entity
string string

Returns
entity
Arguments
entity specifies the entity for attaching the attribute.
 
string specifies the attribute that has to be attached.
; dummy-name:add
; Set options
(option:set 'annotations #t)
;; #f
(option:set 'unhook_annotations #f)
;; #t
; Define a profile
(define profile (wire-body:points (list
    (position 0 0 0) (position 10 0 0)
    (position 10 10 0) (position 0 10 0)
    (position 0 0 0))))
;; profile
; Define a path
(define path (edge:linear (position 0 0 0)
    (position 0 0 10)))
;; path
; Attach a DUMMY_NAME attribute to the edges of
; the profile
(define dummy (dummy-name:add (entity:edges profile)
    "ProfileEdge"))
;; dummy
; Sweep the entity
(define opt (sweep:options "draft_angle" 10
    "gap_type" "n" 'solid #t))
;; opt
(define sweep (sweep:law profile path opt))
;; sweep
; View annotations on a profile edge and verify the
; derived tag was created from the information in
; the dummy name
(map entity:debug (entity:annotations
    (car (entity:edges profile))) (make-list 100 2))
; sweep_anno_edge_top **** 471552:
;   Rollback pointer: 450936
;   Attribute list:   id_attribute 0 -10304
;   path           :   tag **** 578864
;                     tag **** 578864:
;   Rollback pointer:NULL
;   Attribute list:   NULL
;   Owning entity :   NULL
;   Previous attrib :NULL
;   Next attribute:   NULL
;   actual         :   edge **** -18120
;   StartVtx       :   point **** -12800:
;   Rollback pointer:NULL
;   Attribute list:   NULL
;   Use count      :   1
;   Coordinates       :   0, 0, 0
;   EndVtx         :   point **** -12736:
;   Rollback pointer:NULL
;   Attribute list:   NULL
;   Use count      :   1
;   Coordinate     :   0, 0, 10
;
;   profile    :   derived_tag **** 578912
;                 derived_tag **** 578912:
;   Rollback pointer:NULL
;   Attribute list:   NULL
;   Owning entity :   NULL
;   Previous attrib :NULL
;   Next attribute:   NULL
;   m_string       :   ProfileEdge
;   actual         :   edge **** -17544
;   StartVt        :   point **** -13184:
;   Rollback pointer:NULL
;   Attribute list:   NULL
;   Use count      :   1
;   Coordinates    :   0, 10, 0
;   EndVtx     ;   point **** -13512:
;   Rollback pointer:NULL
;   Attribute list:   NULL
;   Use count      :   1
;   Coordinates       :   0, 0, 0
;
;   top_edge       :   edge **** 552608
;   actual     :      edge **** 552608
;   StartVtx       :   point **** 471936:
;   Rollback pointer:NULL
;   Attribute list:   NULL
;   Use count      :   1
;   Coordinates       :   -1.7632698070846,
;                     -1.7632698070846, 10
;   EndVtx     :      point **** 523392:
;   Rollback pointer:NULL
;   Attribute list:   NULL
;   Use count      :   1
;   Coordinates       :   -1.7632698070846,
;                        11.763269807085, 10
;; ("sweep_anno_edge_top")

[Top]


edge:bs

Action
Returns the B-spline approximation information (number of control points) for an edge.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(edge:bs in-edge [extra-info=#f])

Arg Types
in-edge edge
extra-info boolean

Returns
real

Errors
-1 (when no B-spline to evaluate)
Arguments
in-edge specifies an edge.
 
extra-info is an optional argument that specifies whether or not extra information is required. If extra-info is #t, additional control point information is returned.
; edge:bs
; Create topology to illustrate command.
(define spline (edge:spline (list
    (position 0 0 0) (position 3 10 0)
    (position 8 0 0) (position 10 5 0)))))
;; spline
; Get the number of control points.
(edge:bs spline)
;; 6
; Obtain additional information for this B-spline.
(edge:bs spline #t)
; ACIS bs3_curve form open
; open B-spline of degree 3
; 6 control points:
;   (0, 0, 0), 0
;   (0.82927811664237, 5.6047496784132, 0), 10.4
;   40306508911
;   (2.546615525166, 17.211526819864, 0), 21.620
;   646396409
;   (7.4352298011772, -4.7927993036719, 0), 27.0
;   05811203544
;   (9.3707841024177, 2.5975293979431, 0), 27.00
;   5811203544
;   (10, 5, 0), 27.005811203544
;; 6

[Top]


edge:circular?

Action
Determines if a scheme-object is a circular-edge.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(edge:circular? object)

Arg Types
object scheme-object

Returns
boolean

Description
Returns #t if a scheme-object is a circular-edge.

Arguments
object specifies the scheme-object that has to be queried for a circular-edge.
; edge:circular?
; Create a circular edge.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
; Determine if the circular edge is actually
; a circular edge.
(edge:circular? edge1)
;; #t

[Top]


edge:curve?

Action
Determines if a scheme-object is a curve-edge.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(edge:curve? object)

Arg Types
object scheme-object

Returns
boolean

Errors
This extension fails only if the start and end vertices are the same.

Description
This extension tests the scheme-object to determine if the edge is also a curve or if any geometry is associated with edge of the vertex of a cone. Degenerate edges, such as those at the vertices of cones, do not have geometry.

Arguments
object specifies the scheme-object that has to be queried for a curve-edge.
; edge:curve?
; Create a circular curve, and convert it to an edge.
(define edge1
    (edge:from-curve (curve:circular
    (position 0 0 0) 25)))
;; edge1
; Determine if the result is a curve edge.
(edge:curve? edge1)
;; #t
(define block1
    (solid:block (position 0 0 0)
    (position 25 10 0)))
;; block1
; Determine if the result is a curve edge.
(edge:curve? block1)
;; #f

[Top]


edge:domain

Action
Determines the domain of an edge.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(edge:domain edge)

Arg Types
edge edge

Returns
unspecified

Description
Given an edge, returns the edge's domain.

Arguments
edge specifies an edge.
; edge:domain
; Define an edge
(define ellipse1
    (edge:elliptical (position 15 15 0)
    (position 25 15 0) 2 0 270))
;; ellipse1
; Determine the domain of the edge
(edge:domain ellipse1)
; Edge domain:
; 0 : 4.7123889803847
;; (0 4.71238898038469)

[Top]


edge:elliptical?

Action
Determines if a scheme-object is an elliptical-edge.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(edge:elliptical? object)

Arg Types
object scheme-object

Returns
boolean

Description
Returns #t if a scheme-object is an elliptical edge.

Arguments
object specifies the scheme-object that has to be queried for an elliptical-edge.
; edge:elliptical?
; Create an elliptical edge.
(define ellipse1
    (edge:elliptical (position 15 15 0)
    (position 25 15 0) 2 0 270))
;; ellipse1
; Determine if the edge is
; actually an elliptical edge.
(edge:elliptical? ellipse1)
;; #t
(define block1
    (solid:block (position 15 15 0)
    (position 25 25 10)))
;; block1
; Determine if the block is
; actually an elliptical edge.
(edge:elliptical? block1)
;; #f

[Top]


edge:linear?

Action
Determines if a scheme-object is a linear-edge.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(edge:linear? object)

Arg Types
object scheme-object

Returns
boolean

Description
Returns #t if a scheme-object is a linear-edge.

Arguments
object specifies the scheme-object that has to be queried for a linear-edge.
; edge:linear?
; Create a linear edge.
(define edge1
    (edge:linear (position 0 0 0)
    (position 40 40 0)))
;; edge1
; Determine if the object is
; actually a linear edge.
(edge:linear? edge1)
;; #t
(define block1
    (solid:block (position 0 0 0)
    (position 40 40 5)))
;; block1
; Determine if the object is
; actually a linear edge.
(edge:linear? block1)
;; #f

[Top]


edge:merge

Action
Merges two coplanar faces separated by an edge.

Filename
scm/scmext/oper/edge_oper_scm.cpp

APIs
None

Syntax
(edge:merge edge)

Arg Types
edge edge

Returns
boolean

Description
This function merges the defined edge between two coplanar surfaces.

Arguments
edge specifies an edge to be merged.

Limitations
An edge can only be moved along its adjacent faces and the body has to be a planar sheet body.
; edge:merge
; Create a wire body
(define wb (wire-body:points (list (position 0 0 0)
    (position 2 0 0) (position 2 2 0)
    (position 0 2 0) (position 0 0 0))))
;; wb
(define cover (sheet:cover-wires wb))
;; cover
(entity:set-color wb 1)
;; ()
(define e (wire-body (edge:linear
    (position 0 0 0) (position 2 2 0))))
;; e
(define unite (bool:nonreg-unite wb e))
;; unite
(zoom-all)
;; #[view 1770210]
(entity:check wb)
;; ()
;; checked:
;;      1 lumps
;;      1 shells
;;      0 wires
;;      2 faces
;;      2 loops
;;      6 coedges
;;      5 edges
;;      4 vertices
(ray:queue 0.94986 0.935112 12.0251 0 0 -1 0.209715)
;; #[ray (0.94986 0.935112 12.0251) (0 0 -1)]
(define em (pick-edge))
;; em
(edge:merge em)
;; #t
(entity:check wb)
;; ()
;; checked:
;;      1 lumps
;;      1 shells
;;      0 wires
;;      1 faces
;;      1 loops
;;      4 coedges
;;      4 edges
;;      4 vertices

[Top]


edge:min-rad

Action
Returns the minimum radius of curvature of a curve.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(edge:min-rad in-edge)

Arg Types
in-edge edge

Returns
real

Errors
-1 (when no curvature)

Description
Returns the minimum radius of curvature of a curve.

Arguments
in-edge specifies an edge.
; edge:min-rad
; Create a circular curve and convert to an edge.
(define edge1 (edge:from-curve
    (curve:circular (position 0 0 0) 15)))
;; edge1
(edge:min-rad edge1)
; Minimum Radius of Curvature: 15
;; 15
; Create a circular curve and convert to an edge.
(define edge2 (edge:from-curve
    (curve:circular (position 0 0 0) 30)))
;; edge2
(edge:min-rad edge2)
; Minimum Radius of Curvature: 30
;; 30

[Top]


edge:move

Action
Moves an edge along related faces in a sheet body.

Filename
scm/scmext/oper/edge_oper_scm.cpp

APIs
api_get_owner, api_move_edge, api_part_note_state, api_pm_start_state

Syntax
(edge:move edge dist [extend=#t])

Arg Types
edge edge
dist gvector
extend boolean

Returns
edge

Description
This Scheme command creates a parallel edge at the specified vector by creating a new edge with the same geometry and extending it. It is then imprinted in the sheet body and the old edge is merged.

Arguments
edge specifies an edge to be moved.
 
dist specifies the direction and distance.
 
If extend is set to true (#t), the edge is extended up to the limits of the surface in which it is moved. The default value is true (#t).

Limitations
An edge can only be moved along its adjacent faces and the body has to be a planar sheet body.
; edge:move
; create a wire body
(define wb (wire-body:points (list (position 0 0 0)
    (position 2 0 0) (position 2 2 0)
    (position 0 2 0) (position 0 0 0))))
;; wb
(define cover (sheet:cover-wires wb))
;; cover
(entity:set-color wb 1)
;; ()
(define e (wire-body (edge:linear
    (position 0 0 0) (position 2 2 0))))
;; e
(define unite (bool:nonreg-unite wb e))
;; unite
(zoom-all)
;; #[view 1639204]
(define e (wire-body (edge:linear
    (position 0 1.5 0) (position 2 1.5 0))))
;; e
(define wb (bool:nonreg-unite wb e))
;; wb
(define em (list-ref (entity:edges wb)0))
;; em
(entity:set-color em 3)
;; ()
(edge:move em -.25 )
;; #t

[Top]


edge:project-to-face

Action
Projects (part of) an edge onto a face.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
api_project_curve_to_surface

Syntax
(edge:project-to-face in-edge in-face)

Arg Types
in-edge edge
in-face face

Returns
edge

Description
Only that part of the edge for which a perpendicular projection onto the face's surface exists will be projected - parts that can only be projected to the boundaries of the surface will be excluded. If no part of the edge can be projected onto the surface, this extension will return false.

In cases where no perpendicular projection exists for any part of the curve, a NULL curve will be created.

Arguments
in-edge specifies the edge to project.
 
in-face specifies a face.

Limitations
If more than one edge segment can be projected onto the surface, the API will fail.
; edge:project-to-face
; Create some geometry to show the example of
; projecting an edge to a face.
(cond (( = 0 (length (part:views))) (view:gl)))
;; f
(view:set-bg-color 7)
;; #[view 5375148]
(view:edges #t)
;; #[view 5375148]
(view:polygonoffset #t)
;; #[view 5375148]
(part:clear)
;; #t
; Make a spring edge
(define handiness #t)
;; handiness
(define pitch1 40)
;; pitch1
(define pitch-degrees1 360)
;; pitch-degrees1
(define axis-point (position 0 0 0)))
;; axis-point
(define axis-vector(gvector 0 1 0))
;; axis-vector
(define start-position (position 0 0 6))
;; start-position
(define spring (edge:spring axis-point axis-vector
     start-position handiness pitch1 pitch-degrees1))
;; spring
; Make a face
(define c (solid:cylinder
    (position 0 0 0)
    (position 0 50 0) 5))
;; c
(entity:set-color c RED)
;; ()
(define f(list-ref (entity:faces c ) 0))
;; f
(zoom-all)
;; #[view 5375148]
; Make an edge that is the first edge projected onto
; the face
(define newcurve (edge:project-to-face spring f))
;; newcurve

[Top]


edge:project-to-plane

Action
Projects an edge onto a plane.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(edge:project-to-plane edge plane-pos plane-normal [accurate=#t])

Arg Types
edge edge
plane-pos position
plane-normal gvector
accurate boolean

Returns
edge

Description
This returns the new edge that is the projection of the given edge onto the plane. The input edge is projected parallel to the input gvector. It gets projected onto the place specified by the position and the gvector.

Arguments
edge specifies the edge to project.
 
plane-pos specifies the position on the plane.
 
plane-normal specifies the normal to the plane.
 
accurate specifies whether to create accurate, or just quick approximate projection curves.

Limitations
Edges created may not be valid ACIS edges for subsequent ACIS operations (for example non-G1 or self-intersecting).
; edge:project-to-plane
; Create a linear edge.
(define edge1
    (edge:linear (position 0 0 0)
    (position 30 30 0)))
;; edge1
; OUTPUT Original

; Project the edge onto a plane.
(define project
    (edge:project-to-plane edge1 (position 20 20 0)
    (gvector 0 1 0)))
;; project
; OUTPUT Result

Figure. edge:project-to-plane

[Top]


edge:reversed?

Action
Determines if the direction of an edge is reversed relative to a face.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(edge:reversed? edge face)

Arg Types
edge edge
face face

Returns
boolean

Description
Given an edge and a face that the edge lies on, this extension determines if the direction of the edge should be reversed when traversing the loop which contains the edge. This extension returns #t if the edge is reversed; otherwise, it returns #f.

Arguments
edge specifies an edge.
 
face specifies a face.
; edge:reversed?
; Create a block.
(define block1
    (solid:block (position 0 0 0)
    (position 10 10 10)))
;; block1
; Get a list of the block's edges.
(define edges1
    (entity:edges block1))
;; edges1
; Get a list of the block's faces.
(define faces1
    (entity:faces block1))
;; faces1
(define one-edge (car edges1))
;; one-edge
(define one-face (car faces1))
;; one-face
; Determine if an edge is reverse
; with respect to a face.
(edge:reversed? one-edge one-face)
;; #f

[Top]


edge:spline?

Action
Determines if a scheme-object is a spline-edge.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(edge:spline? object)

Arg Types
object scheme-object

Returns
boolean

Description
Returns #t if a scheme-object is a spline-edge.

Arguments
object specifies the scheme-object that has to be queried for a spline-edge.
; edge:spline?
; Create a circular edge.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
; Determine if the edge is actually a spline edge.
(edge:spline? edge1)
;; #f
; Create a edge:spline.
(define spline1
    (edge:spline (list (position 0 0 0)
    (position 5 5 0) (position 10 15 0)
    (position 15 20 0) (position 20 15 0)
    (position 25 5 0) (position 30 0 0)) 0 45))
;; spline1
; Determine if the edge is actually a spline edge.
(edge:spline? spline1)
;; #t

[Top]


edge:type

Action
Determines the type of an edge.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(edge:type edge)

Arg Types
edge edge

Returns
string

Description
Returns edge type.

Arguments
edge specifies an edge.
; edge:type
; Create some edges to test.
(define e1 (edge:circular (position 0 0 0) 5))
;; e1
(edge:type e1)
;; "ellipse"
(define e2 (edge:linear (position 10 0 0)
    (position 20 0 0)))
;; e2
(edge:type e2)
;; "straight"

[Top]


edge:types

Action
Prints a table of all edges in the current part, including their containing entities and curve types.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
api_get_active_part, api_get_edges

Syntax
(edge:types)

Arg Types
edge edge

Returns
string
; edge:types
; create a solid cylinder
(define solid (solid:cylinder
    (position 0 0 0) (position 0 0 30) 30))
;; solid
; get a list of the edge types
(edge:types)
; entity:(entity 1 1)
; entity:(entity 2 1)
; edge:(entity 3 1) edge_type:circle
; edge:(entity 4 1) edge_type:circle
;; #t

[Top]


edge?

Action
Determines if a scheme-object is an edge.

Filename
scm/scmext/kern/qedg_scm.cpp

APIs
None

Syntax
(edge? object)

Arg Types
object scheme-object

Returns
boolean

Description
Returns #t if a scheme-object is an edge.

Arguments
object specifies the scheme-object that has to be queried for an edge.
; edge?
; Create a circular edge.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
; Determine if the circular edge is an edge.
(edge? edge1)
;; #t
(define block1
    (solid:block (position 0 0 0)
    (position 25 10 18)))
;; block1
; Determine if the block is an edge.
(edge? block1)
;; #f

[Top]


eelist:add

Action
Adds an entity to an EE_LIST.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_part_note_state, api_part_start_state

Syntax
(eelist:add list entity)

Arg Types
list entity | (entity ...)
entity entity

Returns
entity
Arguments
list specifies an entity list.
 
entity specifies the entity that has to be added to the list.
; eelist:add
; Make an EE_LIST
(define a (eelist:new))
;; a
; Make an entity to add
(define s (solid:sphere (position 0 0 0) 10))
;; s
; Add it to the list
(define add (eelist:add a s))
;; add

[Top]


eelist:entities

Action
Returns a list of the entities in an EE_LIST.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_part_note_state, api_part_start_state

Syntax
(eelist:entities list)

Arg Types
list entity | (entity ...)

Returns
(entity ...)
Arguments
list specifies an entity list.
; eelist:entities
; Make an EE_LIST
(define a (eelist:new))
;; a
; Make an entity to add
(define s (solid:sphere (position 0 0 0) 10))
;; s
; Add it to the list
(eelist:add a s)
;; #[entity 2 1]
; See what is there
(define ents (eelist:entities a))
;; ents

[Top]


eelist:new

Action
Creates a new EE_LIST entity.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_part_note_state, api_part_start_state

Syntax
(eelist:new)

Arg Types
None

Returns
entity

Description
Creates a new EE_LIST entity. An EE_LIST is an ENTITY wrapper for ENTITY_LIST. Like all entities it participates in save/restore and rollback.

; eelist:new
; Make a new EE_LIST
(define newlist (eelist:new))
;; newlist

[Top]


eelist:remove

Action
Removes an entity from an EE_LIST.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_part_note_state, api_part_start_state

Syntax
(eelist:remove list entity)

Arg Types
list entity | (entity ...)
entity entity

Returns
entity
Arguments
list specifies an entity list.
 
entity specifies the entity that has to be removed from the list.
; eelist:remove
; Make an EE_LIST
(define a (eelist:new))
;; a
; Make an entity to add
(define s (solid:sphere (position 0 0 0) 10))
;; s
; Add it to the list
(eelist:add a s)
;; #[entity 1 1]
; Take it back out
(eelist:remove a s)
;; #[entity 1 1]

[Top]


entity

Action
Gets an entity from an entity ID number.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_pm_lookup_entity

Syntax
(entity entity-id [part=active])

Arg Types
entity-id integer
part part

Returns
entity | boolean

Description
This extension returns the entity or #f if the entity is not found.

Arguments
entity-id specifies the entity number to be searched.
 
part is an optional argument that specifies the part identifier.
; entity
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 10 10 10)))
;; block1
block1
; Retrieve entity 4, if defined.
(entity 4)
;; #f
; Retrieve entity 2, if defined.
(entity 2)
;; #f
; Retrieve entity 1, if defined.
(entity 1)
;; #[entity 1 1]

[Top]


entity:annotation-names

Action
Returns the name of the selected entity as determined by an attached annotation attribute.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
None

Syntax
(entity:annotation-names entity)

Arg Types
entity entity

Returns
(string ...)

Description
Returns the name of the selected entity as determined by an attached annotation attribute.

The option for annotation should be turned on (#t) in order for the annotations to be created during a sweep or blend operation. Likewise, the option for unhook_annotations should be turned off (#f) in order to view the annotations after the operation, otherwise they are automatically cleared out.

Arguments
entity is an entity that should have the member-name within the candidate annotation.
; entity:annotation-names
; Turn on annotation options
(option:set "annotation" #t)
;; #f
(option:set "unhook_annotations" #f)
;; #t
; Create a sweep path from a wire body of edges.
(define path1 (wire-body (list (edge:linear
       (position 0 0 0) (position 0 20 0))
    (edge:ellipse (position 10 20 0)
       (gvector 0 0 -1) (gvector -10 0 0) 1 0 90)
    (edge:linear (position 10 30 0)
       (position 20 30 0)))))
;; path1
; Create the profile to use in sweeping
(define profile1 (wire-body:points (list
    (position 3 0 3) (position 3 0 -3)
    (position -3 0 -3) (position -3 0 3)
    (position 3 0 3))))
;; profile1
; Sweep the profile along the path.
(define sweep1 (sweep:law profile1 path1))
;; sweep1
(entity:set-color path1 2)
;; ()
(entity:set-color profile1 3)
;; ()
(iso)
;; #[view 10814340]
(zoom-all)
;; #[view 10814340]
; Create some lists for verification purposes.
(define out-sw-faces (entity:faces sweep1))
;; out-sw-faces
(define out-sw-edges (entity:edges sweep1))
;; out-sw-edges
; Select a face resulting from the sweep.
(ray:queue 89.9693 -121.78 74.672 -0.408248
    0.816497 -0.408248 1)
;; #[ray (89.9693 -121.78 74.672)
;;  (-0.408248 0.816497 -0.408248)]
(define face1 (pick-face))
;; face1
(entity:set-color profile1 2)
;; ()
(entity:set-color face1 BLUE)
;; ()
(system:sleep 3500)
;; 3500
; Get the annotations associated with the face.
(define face1_annos (entity:annotations face1))
;; face1_annos
(define anno1 (list-ref face1_annos 0))
;; anno1
(entity:debug anno1)
;; "sweep_anno_edge_lat"
; Get the inputs for this annotation.
(define anno1_inputs (annotation:inputs anno1))
;; anno1_inputs
(define edge1 (list-ref anno1_inputs 0))
;; edge1
(annotation:member-name anno1 edge1)
;; "profile"
(entity:set-color edge1 6)
;; ()
(define edge2 (list-ref anno1_inputs 1))
;; edge2
(annotation:member-name anno1 edge2)
;; "path"
; Get the outputs for this annotation
(define anno1_outputs (annotation:outputs anno1))
;; anno1_outputs
(annotation:member-name anno1
    (list-ref anno1_outputs 0))
;; "lateral_face"
(annotation:member-name anno1 face1)
;; "lateral_face"
; Find member names of a specific entity for
; all the associated annotations.
(entity:annotation-names edge1)
;; ("profile" "profile" "profile" "profile")
(entity:annotation-names edge2)
;; ("path" "path" "path" "path" "path" "path" "path"
;; "path" "path" "path" "path" "path" "path" "path"
;; "path" "path")

[Top]


entity:annotations

Action
Returns the list annotation entities attached to the given entity via an annotation attribute.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
None

Syntax
(entity:annotation entity)

Arg Types
entity entity

Returns
(entity ...)

Description
Returns the list annotation entities attached to the given entity via an annotation attribute. If there is only one annotation attached, it is returned directly without a list.

The option for annotation should be turned on (#t) in order for the annotations to be created during a sweep or blend operation. Likewise, the option for unhook_annotations should be turned off (#f) in order to view the annotations after the operation; otherwise they are automatically removed.

Arguments
entity specifies an entity.
(part:clear)
; entity:annotations
; Turn on annotation options
(option:set "annotation" #t)
(option:set "unhook_annotations" #f)
; Create a sweep path from a wire body of edges.
(define path1 (wire-body (list
                           (edge:linear (position 0 0 0) (position 0 20 0))
                           (edge:ellipse (position 10 20 0)
                                         (gvector 0 0 -1) (gvector -10 0 0) 1 0 90)
                           (edge:linear (position 10 30 0)
                                        (position 20 30 0)))))
; Sweep the edges into a face body.
(define a-body (sweep:law
                 (edge:linear (position -3 0 -3) (position 3 0 -3))
                 (gvector 0 0 6))))
; Create the profile to use in sweeping
(define profile1 (car
                   (entity:faces (sheet:2d a-body))))
; Sweep the profile along the path.
(define sweep1 (sweep:law profile1 path1))
(entity:set-color path1 2)
(entity:set-color profile1 3)
(iso)
(zoom-all)
; Create some lists for verification purposes.
(define top-cap-edges (entity:edges profile1))
(define out-sw-faces (entity:faces sweep1))
(define out-sw-edges (entity:edges sweep1))
; Check the annotations attached to items.
; Create a list of annotations associated with an
; edge of the swept body.
(define anno1 (entity:annotations (list-ref out-sw-edges 0)))
anno1
; Create a list of annotations that are inputs to the
; sweep operation.
(define anno-input1 (annotation:inputs (list-ref anno1 0)))
anno-input1
; See what the annotation names are for a given
; input annotation.
(entity:annotation-names (list-ref anno-input1 0))
(entity:annotation-names (list-ref anno-input1 1))
; Create a second list of annotations from the first
; swept face.
(define anno2 (entity:annotations (list-ref out-sw-faces 0)))
; See what the annotation names are for the
; annotation attached to the first swept face.
(annotation:member-name (list-ref anno2 0) (list-ref out-sw-faces 0))
; Create a list of annotations just from one of the
; edges in the top cap.
(define anno3 (entity:annotations (list-ref top-cap-edges 0)))
anno3
(annotation:member-name (list-ref anno3 0) (list-ref top-cap-edges 0))
; Create a list of annotations that are inputs to
; the sweep operation.
(define anno-input1 (annotation:inputs (list-ref anno1 0)))
anno-input1
; See what the annotation names are for a given
; input annotation.
(entity:annotation-names (list-ref anno-input1 0))
(entity:annotation-names (list-ref anno-input1 1))
; Create a second list of annotations from the first
; swept face.
(define anno2 (entity:annotations (list-ref out-sw-faces 0)))
anno2
; See what the annotation names are for the
; annotation attached to the first swept face.
(annotation:member-name (list-ref anno2 0) (list-ref out-sw-faces 0))
; Create a list of annotations just from one of the
; edges in the top cap.
(define anno3 (entity:annotations  (list-ref top-cap-edges 0)))
anno3
(annotation:member-name (list-ref anno3 0) (list-ref top-cap-edges 0))

[Top]


entity:attach-derived-tag

Action
Generates an error if the specified annotation does not exist.

Filename
scm/scmext/kern/anno_scm.cpp

APIs
None

Syntax
(entity:attach-derived-tag entity string)

Arg Types
entity entity
string string

Returns
entity

Description
Attaches a DERIVED_TAG, which is derived from ATTRIB_TAG to the given entity.

Arguments
entity specifies an entity.
 
string specifies the attribute to be attached.
; entity:attach-derived-tag
; Set options
(option:set "annotations" #t)
;; #f
(option:set "unhook_annotations" #f)
;; #t
; Define a profile
(define profile (wire-body:points
    (list (position 0 0 0) (position 10 0 0)
    (position 10 10 0) (position 0 10 0)
    (position 0 0 0))))
;; profile
; Define a path.
(define path (edge:linear (position 0 0 0)
    (position 0 0 10)))
;; path
; Attach a DERIVED_TAG to the path
(define attach
    (entity:attach-derived-tag path 'thePathEdge))
;; attach
; Do the sweep
(define opt (sweep:options "draft_angle"
    10 "gap_type" "n" 'solid #t))
;; opt
; Sweep profile along defined path.
(define sweep (sweep:law profile path opt))
;; sweep
; View annotations on the path and see that
; the derived tag was used
(map entity:debug (entity:annotations path)
    (make-list 100 2))
; returns the list of annotation entities
;; ("sweep_anno_vertex_lat" "sweep_anno_vertex_top"
;; "sweep_anno_edge_lat" "sweep_anno_edge_top"
;; "sweep_anno_vertex_lat" "sweep_anno_vertex_top"
;; "sweep_anno_edge_lat" "sweep_anno_edge_top"
;; "sweep_anno_vertex_lat" "sweep_anno_vertex_top"
;; "sweep_anno_edge_lat" "sweep_anno_edge_top"
;; "sweep_anno_vertex_lat" "sweep_anno_vertex_top"
;; "sweep_anno_edge_lat" "sweep_anno_edge_top")

[Top]


entity:attribs

Action
Returns list of attributes on given entity.

Filename
scm/scmext/kern/ent_scm.cpp

Syntax
(entity:attribs entity)

Arg Types
entity entity

Returns
(entity ...)
Arguments
entity is the given input entity.

; entity:attribs
; Create a block.
(define b (solid:block (position -10 -10 -10)
                       (position 10 10 10)))
;; b
; Return the id_attribute (created by Scheme).
(entity:attribs b)
;; (#[entity 2 1])
(entity:debug (entity 2))
;; "id_attribute"

[Top]


entity:coedges

Action
Gets the coedges from an entity or list of entities.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
None

Syntax
(entity:coedges entity-list [include-pat])

Arg Types
entity-list entity | (entity ...)
include-pat integer

Returns
(coedge ...)

Description
This extension returns a list of all of the coedges from the entity or list of entities. If no coedges are found, this extension returns an empty list.

Arguments
entity-list specifies an entity or an entity list.
 
include-pat is an optional argument that determines how this function deals with patterned objects. By default, patterned objects are included in the list of entities. The user may specify any one of the following through this argument:
0 patterned objects are created if they do not already exist, and are included in the list.
1 only those patterned objects that have already been created are included in the list.
2 no patterned objects besides seed pattern objects are included in the list.
; entity:coedges
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 10 10 10)))
;; block1
; Get a list of the block's coedges.
(entity:coedges block1)
;; (#[entity 3 1] #[entity 4 1] #[entity 5 1]
;; #[entity 6 1] #[entity 7 1] #[entity 8 1]
;; #[entity 9 1] #[entity 10 1] #[entity 11 1]
;; #[entity 12 1] #[entity 13 1] #[entity 14 1]
;; #[entity 15 1] #[entity 16 1] #[entity 17 1]
;; #[entity 18 1] #[entity 19 1] #[entity 20 1]
;; #[entity 21 1] #[entity 22 1] #[entity 23 1]
;; #[entity 24 1] #[entity 25 1] #[entity 26 1])

[Top]


entity:copy

Action
Copies any entity (solid, face, edge, etc.) and all entities attached to it.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_copy_entity

Syntax
(entity:copy entity-list [part] [ao])

Arg Types
entity-list entity | (entity ...)
part part
ao acis-options

Returns
entity | (entity ...)
Arguments
entity-list comprises any entity or list of entities to be copied. If an entity is removed, use the view:refresh extension to display any remaining entities. If a single entity is specified, this extension returns a single entity, which is the copy. If an entity list is specified, this extension returns a list of entities.
 
part is an optional argument. If part is specified, then the copies are added to the part; otherwise, the copies are added to the same part that the original entity was in.

ao contains journaling and versioning information.
; entity:copy
; Create a block, making it entity 1.
(define block1
    (solid:block (position 0 0 0)
    (position 20 20 20)))
;; block1
; Copy the block, making it entity 2.
(define copy (entity:copy block1))
;; copy
; Copy both blocks, making them entities 4 and 5.
(entity:copy (list block1 copy))
;; (#[entity 4 1] #[entity 5 1])

[Top]


entity:copy-contents

Action
Copies lower topology entities from a given entity.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_copy_entity_contents

Syntax
(entity:copy-contents entity [transform] [ao])

Arg Types
entity entity
transform transform
ao acis-options

Returns
entity
Arguments
entity specifies the entity that has to be copied.
 
transform is an optional argument that specifies the transformation to be applied to the copied entities.

ao contains journaling and versioning information.
; entity:copy-contents
; Create a block
(define block (solid:block (position 0 0 0)
    (position 10 10 5)))
;; block
(define fa (car (entity:faces block)))
;; fa
; copy the face only
(define copy (entity:copy-contents fa))
;; copy
(entity:delete block)
;; ()
; there should be only a face left
(entity:check copy)
; checked:
;      0 lumps
;      0 shells
;      0 wires
;      1 faces
;      1 loops
;      4 coedges
;      4 edges
;      4 vertices
;; (#[entity 9 1])

[Top]


entity:debug

Action
Prints information about the data structure of an entity.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
None

Syntax
(entity:debug entity [level=0])

Arg Types
entity entity
level integer

Returns
string
Arguments
entity specifies the entity to be queried.
 
level is an optional argument that controls the amount of debug information.

level0
writes no output and only returns the entity type.
level1
writes only data specific to the given entity.
level2
writes additional information for some entity types. For example, if the entity is an EDGE, then the coordinates of the end points and the curve data are also written. This extension writes only data specific to the given entity.
level3
writes the size of the entity and all associated entities.
level4
writes full information for the entity and all associated entities.
; entity:debug
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 20 20 20)))
;; block1
; Print the debug information about the block.
(entity:debug block1 1)
; body **** 1211232:
;   Rollback pointer  : NULL
;   Attribute list    : display_attribute 0 1330848
;   Lump list         : lump 0 1318416
;   Wire list         : NULL
;   Transform         : transform 0 1322480
;   Bounding box      : NULL
;; "solid body"

[Top]


entity:deep-copy

Action
Deep copies an entity (solid, face, edge, etc.) plus all attached entities.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_deep_copy_entity_list, api_pm_add_entity

Syntax
(entity:deep-copy entity-list [part] [deepcopy-skip=#f])

Arg Types
entity-list entity | (entity ...)
part part
deepcopy-skip boolean

Returns
entity | (entity ...)

Description
The difference between entity:deep-copy and entity:copy is that entity:deep-copy makes a copy of splf_splf, whereas entity:copy creates a pointer to splf_splf.

The deep copy functionality is used instead of the regular copy when it is required that no links exist with shared information between the original and the deep copy.

Arguments
entity-list is any entity or list of entities to be deep copied. If an entity is removed, use the view:refresh extension to display remaining entities. If a single entity is specified, a single entity is returned, which is the deep copy. If an entity list is specified, a list of entities is returned.
 
part is an optional argument. If part is specified, the deep copies are added to the part; otherwise, the deep copies are added to the part that contained the original entity.
 
If deepcopy-skip is #t, the copy will continue even after encountering attributes marked as not deep copyable. The default is to throw a sys_error if such a case is encountered.
; entity:deep-copy
; Create .
(define block1
    (solid:block (position 0 0 0)
    (position 20 20 20)))
;; block1
; Create a cylinder.
(define cyl2
    (solid:cylinder (position 0 0 0)
    (position 5 5 10) 5))
;; cyl2
; Create another block.
(define block3
    (solid:block (position 0 0 0)
    (position -10 -10 -10)))
;; block3
; Conduct the deep copy on the three entities.
(define deepcopy (entity:deep-copy (list block1
    cyl2 block3)))
;; deepcopy

[Top]


entity:delete

Action
Deletes an entity or list of entities and any attributes attached to those entities.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_del_entity_list

Syntax
(entity:delete entity-list)

Arg Types
entity-list entity | (entity ...)

Returns
unspecified
Arguments
entity-list specifies an entity or an entity list that has to be deleted.
; entity:delete
; Create a block.
(define block1
    (solid:block (position 0 0 0)
    (position 20 20 20)))
;; block1
; Delete block1.
(entity:delete block1)
;; ()
; Create a cylinder.
(define cyl2
    (solid:cylinder (position 0 0 0)
    (position 5 5 10) 5))
;; cyl2
; Create another block.
(define block3
    (solid:block (position 0 0 0)
    (position -10 -10 -10)))
;; block3
; Delete the cylinder and the second block.
(entity:delete (list cyl2 block3))
;; ()

[Top]


entity:dindex

Action
Returns the index of the given entity as listed in debug output.

Filename
scm/scmext/kern/dbg_scm.cpp

APIs
None

Syntax
(entity:dindex given-entity [containing-entity])

Arg Types
given-entity entity
containing-entity entity

Returns
integer | boolean

Description
Returns the index of the given entity as listed in debug output when the containing entity is debugged.

When a given containing entity does not actually contain the given entity, FALSE is returned.

Arguments
given-entity specifies the entity whose index has to be returned.
 
containing-entity specifies the entity that contains the given-entity. If no containing entity is given, the top level owner of the given-entity is used.
; entity:dindex
; Create a block and get its index value.
(define b (solid:block
    (position -10 -10 -10) (position 10 10 10)))
;; b
(entity:dindex (pick:face (ray (position 0 0 0)
    (gvector 1 0 0))))
;; 5

[Top]


entity:dspindex

Action
Returns faces, edges, tedges, coedges, tcoedges, tvertices or vertices selected by the same index as listed in debug output.

Filename
scm/scmext/kern/dbg_scm.cpp

APIs
api_get_coedges, api_get_edges, api_get_faces, api_get_shells, api_get_vertices, api_get_wires

Syntax
(entity:dspindex entity type index)

Arg Types
entity entity
type string
index integer

Returns
entity | boolean

Description
Returns wires, shells, faces, edges, tedges, coedges, tcoedges, tvertices or vertices selected by the same index as listed in debug output of the given entity. Note that usually the given entity will be a body.

An entity is returned if reasonable values are given, otherwise FALSE.

Arguments
entity specifies the entity to be queried.
 
type is the string representing the entity type of the given index. Allowed values are "wire", "shell", "face", "edge", "coedge", "tedge", "tcoedge", "vertex", and "tvertex".
 
index specifies the index as listed in the debug output of the given entity.
; entity:dspindex
; Create an entity and return its display
; index value.
(define b
    (solid:block
    (position -10 -10 -10) (position 10 10 10)))
;; b
(define c (entity:dspindex b "face" 3))
;; c

[Top]


entity:fix-transform

Action
Applies a body transformation to all underlying geometry.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_change_body_trans

Syntax
(entity:fix-transform body)

Arg Types
body body

Returns
entity

Description
As transformations are applied to a body, the system keeps track of the resulting transformation as part of the body data structure. The fix command applies a body transformation to all of the underlying geometry and replaces the body transformation with NULL (indicating an id entity transformation). This extension returns the input entity.

Arguments
body specifies the body to be transformed.
; entity:fix-transform
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position -25 -15 -10)))
;; block1
; Transform the block.
(define transform (entity:transform block1
    (transform:axes (position 0 0 0) (gvector -8 0 0)
    (gvector 0 6 0))))
;; transform
; Fix the body.
(define fix (entity:fix-transform block1))
;; fix

[Top]


entity:get-entities

Action
Returns all specified entities related to an entity.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_get_entities

Syntax
(entity:get-entities entity-list entity-id-str-list
        [include-pat] [acis-opts])

Arg Types
entity-list entity | (entity ... )
entity-id-str-list entity-id-str | (entity-id-str ... )
include-pat integer
acis-opts acis-options

Returns
(entity ... )

Errors
This extension expects at least one ENTITY and one ENTITY_ID string.
Description
Like the API, this extension returns a list of entities based on the ENTITY_ID values provided. Unlike the API, you must provide the string value for the corresponding ENTITY_ID bit and each string value must be quoted.
Arguments
entity-list specifies the entity to be queried.
 
entity-id-str-list specifies the quoted ENTITY_ID string. Valid values include:
Geometry IDs TRANSFORM_ID
SURFACE_ID
PCURVE_ID
CURVE_ID
APOINT_ID
Topology IDs BODY_ID
LUMP_ID
SHELL_ID
SUBSHELL_ID
WIRE_ID
FACE_ID
LOOP_ID
COEDGE_ID
EDGE_ID
VERTEX_ID

 
include-pat determines how this function manages patterned objects. By default, patterned objects are included in the list of entities. You may specify any one of the following through this argument:

0    patterned objects are created if they do not already exist, and are included in the list.

1    only those patterned objects that have already been created are included in the list.

2    no patterned objects besides seed pattern objects are included in the list.
acis-opts object contains the journaling information that has to be stopped.
;; entity:get-entities
;; define a block
(define block (solid:block 0 0 0 10 10 10))
;; block
(entity:get-entities block "FACE_ID")
;; (#[entity 2 1] #[entity 3 1] #[entity 4 1] #[entity 5 1] #[entity 6 1] #[entity 7 1])
(entity:get-entities (entity 2) "SURFACE_ID")
;; (#[entity 12 1])
(entity:get-entities (entity 2) "EDGE_ID")
;; (#[entity 8 1] #[entity 9 1] #[entity 10 1] #[entity 11 1])
(entity:get-entities (entity 8) "COEDGE_ID")
;; (#[entity 12 1] #[entity 13 1])
(entity:get-entities (entity 8) "VERTEX_ID")
;; (#[entity 14 1] #[entity 15 1])
(entity:get-entities block "PCURVE_ID")
;; ()
(exit)
;; ()

[Top]


entity:get-id

Action
Returns the id tag from the given entity.

Filename
scm/scmext/kern/hist_scm.cpp

APIs
api_get_entity_id

Syntax
(entity:get-id entity)

Arg Types
entity entity

Returns
integer
Arguments
entity specifies the entity to be queried.
; entity:get-id
; Create a block
(define b (solid:block (position -10 -10 -10)
    (position 10 10 10)))
;; b
(define lop (lop:offset-body b 5))
;; lop
(define f (pick:face (ray (position 0 0 0)
    (gvector 1 0 0))))
;; f
(entity:set-color f BLUE)
;; ()
(define id (entity:get-id f))
;; id

[Top]


entity:how-connected

Action
Returns an ordered list of entities representing the path from one entity to another.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
None

Syntax
(entity:how-connected entity1 entity2 [scan-type])

Arg Types
entity1 entity
entity2 entity
scan-type string

Returns
(entity ...)

Description
Occasionally there are unexpected connections between entities. This can cause routines using the copy_scan() virtual function, such as entity:delete, (corresponding to api api_del_entity) and entity:copy (corresponding to api_copy_entity) to do more than what was expected.

This routine can help in understanding how two entities are connected by finding a path from one to the other. It uses copy_scan to find what is connected to the first entity and then copy_scan again to find what is connected to the next, and so on. This extension uses an ENTITY_LIST to keep track of what it has already looked at so that the search terminates.

If the second entity is found, this routine returns an ordered list representing the path from the first to the second. If no path is found, it returns an empty list.

Arguments
entity1 specifies the first entity.
 
entity2 specifies the second entity.
 
The optional scan-type parameter allows specification of the SCAN_TYPE argument to the copy_scan function. Valid choices are "unspecified", "copy", "distribute" or "delete"
; entity:how-connected
; Create a block
(define b (solid:block
    (position 10 20 30) (position -10 -20 -30)))
;; b
(define faces (car (entity:faces b)))
;; faces
(entity:how-connected b faces)
; -> face
; -> shell
; -> lump
; -> body
;; (#[entity 3 1] #[entity 9 1] #[entity 10 1]
;; #[entity 2 1])

[Top]


entity:index

Action
Returns the index of an entity.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_get_coedges, api_get_edges, api_get_faces, api_get_lumps, api_get_owner, api_get_shells, api_get_vertices, api_get_wires

Syntax
(entity:index entity [list])

Arg Types
entity entity
list entity | (entity ...)

Returns
integer

Description
Returns the index of an entity. For example, if the input entity is an edge the index is found in the result from api_get_edges. The index is zero based and a -1 is returned if none are found. Optionally, a list of entities can be input. Index is returned based on the given entity list.

Arguments
entity specifies the entity to be queried.
 
list is an optional argument that specifies the entity list used to find the index of the entity.
; entity:index
; Create topology to demonstrate command.
(define block (solid:block (position 0 0 0)
    (position 10 10 10)))
;; block
(define edges (entity:edges block))
;; edges
(define list (list-ref edges 0))
;; list
; Find the index of a given edge.
(entity:index (entity 6 1))
;; 3

[Top]


entity:loops

Action
Gets a list of all loops of an entity or list of entities.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_get_loops

Syntax
(entity:loops entity-list [include-pat])

Arg Types
entity-list entity | (entity ...)
include-pat integer

Returns
(loop ...)

Description
This extension returns a list of the entity's loops. If no loops are found, this extension returns an empty list.

Arguments
entity-list specifies an entity or an entity list that has to be queried.
 
The optional parameter include-pat determines how this function deals with patterned objects. By default, patterned objects are included in the list of entities. The user may specify any one of the following through this argument:

0
patterned objects are created if they do not already exist, and are included in the list.
1
only those patterned objects that have already been created are included in the list.
2
no patterned objects besides seed pattern objects are included in the list.
; entity:loops
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 15 10 5)))
;; block1
; Get a list of the block's loops.
(entity:loops block1)
;; (#[entity 3 1] #[entity 4 1] #[entity 5 1]
;; #[entity 6 1] #[entity 7 1] #[entity 8 1])

[Top]


entity:lose-attribs

Action
Removes selected attributes from an entity and its subparts.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
None

Syntax
(entity:lose-attribs entity [save-name])

Arg Types
entity entity
save-name string

Returns
unspecified

Description
Scans the given entity and entities reachable from it for attributes and loses them.

This routine does not lose the ID_ATTRIB or DISPLAY_ATTRIB used by the Scheme AIDE. This is because ID_ATTRIB and DISPLAY_ATTRIB are non-copyable and are not included in the scan. Similarly, other non-copyable attributes cannot be lost by this routine.

Arguments
entity specifies the entity whose attributes have to be deleted.
 
If save-name is specified losing is restricted to attribs whose name, as it appears in a SAT file, matches the given name.
; entity:lose-attribs
; Create a block.
(define b (solid:block (position -10 -10 -10)
    (position 10 10 10)))
;; b
; Attach color attributes to selected face and edge.
(entity:set-color (pick:face
    (ray (position 0 0 0) (gvector 0 1 0))) 1)
;; ()
(entity:set-color (pick:edge (ray (position 0 0 0)
    (gvector 2 2 0))) 3)
;; ()
; Lose the color attributes.
(entity:lose-attribs b)
;; ()
(render:rebuild)
;; ()

[Top]


entity:lumps

Action
Gets a list of all lumps in an entity or list of entities.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_get_lumps

Syntax
(entity:lumps entity-list)

Arg Types
entity-list entity | (entity ...)

Returns
(lump ...)

Description
This extension returns a list of the entity's lumps. If no lumps are found, this extension returns an empty list.

Arguments
entity-list specifies an entity or an entity list that has to be queried.
; entity:lumps
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 15 10 5)))
;; block1
; Get a list of the block's lumps.
(entity:lumps block1)
;; (#[entity 3 1])

[Top]


entity:move

Action
Transforms an entity or list of entities.

Filename
scm/scmext/kern/transform_scm.cpp

APIs
api_transform_entity

Syntax
(entity:move body-list xoffset yoffset zoffset [fix-transform])

Arg Types
body-list (entity | entity ...)
xoffset real
yoffset real
zoffset real
fix-transform boolean

Returns
(entity | entity ...)

Errors
Given entity or entities must be a body.

Description
This is a faster way to transform entities in Scheme. Before (entity:move), one had to type:

(entity:transform ent);
(transform:translation (gvector x y z)));

This shorthand version lets you do the same operation with:

(entity:move ent x y z).

Arguments
body-list specifies the body or list of bodies that has to be moved.
 
xoffset specifies the translation along the X direction.
 
yoffset specifies the translation along the Y direction.
 
zoffset specifies the translation along the Z direction.
 
fix-transform is an optional argument that allows transforms to be fixed to the bodies (#t).
; entity:move
; Create a cylinder
(define c (solid:cylinder
    (position 0 0 0) (position 10 10 10) 5))
;; c
; Move the cylinder.
(define move (entity:move c 10 0 0))
;; move
; Scale the cylinder.
(define scale1 (entity:scale c 3 1 1))
;; scale1
; Apply uniform scale.
(define scale2 (entity:scale c 2))
;; scale2
; Rotate about (position 20 0 0) (vector 0 0 1)
; by 90 degrees.
(define rotate1 (entity:rotate c 20 0 0 0 0 1 90))
;; rotate1
; Rotate about (position 0 0 0) (vector 0 0 1)
; by 90 degrees.
(define rotate2 (entity:rotate c 0 0 1 90))
;; rotate2
; Reflect across (position 40 0 0) (vector 1 0 0).
(define reflect1 (entity:reflect c 40 0 0 1 0 0))
;; reflect1
; Reflect across (position 0 0 0) (vector 1 0 0).
(define reflect2 (entity:reflect c 1 0 0))
;; reflect2

[Top]


entity:next

Action
Gets the next LUMP, SHELL, FACE, LOOP or COEDGE in an entity list.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
None

Syntax
(entity:next entity)

Arg Types
entity entity

Returns
entity

Description
Returns the next entity in an entity list.

Arguments
entity specifies the entity that has to be queried.
; entity:next
; Create a solid block.
(define block1 (solid:block (position 0 0 0)
    (position 15 10 5)))
;; block1
; Determine its owner.
(entity:owner block1)
;; #[entity 2 1]
; Get the faces of the block.
(define faces1 (entity:faces block1))
;; faces1
; faces1 ==>
; #[entity 3 1] #[entity 4 1] #[entity 5 1]
; #[entity 6 1] #[entity 7 1] #[entity 8 1]
; Determine the next face in the list.
(entity:next (list-ref faces1 0))
;; #[entity 4 1]

[Top]


entity:owner

Action
Gets the top level owner of an entity.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_get_owner

Syntax
(entity:owner entity)

Arg Types
entity entity

Returns
entity

Description
Returns the top level owner of the specified entity.

Arguments
entity specifies the entity that has to be queried.
; entity:owner
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 15 10 5)))
;; block1
; Determine its owner.
(entity:owner block1)
;; #[entity 2 1]
; Get the faces of the block.
(define faces1 (entity:faces block1))
;; faces1
; Determine the owner of a face.
(entity:owner (car faces1))
;; #[entity 2 1]

[Top]


entity:previous

Action
Gets the previous COEDGE in an entity list.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
None

Syntax
(entity:previous entity)

Arg Types
entity entity

Returns
entity

Description
Returns the previous COEDGE in the entity list.

Arguments
entity specifies the entity that has to be queried.
; entity:previous
; Create a solid block.
(define block1 (solid:block (position 0 0 0)
    (position 15 10 5)))
;; block1
(entity:owner block1)
;; #[entity 2 1]
; Get the faces of the block.
(define faces1 (entity:faces block1))
;; faces1
; Get the coedges of one of the faces.
(define coedges1 (entity:coedges
    (list-ref faces1 0)))
;; coedges1
; coedges1 ==>
; #[entity 9 1] #[entity 10 1]
; #[entity 11 1] #[entity 12 1]
; Determine the previous coedge in the list.
(entity:previous (list-ref coedges1 0))
;; #[entity 12 1]

[Top]


entity:reflect

Action
Reflects an entity or list of entities.

Filename
scm/scmext/kern/transform_scm.cpp

APIs
api_transform_entity

Syntax
(entity:reflect body-list [xorigin=0 yorigin=0 zorigin=0]

Arg Types
body-list (entity | entity ...)
xorigin real
yorigin real
zorigin real
xnormal real
ynormal real
znormal real
fix-transform boolean

Returns
(entity | entity ...)

Errors
Given entity or entities must be a body.

Description
This is a faster way to reflect entities in Scheme. Before (entity:reflect), one had to type:
(entity:transform ent (transform:reflection
    (position x y z) (gvector x y z)));

This shorthand version lets you do the same operation with:
(entity:reflect ent x y z x y z);

Arguments
body-list specifies an entity or a list of entities that has to be reflected.
 
xorigin, yorigin, and zorigin specifies the origin point for reflection. If the origin values are not specified, then (0,0,0) is taken as the default origin.
 
xnormal, ynormal, and znormal specifies the axis for reflection.
 
fix-transform is an optional argument that allows the transforms to be fixed to the bodies (#t).
; entity:reflect
; Create a cylinder
(define c (solid:cylinder
    (position 0 0 0) (position 10 10 10) 5))
;; c
; Move the cylinder.
(define move (entity:move c 10 0 0))
;; move
; Scale the cylinder.
(define scale1 (entity:scale c 3 1 1))
;; scale1
; Apply uniform scale.
(define scale2 (entity:scale c 2))
;; scale2
; Rotate about (position 20 0 0) (vector 0 0 1)
; by 90 degrees.
(define rotate1 (entity:rotate c 20 0 0 0 0 1 90))
;; rotate1
; Rotate about (position 0 0 0) (vector 0 0 1)
; by 90 degrees.
(define rotate2 (entity:rotate c 0 0 1 90))
;; rotate2
; Reflect across (position 40 0 0) (vector 1 0 0).
(define reflect1 (entity:reflect c 40 0 0 1 0 0))
;; reflect1
; Reflect across (position 0 0 0) (vector 1 0 0).
(define reflect2 (entity:reflect c 1 0 0))
;; reflect2

[Top]


entity:remove-pcurves

Action
Removes pcurves from all coedges on analytic faces of the body or the selected entity.

Filename
scm/scmext/kern/pcu_scm.cpp

APIs
None

Syntax
(entity:remove-pcurves entity)

Arg Types
entity entity

Returns
entity

Description
This extension removes all pcurves underlying the coedges on analytic faces of the body or selected entity. The selected entity can be either an edge or a face.

Arguments
entity is an input face or edge.
; entity:remove-pcurves
; Create an entity
(define block1 (solid:block (position -10 -10 -10)
    (position 10 10 10)))
;; block1
; Add pcurves to all coedges
(define add-p (entity:reset-pcurves block1 #t))
;; add-p
(entity:debug block1 3)
;; 1 body record,         40 bytes
;; 2 attrib records,     108 bytes
;; 1 lump record,         40 bytes
;; 1 transform record,   152 bytes
;; 1 shell record,        48 bytes
;; 6 face records,       312 bytes
;; 6 loop records,       240 bytes
;; 6 surface records,   1104 bytes
;; 24 coedge records,   1344 bytes
;; 12 edge records,      960 bytes
;; 24 pcurve records,   2496 bytes
;; 8 vertex records,     288 bytes
;; 12 curve records,    1632 bytes
;; 8 point records,      576 bytes
;; Total storage 9340 bytes
;; "solid body"
; Remove pcurves from coedges on analytic faces
; - all coedges in this case
(define rem-p (entity:remove-pcurves block1))
;; rem-p
(entity:debug block1 3)
;; 1 body record,         40 bytes
;; 2 attrib records,     108 bytes
;; 1 lump record,         40 bytes
;; 1 transform record,   152 bytes
;; 1 shell record,        48 bytes
;; 6 face records,       312 bytes
;; 6 loop records,       240 bytes
;; 6 surface records,   1104 bytes
;; 24 coedge records,   1344 bytes
;; 12 edge records,      960 bytes
;; 8 vertex records,     288 bytes
;; 12 curve records,    1632 bytes
;; 8 point records,      576 bytes
;; Total storage 6844 bytes
;; "solid body"

[Top]


entity:reset-boxes

Action
Removes any cached bounding boxes from the selected BODY and its subparts (or just the selected entity if it is not a BODY). When a subsequent operation queries the bounding box of the entity, either directly via (entity:box) or indirectly as part of a more involved operation, the necessary bounding boxes will be recomputed and cached again.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_reset_boxes

Syntax
(entity:reset-boxes entity)

Arg Types
entity entity

Returns
entity

Description
This extension removes and replaces the bounding boxes from the selected body and its subparts (or just the selected entity if it is not a body).

Arguments
entity specifies the entity whose bounding boxes have to be reset.
; entity:reset-boxes
; Create an entity
(define b (solid:block
    (position -10 -10 -10) (position 10 10 10)))
;; b
; reset the bounding boxes
(entity:box b)
;; (#[position -10 -10 -10] . #[position 10 10 10])
; show a box is there
(entity:debug b 2)
; body **** 629696:
;      Rollback pointer: 690336
;      Attribute list: display_attribute 0 625648
;      Lump list      : lump 0 629536
;      Wire list      : NULL
;      Transform      : transform 0 628128
;      Bounding box   : -10 : 10
;                     : -10 : 10
;                     : -10 : 10
;; "solid body"
(entity:reset-boxes b)
;; #[entity 2 1]
; show that box is gone
(entity:debug b 2)
; body **** 629696:
;      Rollback pointer: 690336
;      Attribute list: display_attribute 0 625648
;      Lump list      : lump 0 629536
;      Wire list      : NULL
;      Transform      : transform 0 628128
;      Bounding box   : NULL
;; "solid body"

[Top]


entity:reset-pcurves

Action
Removes and then adds back pcurves from all coedges of the body or the selected entity.

Filename
scm/scmext/kern/pcu_scm.cpp

APIs
None

Syntax
(entity:reset-pcurves entity [coedges])

Arg Types
entity entity
coedges boolean

Returns
entity

Description
The pcurve underlying each coedge of the body or the selected entity is first removed and then regenerated. If pcurves are already assigned to spline geometry (for example intcurves) then the pcurves are not necessarily recomputed. The selected entity can be either an edge or a face. In the case of an edge, the pcurve of each coedge of the edge is removed, and then regenerated. In the case of a face, each pcurve of each coedge of each loop of the face is removed and then regenerated.

When coedges are supplied and have a value of TRUE, all coedges (even those originally without pcurves) will have pcurves after this command is executed. Otherwise, only coedges on non-analytic faces will be given pcurves.

Arguments
entity is an input face or edge.
 
coedges is a boolean argument which can be set to either have all the pcurves or not.
; entity:reset-pcurves
; Create an entity
(define wiggle (solid:wiggle 10 10 10 -2 -1 2 1))
;; wiggle
; Regenerate pcurves on coedges on spline faces
(define reset (entity:reset-pcurves wiggle))
;; reset
(entity:debug wiggle 3)
;; 1 body record,          40 bytes
;; 2 attrib records,      108 bytes
;; 1 lump record,          40 bytes
;; 1 shell record,         48 bytes
;; 6 face records,        312 bytes
;; 6 loop records,        240 bytes
;; 6 surface records,    1112 bytes
;; 24 coedge records,    1344 bytes
;; 12 edge records,       960 bytes
;; 4 pcurve records,      416 bytes
;; 8 vertex records,      288 bytes
;; 12 curve records,     1600 bytes
;; 8 point records,       576 bytes
;; Total storage 7084 bytes
;; "solid body"
; Regenerate pcurves already present and
; add pcurves to any coedges lacking pcurves
(define reset2 (entity:reset-pcurves wiggle #t))
;; reset2
(entity:debug wiggle 3)
;; 1 body record,          40 bytes
;; 2 attrib records,      108 bytes
;; 1 lump record,          40 bytes
;; 1 shell record,         48 bytes
;; 6 face records,        312 bytes
;; 6 loop records,        240 bytes
;; 6 surface records,    1112 bytes
;; 24 coedge records,    1344 bytes
;; 12 edge records,       960 bytes
;; 24 pcurve records,    2496 bytes
;; 8 vertex records,      288 bytes
;; 12 curve records,     1600 bytes
;; 8 point records,       576 bytes
;; Total storage 9164 bytes
;; "solid body"

[Top]


entity:rotate

Action
Rotates an entity or list of entities.

Filename
scm/scmext/kern/transform_scm.cpp

APIs
api_transform_entity

Syntax
(entity:rotate body-list [xorigin yorigin zorigin]
    xaxis yaxis zaxis angle [fix-transform])

Arg Types
body-list (entity | entity ...)
xorigin real
yorigin real
zorigin real
xaxis real
yaxis real
zaxis real
angle real
fix-transform boolean

Returns
(entity | entity ...)

Errors
Given entity or entities must be a body.

Description
This is a faster way to rotate entities in Scheme. Before (entity:rotate), one had to type:
(entity:transform ent (transform:rotation (position x y z)
    (gvector x y z) angle))


This shorthand version lets you do the same operation with: (entity:rotate ent x y z x y z)

Arguments
body-list specifies an entity or a list of entities that has to be rotated.
 
xorigin, yorigin, and zorigin specifies the origin point for rotation. If the origin values are not specified, then (0,0,0) is taken as the default origin.
 
xaxis, yaxis, and zaxis specifies the axis for rotation.
 
angle specifies the rotation angle in degrees.
 
fix-transform is an optional argument that allows the transforms to be fixed to the bodies (#t).
; entity:rotate
; Create a cylinder.
(define c (solid:cylinder
    (position 0 0 0) (position 10 10 10) 5))
;; c
; Move the cylinder.
(define move (entity:move c 10 0 0))
;; move
; Scale the cylinder.
(define scale1 (entity:scale c 3 1 1))
;; scale1
; Apply uniform scale.
(define scale2 (entity:scale c 2))
;; scale2
; Rotate about (position 20 0 0) (vector 0 0 1)
; by 90 degrees.
(define rotate1 (entity:rotate c 20 0 0 0 0 1 90))
;; rotate1
; Rotate about (position 0 0 0) (vector 0 0 1)
; by 90 degrees.
(define rotate2 (entity:rotate c 0 0 1 90))
;; rotate2
; Reflect across (position 40 0 0) (vector 1 0 0).
(define reflect1 (entity:reflect c 40 0 0 1 0 0))
;; reflect1
; Reflect across (position 0 0 0) (vector 1 0 0).
(define reflect2 (entity:reflect c 1 0 0))
;; reflect2

[Top]


entity:scale

Action
Scales an entity or list of entities uniformly or non-uniformly.

Filename
scm/scmext/kern/transform_scm.cpp

APIs
api_transform_entity

Syntax
(entity:scale body-list xscale
    [yscale=xscale zscale=xscale] [fix-transform])

Arg Types
body-list (entity | entity ...)
xscale real
yscale real
zscale real
fix-transform boolean

Returns
(entity | entity ...)

Errors
Given entity or entities must be a body. Must input either one or three positive scaling factors.

Description
This is a faster way to scale entities in Scheme. Before (entity:scale), one had to type:
(entity:transform ent (transform:scaling xscale [yscale zscale]))

This shorthand version lets you do the same operation with: (entity:scale ent xscale [yscale zscale])

Arguments
body-list specifies an entity or a list of entities that has to be scaled.
 
xscale, yscale, and zscale specifies the scaling along the X, Y, and Z axis respectively. If yscale and zscale are omitted, then uniform scaling is done using xscale along all the three axes.
 
fix-transform is an optional argument that allows the transforms to be fixed to the bodies (#t).
; entity:scale
; Create a cylinder
(define c (solid:cylinder
    (position 0 0 0) (position 10 10 10) 5))
;; c
; Move the cylinder.
(define move (entity:move c 10 0 0))
;; move
; Scale the cylinder.
(define scale1 (entity:scale c 3 1 1))
;; scale1
; Apply uniform scale.
(define scale2 (entity:scale c 2))
;; scale2
; Rotate about (position 20 0 0) (vector 0 0 1)
; by 90 degrees.
(define rotate1 (entity:rotate c 20 0 0 0 0 1 90))
;; rotate1
; Rotate about (position 0 0 0) (vector 0 0 1)
; by 90 degrees.
(define rotate2 (entity:rotate c 0 0 1 90))
;; rotate2
; Reflect across (position 40 0 0) (vector 1 0 0).
(define reflect1 (entity:reflect c 40 0 0 1 0 0))
;; reflect1
; Reflect across (position 0 0 0) (vector 1 0 0).
(define reflect2 (entity:reflect c 1 0 0))
;; reflect2

[Top]


entity:sense

Action
Determines if a scheme-object is a FORWARD.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
None

Syntax
(entity:sense in-entity)

Arg Types
in-entity entity

Returns
boolean

Description
This extension returns #t if the entity sense is FORWARD; otherwise, it returns #f. The input entity in-entity can be a face, edge, or coedge.

Arguments
in-entity specifies the entity whose sense has to be determined.
; entity:sense
; Create some edges to test.
(define e1 (edge:circular (position 0 0 0) 5))
;; e1
(entity:sense e1)
;; #t
(define e2 (edge:linear (position 10 0 0)
    (position 20 0 0)))
;; e2
(entity:sense e2)
;; #t

[Top]


entity:shells

Action
Gets a list of shell entities from a topological entity or list of entities.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_get_shells

Syntax
(entity:shells entity-list [include-pat])

Arg Types
entity-list entity | (entity ...)
include-pat integer

Returns
(shell ...)

Description
This extension returns a list of the entity's shells. If no shell entities are found, this extension returns an empty list.

Arguments
entity-list specifies a topological entity or an entity list.
 
The parameter include-pat determines how this function deals with patterned objects. By default, patterned objects are included in the list of entities. The user may specify any one of the following through this argument:

0
patterned objects are created if they do not already exist, and are included in the list.
1
only those patterned objects that have already been created are included in the list.
2
no patterned objects besides seed pattern objects are included in the list.
; entity:shells
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 25 15 5)))
;; block1
; Get a list of the block's shells.
(entity:shells block1)
;; (#[entity 3 1])

[Top]


entity:simplify-face-edge

Action
Simplifies the faces and edges of a body or the face and edges of a face.

Filename
scm/scmext/heal/scm_entity_simplify.cpp

APIs
api_simplify_entity

Syntax
(entity:simplify-face-edge ent-list [simp-opts] [acis-opts])

Arg Types
ent-list entity | (entity ...)
simp-opts simplify-options
acis-opts acis-options

Returns
(entity ...)

Description
This extention replaces the geometry of the faces and edges under the given entity by analytic surfaces and curves, if possible within the user-specified tolerance. The extension also provides the user with an option to replace the existing procedural geometry by its approximate B-Spline geometry, in case simplification with analytic geometry is not possible within the user-specified tolerance. The extension also provides the user with an option to force simplification, in which case simplification of the surface or curve (if possible within the user-specified tolerance) even if simplification would result in invalidities in the entity.

ent-list gives the list of entities or a single entity that can be a body, shell, lump, wire, face or edge.

The optional argument simp-options sets the parameters which govern the functionality of entity:simplify-face-edge. The constructor of simp-options sets the values of all the parameters as -1.

The parameters that can be set are:

"simplify_pos_tol" Default value is -1
"max_radius" Default value is -1
"do_curve_simplification" Valid values are: -1 (default setting), 0 (OFF), 1 (ON)
"do_surface_simplification" Valid values are: -1 (default setting), 0 (OFF), 1 (ON)
"do_approximate" Valid values are: -1 (default setting), 0 (OFF), 1 (ON)
"do_force_simplification" Valid values are: -1 (default setting), 0 (OFF), 1 (ON)

The value of -1 for any of the above 6 parameters indicates to entity:simplify-face-edge that it should use default values for that parameter. The default values that are chosen by the scheme command are:

"simplify_pos_tol" SPAresabs
"max_radius" SPAresabs/ SPAresnor
"do_curve_simplification" 1 (curve-simplification is ON)
"do_surface_simplification" 1 (surface-simplification is ON)
"do_approximate" 0 (do_approximate is OFF)
"do_force_simplification" 0 (do_force_simplification is OFF)

The optional argument acis-opts helps enable journaling and versioning options.

Arguments
ent-list gives the list of entities or a single entity that can be a body, shell, lump, wire, face or edge.
 
The optional argument simp-options sets the parameters which govern the functionality of entity:simplify-face-edge.
 
The optional argument acis-opts helps enable journaling and versioning options.

Note: The following scheme example is not a "standalone" script. It does not run to completion.

; entity:simplify-face-edge
(part:clear)
;; #t
; Load the body
(part:load "body1.sat")
;; (#[entity 2 1] #[entity 3 1] #[entity 4 1]
;; #[entity 5 1])
; Call simplification
(entity:simplify-face-edge (part:entities))
;; (#[entity 2 1] #[entity 3 1] #[entity 4 1]
;; #[entity 5 1])
; Alternatively call simplification with simplify-options
; Create a simplify-options object
(define simp_opts (entity:simplify-options "do_surface_simplification" 0))
;; simp_opts
(entity:simplify-face-edge (part:entities) simp_opts )
;; (#[entity 2 1] #[entity 3 1] #[entity 4 1]
;; #[entity 5 1])

[Top]


entity:simplify-options

Action
This extension returns an object of simplify-options.

Filename
scm/scmext/heal/scm_entity_simplify.cpp

APIs
None

Syntax
(entity:simplify-options "name-of-option" {value(s)} {options})

Arg Types
"name-of-option" string
value integer
options simplify-options

Returns
simplify-options

Errors
"simplify_pos_tol" option requires a real number as argument.
"max_radius" option requires a real number as argument.
"do_curve_simplificaition" option requires integer argument.
"do_surface_simplification" option requires integer argument.
"do_approximate" option requires integer argument.
"do_force_simplification" option requires integer argument.
Incorrect simplify option.

Description
This extension returns a simplify-options object for use in entity:simplify-face-edge. This allows the user to set the simplification tolerance, maximum permissible circle radius, the option of switching ON/OFF curve and face simplification, the option to replace procedural geometry by B-Spline geometry, and to do force simplification.

"name-of-option" is a string containing the name of the option. simplify-options object sets the parameters which govern the functionality of entity:simplify-face-edge. The parameters are:

"simplify_pos_tol" Default value is -1
"max_radius" Default value is -1
"do_curve_simplification" Valid values are: -1 (default setting), 0 (OFF), 1 (ON)
"do_surface_simplification" Valid values are: -1 (default setting), 0 (OFF), 1 (ON)
"do_approximate" Valid values are: -1 (default setting), 0 (OFF), 1 (ON)
"do_force_simplification" Valid values are: -1 (default setting), 0 (OFF), 1 (ON)

The default value of -1 for these parameters allows the respective algorithm to undergo its default behavior.

value is an integer value containing the value of option.

options is an existing simplify-options scheme object.

Arguments
"name-of-option" is a string containing the name of the option.
 
value is an integer value containing the value of option.
 
options is an existing simplify-options scheme object.

Note: The following scheme example is not a "standalone" script. It does not run to completion.

; entity:simplify-options
; Load the body
(part:load "body1.sat")
;; (#[entity 2 1] #[entity 3 1] #[entity 4 1]
;; #[entity 5 1])
; Make the simplification options object simplify-options
(define so (entity:simplify-options "do_curve_simplification"
     1 "simplify_pos_tol" 0.001))
;; so
; To check the values of parameters of simplify-options
; type the option's name on the prompt
so
;; #[Simplify_Options
;; simplify_pos_tol              : 0.001000
;; max_radius                    : Default
;; do_curve_simplification       : 1
;; do_surface_simplification     : 1
;; do_approximate                : Default
;; do_force_simplification       : Default]
; For updating the parameters of an existing simplify-options object
; the same scheme command (entity:simplify-options) can be used by
; passing the options object as the last argument.
(entity:simplify-options "do_surface_simplification" 0 so)
;; #[Simplify_Options
;; simplify_pos_tol              : 0.001000
;; max_radius                    : Default
;; do_curve_simplification       : 1
;; do_surface_simplification     : 0
;; do_approximate                : Default
;; do_force_simplification       : Default]
; Call simplification
(entity:simplify-face-edge (part:entities) so)
;; ()

[Top]


entity:tcoedges

Action
Gets the tcoedges from an entity or list of entities.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
None

Syntax
(entity:tcoedges entity-list [include-pat])

Arg Types
entity-list entity | (entity ...)
include-pat integer

Returns
(tcoedge ...)

Description
This extension returns a list of all of the tcoedges from the entity or list of entities. If no coedges are found, this extension returns an empty list.

Arguments
entity-list specifies an entity or an entity list.
 
The parameter include-pat determines how this function deals with patterned objects. By default, patterned objects are included in the list of entities. The user may specify any one of the following through this argument:

0
patterned objects are created if they do not already exist, and are included in the list.
1
only those patterned objects that have already been created are included in the list.
2
no patterned objects besides seed pattern objects are included in the list.
; entity:tcoedges
; Create a block
(define block (solid:block (position -10 -10 -10)
    (position 10 10 10)))
;; block
(iso)
;; #[view 1049018]
(zoom-all)
;; #[view 1049018]
; display the block's edges and make one tolerant
(view:edges #t)
;; #[view 1049018]
(define block_edges (entity:edges block))
;; block_edges
(define tol_edge (list-ref block_edges 0))
;; tol_edge
(entity:set-color tol_edge 3)
;; ()
; get the tolerant coedge, edge, and vertices
(entity:tcoedges block)
;; ()
(entity:tedges block)
;; ()
(entity:tvertices block)
;; ()

[Top]


entity:tedges

Action
Gets a list of all tedge entities in an entity or list of entities.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_get_tedges

Syntax
(entity:tedges entity-list [include-pat])

Arg Types
entity-list entity | (entity ...)
include-pat integer

Returns
(tedge ...)

Errors
api_get_tedges

Description
This extension returns a list of all of the tedges from the entity or list of entities. If no tedges are found, this extension returns an empty list.

Arguments
entity-list specifies an entity or an entity list.
 
The parameter include-pat determines how this function deals with patterned objects. By default, patterned objects are included in the list of entities. The user may specify any one of the following through this argument:

0
patterned objects are created if they do not already exist, and are included in the list.
1
only those patterned objects that have already been created are included in the list.
2
no patterned objects besides seed pattern objects are included in the list.
; entity:tedges
; Create a block
(define block (solid:block (position -10 -10 -10)
    (position 10 10 10)))
;; block
(iso)
;; #[view 1049018]
(zoom-all)
;; #[view 1049018]
; display the block's edges and make one tolerant
(view:edges #t)
;; #[view 1049018]
(define block_edges (entity:edges block))
;; block_edges
(define tol_edge (list-ref block_edges 0))
;; tol_edge
(entity:set-color tol_edge 3)
;; ()
; get the tolerant coedge, edge, and vertices
(entity:tcoedges block)
;; ()
(entity:tedges block)
;; ()
(entity:tvertices block)
;; ()

[Top]


entity:transform

Action
Applies a transform to a single entity or list of entities.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_transform_entity

Syntax
(entity:transform entity-list transform [ao])

Arg Types
entity-list entity | (entity ...)
transform transform
ao acis-options

Returns
entity | (entity ...)

Description
This extension returns the input entity or entity-list. Refer to the transform Scheme extensions for more information.

Arguments
The argument entity-list comprises any entity or list of entities to be transformed.
 
The argument transform is any valid transform.

ao contains journaling and versioning information.
; entity:transform
; Define a WCS.
(define wcs1
    (wcs (position 0 0 0) (position 5 0 0)
    (position 0 5 0)))
;; wcs1
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position -15 -25 -15)))
;; block1
; OUTPUT Original
; Copy the block.
(define copy
    (entity:copy block1))
;; copy
; Set the color for the copy.
(entity:set-color copy 3)
;; ()
; Transform the solid block.
(define transform (entity:transform copy
    (transform:axes (position 0 0 0) (gvector -8 0 0)
    (gvector 0 6 0))))
;; transform
(view:refresh)
;; #[view 107599568]
; OUTPUT Result

Figure. entity:transform

[Top]


entity:tvertices

Action
Gets a list of tvertices from an entity or list of entities.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_get_tvertices

Syntax
(entity:tvertices entity-list [include-pat])

Arg Types
entity-list entity | (entity ...)
include-pat integer

Returns
(tvertex ...)

Description
This extension returns a list of all of the tvertices from the entity or list of entities. If no tvertices are found, this extension returns an empty list.

Arguments
entity-list specifies an entity or an entity list.
 
The parameter include-pat determines how this function deals with patterned objects. By default, patterned objects are included in the list of entities. The user may specify any one of the following through this argument:

0
patterned objects are created if they do not already exist, and are included in the list.
1
only those patterned objects that have already been created are included in the list.
2
no patterned objects besides seed pattern objects are included in the list.
; entity:tvertices
; Create a block
(define block (solid:block (position -10 -10 -10)
    (position 10 10 10)))
;; block
(iso)
;; #[view 1049018]
(zoom-all)
;; #[view 1049018]
; display the block's edges and make one tolerant
(view:edges #t)
;; #[view 1049018]
(define block_edges (entity:edges block))
;; block_edges
(define tol_edge (list-ref block_edges 0))
;; tol_edge
(entity:set-color tol_edge 3)
;; ()
; get the tolerant coedge, edge, and vertices
(entity:tcoedges block)
;; ()
(entity:tedges block)
;; ()
(entity:tvertices block)
;; ()

[Top]


entity:wires

Action
Gets a list of wires from an entity or list of entities.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
api_get_wires

Syntax
(entity:wires entity-list [include-pat])

Arg Types
entity-list entity | (entity ...)
include-pat integer

Returns
(wire ...)

Description
This extension returns a list of the entity's wires. If no wire entities are found, this extension returns an empty list.

Arguments
entity-list specifies an entity or an entity list.
 
The parameter include-pat determines how this function deals with patterned objects. By default, patterned objects are included in the list of entities. The user may specify any one of the following through this argument:

0
patterned objects are created if they do not already exist, and are included in the list.
1
only those patterned objects that have already been created are included in the list.
2
no patterned objects besides seed pattern objects are included in the list.
; entity:wires
; Create circular edge 1.
(define edge1
    (edge:circular (position 0 0 0) 25 0 180))
;; edge1
; Create circular edge 2.
(define edge2
    (edge:circular (position 0 0 0) 25 180 270))
;; edge2
; Create linear edge 3.
(define edge3
    (edge:linear (position 0 0 0) (position 25 0 0)))
;; edge3
; Create a wire body from the three edges.
(define body1
    (wire-body (list edge3 edge1 edge2)))
;; body1
; Get a list of the body's wires.
(entity:wires body1)
;; (#[entity 6 1])

[Top]


entity?

Action
Determines if a scheme-object is an entity.

Filename
scm/scmext/kern/ent_scm.cpp

APIs
None

Syntax
(entity? object)

Arg Types
object scheme-object

Returns
boolean

Description
Returns #t if a scheme-object is an entity.

Arguments
object specifies the scheme-object that has to be queried for an entity.
; entity?
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 5 15 25)))
;; block1
; Create something that is not an entity.
(define stuff 123)
;; stuff
; Determine if the block is an entity.
(entity? block1)
;; #t
; Determine if "stuff" is an entity.
(entity? stuff)
;; #f

[Top]


entray

Action
Creates an entray.

Filename
scm/scmext/kern/eray_scm.cpp

APIs
None

Syntax
(entray entity ray)

Arg Types
entity entity
ray ray

Returns
entray

Description
An entray is a scheme-object with an entity component and a ray component. They are not saved when a part is saved. Entrays are represented externally in the form #[entray n p (x y z) (a b c)], indicating its entity components are #[entity n p] and its ray components are #[ray (x y z) (a b c)].

Arguments
The argument entity specifies the entity component.
 
The argument ray specifies the ray component.
; entray
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 10 15 5)))
;; block1
; Create an entity ray using the block.
(entray block1
    (ray (position 0 0 0)
    (gvector 0 0 1)))
;; #[entray 2 1 (0 0 0) (0 0 1)]

[Top]


entray:entity

Action
Gets the entity component of an entray.

Filename
scm/scmext/kern/eray_scm.cpp

APIs
None

Syntax
(entray:entity entray)

Arg Types
entray entray

Returns
entity

Description
Gets the entity component of an entray. An entray is a scheme-object with an entity component and a ray component. Entrays are represented externally in the form #[entray n p (x y z) (a b c)], indicating its entity components are #[entity n p] and its ray components are #[ray (x y z) (a b c)].

Arguments
entray specifies the entray object that has to be queried.
; entray:entity
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 15 15 15)))
;; block1
; Create an entity ray and then extract
; the entity portion.
(entray:entity (entray block1
    (ray (position 0 0 0) (gvector 0 0 1))))
;; #[entity 2 1]

[Top]


entray:ray

Action
Gets the ray component of an entray.

Filename
scm/scmext/kern/eray_scm.cpp

APIs
None

Syntax
(entray:ray entray)

Arg Types
entray entray

Returns
ray

Description
Gets the ray component of an entray. An entray is a scheme-object with an entity component and a ray component. Entrays are represented externally in the form #[entray n p (x y z) (a b c)], indicating its entity components are #[entity n p] and its ray components are #[ray (x y z) (a b c)].

Arguments
entray specifies the entray object that has to be queried.
; entray:ray
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 15 15 15)))
;; block1
; Create an entity ray and then extract
; the ray portion.
(entray:ray (entray block1
    (ray (position 0 0 0) (gvector 0 0 1))))
;; #[ray (0 0 0) (0 0 1)]

[Top]


entray?

Action
Determines if a scheme-object is an entity-with-ray.

Filename
scm/scmext/kern/eray_scm.cpp

APIs
None

Syntax
(entray? object)

Arg Types
object scheme-object

Returns
boolean

Description
Returns #t if a scheme-object is an entity-with-ray.

Arguments
object specifies the scheme-object that has to be queried for an entray.
; entray?
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 15 15 15)))
;; block1
; Create an entity ray consisting of
; the block and a ray, and determine if
; the result is an entity ray.
(define entray1 (entray block1
    (ray (position 0 0 0) (gvector 0 0 1))))
;; entray1
; Determine if the result is an entity ray.
(entray? entray1)
;; #t

[Top]


env:load-state

Action
Loads the states of global variables (such as options and tolerances) from the given text file and sets the values to the variables.

Filename
scm/scmext/kern/fileinfo_scm.cpp

APIs
api_load_state

Syntax
(env:load-state filename)

Arg Types
filename string

Returns
boolean

Description
Attempting to load a nonexistent file generates an "Access Violation" type error message.

Arguments
filename is a string specifying the name of the file containing the global variables to set.

Note: The following scheme example is not a "standalone" script. It does not run to completion.

; env:load-state
; Load variables and their values from the file.
(env:load-state "log.log")
;; #t

[Top]


env:restored-product-id

Action
Returns the restored product information.

Filename
scm/scmext/kern/fileinfo_scm.cpp

APIs
None

Syntax
(env:restore-product-id)

Arg Types
None

Returns
string

Description
The Fileinfo class contains additional file header information, such as the ACIS product used to save the model, ACIS version, millimeters per model unit, date the model was saved, ACIS save file version, and other relevant model data. It is required that units and product ID in the save FileInfo be populated before you can save a SAT file.

; env:restored-product-id
; Run the command.
(env:save-product-id)
;; "ACIS/Scheme AIDE - 10.0"
; Get the saved product id from the FileInfo object.
(env:restored-product-id)
;; ""

[Top]


env:restored-units-scale

Action
Returns the restored units scale.

Filename
scm/scmext/kern/fileinfo_scm.cpp

APIs
None

Syntax
(env:restored-units-scale)

Arg Types
None

Returns
real

Description
The Fileinfo class contains additional file header information, such as the ACIS product used to save the model, ACIS version, millimeters per model unit, date model was saved, ACIS save file version, and other relevant model data. It is required that units and product ID in the save Fileinfo be populated before you can save a SAT file.

; env:restored-units-scale
; Get the restored units scale from the Fileinfo
; object.
(env:restored-units-scale)
;; -1

[Top]


env:save-product-id

Action
Returns the save product information.

Filename
scm/scmext/kern/fileinfo_scm.cpp

APIs
None

Syntax
(env:save-product-id)

Arg Types
None

Returns
string

Description
The Fileinfo class contains additional file header information, such as the ACIS product used to save the model, ACIS version, millimeters per model unit, date model was saved, ACIS save file version, and other relevant model data. It is required that units and product ID in the save Fileinfo be populated before you can save a SAT file.

; env:save-product-id
; Get the save product id from the Fileinfo object.
(env:save-product-id)
;; "ACIS/Scheme AIDE - 10.0"

[Top]


env:save-state

Action
Saves the current states of global variables such as options and tolerances into a text file.

Filename
scm/scmext/kern/fileinfo_scm.cpp

APIs
api_save_state

Syntax
(env:save-state filename)

Arg Types
filename string

Returns
boolean
Arguments
filename is a string specifying the name of the file for storing the global variables. If filename is not specified, information prints to the console only.
; env:save-state
; Save the state into "state.log".
(env:save-state "log.log")
;; #t

[Top]


env:save-units-scale

Action
Gets the save units scale.

Filename
scm/scmext/kern/fileinfo_scm.cpp

APIs
None

Syntax
(env:save-units-scale)

Arg Types
None

Returns
real

Description
The Fileinfo class contains additional file header information, such as the ACIS product used to save the model, ACIS version, millimeters per model unit, date model was saved, ACIS save file version, and other relevant model data. It is required that units and product ID in the save Fileinfo be populated before you can save a SAT file.

; env:save-units-scale
; Set the save units scale.
(env:set-save-units-scale .5)
;; 0.5
; Get the save units scale from the Fileinfo object.
(env:save-units-scale)
;; 0.5
; Change the save units scale.
(env:set-save-units-scale .7)
;; 0.7
; Get the new saved units scale.
(env:save-units-scale)
;; 0.7

[Top]


env:set-save-units-scale

Action
Sets the save units scale value in Fileinfo.

Filename
scm/scmext/kern/fileinfo_scm.cpp

APIs
api_set_file_info

Syntax
(env:set-save-units-scale scale)

Arg Types
scale real

Returns
real

Description
The Fileinfo class contains additional file header information, such as the ACIS product used to save the model, ACIS version, millimeters per model unit, date model was saved, ACIS save file version, and other relevant model data. It is required that units and product ID in the save Fileinfo be populated before you can save a SAT file.

Arguments
scale specifies the scale value to set.
; env:set-save-units-scale
; Set the save units scale.
(env:set-save-units-scale .5)
;; 0.5
; Get the save units scale from the Fileinfo object.
(env:save-units-scale)
;; 0.5
; Change the save units scale.
(env:set-save-units-scale .7)
;; 0.7
; Get the new saved units scale.
(env:save-units-scale)
;; 0.7

[Top]


env:set-tolerance

Action
Sets the following system tolerances: SPAresabs, SPAresnor, SPAresfit, and SPAresmch.

Filename
scm/scmext/kern/tol_scm.cpp

APIs
None

Syntax
(env:set-tolerance resabs=1e-6 resnor=1e-10
    resfit=1e-3 resmch=1e-11)

Arg Types
resabs real | boolean
resnor real | boolean
resfit real | boolean
resmch real | boolean

Returns
(integer ...) . (real ...)

Description
The system tolerances are set in the following order: SPAresabs, SPAresnor, SPAresfit, and SPAresmch. SPAresabs to SPAresnor gives the largest numbers that can be represented. The previous values of each variable are returned in a list.

Arguments
resabs determines if two positions in space are equal. This tolerance defines the smallest distance between two distinct points.
 
resnor checks a number for equality with 0. This checks components of numbers that are 0 for determining if vectors are parallel or perpendicular, or for checking for zero lengths.
 
resfit fits interpolation curves when intersecting surfaces.
 
resmch is used by the spline package for purposes similar to the use of SPAresnor in the system.
 
For each element argument, a real sets the value, a boolean #f leaves it unchanged, and boolean #t sets it to the default value.

Note: Changing these values can have a significant effect on modeling functionality and should only be undertaken when absolutely necessary!

; env:set-tolerance
; Change the resabs and resfit tolerances, leave
; resnor unchanged, and set resmch to the default.
; Get the list of system tolerances.
(env:tolerance)
;; (1e-06 1e-10 0.001 1e-11)
(env:set-tolerance 1e-3 #f 0.1 #t)
;; (0.001 1e-10 0.1 1e-11)
; Get the list of system tolerances.
(env:tolerance)
;; (0.001 1e-10 0.1 1e-11)
; Reset the tolerances.
(env:set-tolerance 1e-06 1e-10 0.001 1e-11)
;; (1e-06 1e-10 0.001 1e-11)

[Top]


env:tolerance

Action
Gets a list of system tolerances.

Filename
scm/scmext/kern/tol_scm.cpp

APIs
None

Syntax
(env:tolerance)

Arg Types
None

Returns
(integer ...) . (real ...)

Description
The system tolerances are returned in the following order: SPAresabs, SPAresnor, SPAresfit, and SPAresmch.

SPAresabs
determines if two positions in space are equal. This tolerance defines the smallest distance between two distinct points.
SPAresnor
checks a number for equality with 0. This checks components of numbers that are 0 for determining if vectors are parallel or perpendicular, or for checking for zero lengths.
SPAresfit
fits interpolation curves when intersecting surfaces.
SPAresmch
is used by the spline package for purposes similar to the use of SPAresnor in the system.
; env:tolerance
; Get the list of system tolerances.
(env:tolerance)
;; (1e-006 1e-010 0.001 1e-011)

[Top]