Scheme Extensions

 

 

Technical Article


Scheme is a public domain programming language, based on the LISP language, that uses an interpreter to run commands. ACIS provides extensions (written in C++) to the native Scheme language that can be used by an application to interact with ACIS through its Scheme Interpreter. The C++ source files for ACIS Scheme extensions are provided with the product. Spatial's Scheme based demonstration application, Scheme ACIS Interface Driver Extension (Scheme AIDE), also uses these Scheme extensions and the Scheme Interpreter.

body:clash

Action
Tests whether the two bodies clash.

Filename
intr/intr_scm/clash_scm.cpp

APIs
api_clash_bodies

Syntax
(body:clash body-a body-b [mode] [behavior] [ao])

Arg Types
body-a body
body-b body
mode string
behavior string
ao acis-options

Returns
boolean ["exit" mode]
string ["bodies" mode]
(string (entity entity string) (entity entity string)...)["sub_entities" mode]
Description
This extension tests whether the input bodies clash: that is, whether there are points on both bodies which are within resabs of each other. The level of detail returned about the clash between the entities is controlled by the mode argument, which can take one of the values “exist”, “bodies” or “sub_entities”. The choice of mode affects the level of detail, performance, and return value from the extension as follows:

Note: All clashing face-pairs are returned; not only those that appear “significant”. For example, consider the case where two cubic bodies abut with a coincident face-pair. Ten face-pairs are returned in the clash data structure, as each face of the coincident pair also clashes with the four faces adjoining the coincident ones.

Arguments
body-a specifies the first body to test.
 
body-b specifies the second body to test.
 
mode specifies the operation mode for the clash test.
 
behavior specifies which behavior variation to use during clash testing.
 
mpo is an optional massprops-options object used to specify non-default behavior. It is configured using massprops-options extensions.
 
ao is used to set options related to journaling and versioning.
Limitations
At present, any wires in the bodies (including pure wires bodies) are not considered for the purposes of determining whether the bodies clash. How the extension behaves when wires are present can be altered using the behavior argument. Valid strings for this are “ignore_wires” and “reject_wires”. The differences in behavior are as follows:
; body:clash
; Create a pair of interlocking cylindrical bodies
(define c1 (solid:cylinder (position -10 0 0) (position 5 0 0) 5))
;c1
(define c2 (solid:cylinder (position -5 0 0) (position 10 0 0) 5))
;c2
; Test for clash between the bodies
(body:clash c1 c2 'sub_entities)
; ("Bodies interlock" (#[face 6 1] #[face 3 1] "Coincident, inside")
; (#[face 6 1] #[face 5 1] "Containment, B in A")
; (#[face 4 1] #[face 3 1] "Containment, A in B"))

[Top]


body:massprops

Action
Analyzes the mass properties of a body.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
api_body_mass_props

Syntax
(body:massprops body [mpo] [ao])

Arg Types
body body
mpo massprops-options
ao acis-options

Returns
massprops

Errors

A zero-length normal is specified through the mpo argument.
A negative accuracy is requested through the mpo argument.
A negative sheet thickness is specified through the mpo argument.
A void or an open, single-sided sheet was encountered. (The user may avoid this type of error by using massprops-options:set-one-sided-sheet-opt with an argument of "2sided" or "solid", as appropriate. Please see the documentation of this extension for further details.)

Description
The argument body represents the body whose mass properties are desired. The optional mpo argument encapsulates all options affecting the calculation.

This extension finds the volume, center of gravity (centroid), and moments of inertia of the given body. The center of gravity is calculated with respect to the world coordinate system. The moments of inertia are also calculated with respect to the world coordinate system, which means that the first and second moments will change if the body is transformed. Options controlling the calculation are specified by means of an (optional) massprops-options object; the results are returned in the form of a massprops object. Please refer to the documentation of these two Scheme data types for details on setting options and retrieving the calculated results, respectively.

The principal axes are defined with respect to the world coordinate system. The direction of each axis is defined by a unit vector. Each axis should be orthogonal to the other two axes.

The principal moments of inertia are with respect to the coordinate system defined by the center of gravity and the principal axes. (These three values should be relatively constant under translation and rotation transformations, although their order may change depending on the principal axes.)

The major diagonal of the inertia tensor returned contains values for the inertias about each axis. For the inertia about the x-axis:
(integral)((y*y + z*z)dV)
the off-diagonal terms are for the products of inertia; for example:
(integral)((x*y)dV)
The values for mass properties should be expected to be different, depending on the normal to the projection plane, for many types of objects. One should attempt to select a projection plane that will simplify the body as much as possible. For instance, if the body were an extrusion, one would choose a plane perpendicular to the extrusion direction. This makes the numerical integration simpler.

When the massprops-options argument is omitted, the following default behavior is followed:
1) projection-plane information is selected internally;
2) volume, centroid, and inertia are all calculated;
3) the requested relative accuracy for the volume is one-percent;
4) sheets are treated as having zero thickness; and,
5) errors are thrown when voids or open, one-sided sheets are encountered.

The user should provide a massprops-options object configured otherwise if some alternate behavior is preferred.

Arguments
body is an input body.
 
mpo is an optional massprops-options object used to specify non-default behavior. It is configured using massprops-options extensions.
 
ao is used to set options related to journaling and versioning.
; body:massprops
; Define parameters for creating a sphere
(define radius 2)
;;radius
(define center (position 1 2 3))
;;center
; Make a spherical sheet body, and turn it inside-out
(define body (sheet:face (face:sphere center radius)))
;;body
(body:reverse body)
;;#[entity 2 1]
; Try to find its mass properties - by default, error thrown when encountering a void
(define mp (body:massprops body))
;;*** Error body:massprops: body forms a void; volume not calculated
;
; Change options to obtain alternate behavior
;
; Start with the default options object
(define mpo (massprops:options))
;;mpo
; Examine the default options
mpo
;;#[massprops-options:
;;     level = "volume-centroid-and-inertia",
;;     accy = 0.01,
;;     use-plane-info = #f,
;;     plane-root = (0 0 0),
;;     plane-normal = (0 0 1),
;;     thickness = 0,
;;     one-sided-sheet-opt = "closed-only"]
; Force calculation as a solid
(massprops-options:set-one-sided-sheet-opt mpo "solid")
;;"error"
; Calculate only volume
(massprops-options:set-level mpo "volume-only")
;;"volume-centroid-and-inertia"
; Increase the required accuracy to 0.1%
(massprops-options:set-req-rel-accy mpo 0.001)
;;0.01
; Examine the new options
mpo
;;#[massprops-options:
;;     level = "volume-only",
;;     accy = 0.001,
;;     use-plane-info = #f,
;;     plane-root = (0 0 0),
;;     plane-normal = (0 0 1),
;;     thickness = 0,
;;     one-sided-sheet-opt = "solid"]
; Redo the calculation with the new options
(define mp (body:massprops body mpo))
;;mp
; Examine the volume
(massprops:get-volume mp)
;;-33.5103216382911
; Examine the achieved accuracy
(massprops:get-rel-accy-vol-achieved mp)
;;0
;
; Now recalculate as if the sheet was double-sided, with a small thickness
(massprops-options:set-one-sided-sheet-opt mpo "2sided")
;;"solid"
(massprops-options:set-sheet-thickness mpo 0.01)
;;0
; Calculate everything this time
(massprops-options:set-level mpo "volume-centroid-and-inertia")
;;"volume-only"
; Examine the new options one-by-one
(massprops-options:get-one-sided-sheet-opt mpo)
;;"2sided"
(massprops-options:get-sheet-thickness mpo)
;;0.01
(massprops-options:get-level mpo)
;;"volume-centroid-and-inertia"
(massprops-options:get-req-rel-accy mpo)
;;0.001
(massprops-options:get-use-plane-info mpo)
;;#f
(massprops-options:get-plane-info mpo)
;;(#[position 0 0 0] . #[gvector 0 0 1])
; Redo the calculation with the new options
(define mp (body:massprops body mpo))
;;mp
; Examine the volume
(massprops:get-volume mp)
;;0.502654824574367
; Examine the achieved accuracy
(massprops:get-rel-accy-vol-achieved mp)
;;0
; Examine the centroid
(massprops:get-centroid mp)
;;#[position 1 2 3]
; Examine the inertia
(massprops:get-inertia mp)
;;(7.87492558499842 1.00530964914873 1.5079644737231 1.00530964914873 6.3669611112
;;7531 3.0159289474462 1.5079644737231 3.0159289474462 3.85368698840348)
; Find the principal moments
(massprops:get-p-moments mp)
;;(1.34041286553164 1.34041286553165 1.34041286553164)
; Find the principal axes
(massprops:get-p-axes mp)
;;(#[gvector 1 0 0] #[gvector 0 1 0] #[gvector 0 0 1])
;
; Repeat the previous calculation with specified projection-plane information
(massprops-options:set-use-plane-info mpo #t)
;;#f
(massprops-options:set-plane-info mpo (position -1 -2 -3) (gvector 1 0 0))
;;(#[position 0 0 0] . #[gvector 0 0 1])
; Just calculate volume
(massprops-options:set-level mpo "volume-only")
;;"volume-centroid-and-inertia"
; Redo the calculation with the new options
(define mp (body:massprops body mpo))
;;mp
; Examine the volume
(massprops:get-volume mp)
;;0.502654824574367

[Top]


curve:intersect

Action
Gets the intersection between two edges or curves.

Filename
scm/scmext/intr/icrv_scm.cpp

APIs
api_intersect_curves

Syntax
(curve:intersect curve1 curve2 [bounded=#t] [acis-opts])

Arg Types
curve1 curve | edge
curve2 curve | edge
bounded boolean
acis-opts acis-options

Returns
(position ...)

Errors
EDGE with no CURVE
Description
This extension returns an empty list if the curves do not intersect. It returns a list of positions where the input curves intersect if there is a finite number of intersection points. If the boolean bounded is #t, the default, and if the curves share a portion of the underlying geometry, then this extension returns a list containing the endpoints of the shared portion. If the boolean bounded is #f, and if the curves share a portion of the underlying geometry, then this extension returns a list of the endpoints of the shared portion.

The bounded geometry of a spline edge and the fully underlying geometry of spline edges coincide. Thus, when bounded is #f, extrapolated extensions of spline edges does not occur.

Arguments
curve1 specifies an edge or a curve.

curve2 specifies a curve.

If bounded is #t, this extension only reports intersections within curve bounds.

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

Limitations
The acis-options object only applies to api_intersect_curves.
; curve:intersect
; Create circular edge 1.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
; Create circular edge 2.
(define edge2 (edge:circular
    (position 0 10 0) 20 -180))
;; edge2
; Determine the intersections of the two edges.
(curve:intersect edge1 edge2)
;; (#[position -18.9983551919633 16.25 0]
;; #[position 18.9983551919633 16.25 0])
; Additional example.
(define line1 (edge:linear (position 0 5 0)
    (position 0 -40 0)))
;; line1
(define line2 (edge:linear (position -40 -10 0)
    (position 20 5 0)))
;; line2
; find point of intersection between lines and
; but only intersections within bounds
(curve:intersect line1 line2)
;; (#[position 0 4.44089209850063e-16 0])
(curve:intersect line1 line2 #f)
;; (#[position 0 4.44089209850063e-16 0])

[Top]


cvty:concave

Action
Determines whether a given cvty is concave or not.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(cvty:concave cvty)

Arg Types
cvty scm_cvty

Returns
boolean

Description
This extension returns #t if the given cvty is concave and #f if it is not. Equivalent to the C++ cvty::concave.

Note: Additional enquiry functions such as cvty:concave-tangent etc. are defined in scm/examples/cvty.scm.

Arguments
cvty represents the convexity at a point or along a single edge (or something equivalent), such as convex, tangent convex etc.
; cvty:concave
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
; Determine if an edge is concave
(cvty:concave (pt-cvty-info:instantiate
    (edge:mid-pt-cvty-info
    (list-ref edge-list 0)) -1))
;; #f

[Top]


cvty:convex

Action
Determines whether a given cvty is convex or not.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(cvty:convex cvty)

Arg Types
cvty scm_cvty

Returns
boolean

Description
This extension returns #t if the given cvty is convex and #f if it is not. Equivalent to the C++ cvty::convex.

Note: Additional enquiry functions such as cvty:convex-tangent etc. are defined in scm/examples/cvty.scm.

Arguments
cvty represents the convexity at a point or along a single edge (or something equivalent), such as convex, tangent convex etc.
; cvty:convex
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
; Determine if an edge is convex
(cvty:convex (pt-cvty-info:instantiate
    (edge:mid-pt-cvty-info
    (list-ref edge-list 0)) -1))
;; #t

[Top]


cvty:inflect

Action
Determines whether the given cvty is inflected or not.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(cvty:inflect cvty)

Arg Types
cvty scm_cvty

Returns
boolean

Description
Returns #t if the given cvty is inflected and #f if not. Equivalent to the C++ cvty::inflect.

Note: Additional enquiry functions such as cvty:tangent-inflect etc. are defined in scm/examples/cvty.scm.

Arguments
cvty represents the convexity at a point or along a single edge (or something equivalent), such as convex, tangent convex etc.
; cvty:inflect
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(cvty:inflect (pt-cvty-info:instantiate
    (edge:mid-pt-cvty-info
    (list-ref edge-list 0)) -1))
;; #f

[Top]


cvty:knife

Action
Determines whether the given cvty is of knife convexity or not.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(cvty:knife cvty)

Arg Types
cvty scm_cvty

Returns
boolean

Description
Returns #t if the given cvty is knife and #f if not. Equivalent to the C++ cvty::knife.

Note: Additional enquiry functions such as cvty:knife-convex are defined in scm/examples/cvty.scm

Arguments
cvty represents the convexity at a point or along a single edge (or something equivalent), such as convex, tangent convex etc.
; cvty:knife
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(cvty:knife (pt-cvty-info:instantiate
    (edge:mid-pt-cvty-info
    (list-ref edge-list 0)) -1))
;; #f

[Top]


cvty:mixed

Action
Determines whether the given cvty is of mixed convexity or not.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(cvty:mixed cvty)

Arg Types
cvty scm_cvty

Returns
boolean

Description
Returns #t if the given cvty is of mixed convexity and #f if not. Equivalent to the C++ cvty::mixed.

Note: Additional enquiry functions such as cvty:tangent-mixed are defined in scm/examples/cvty.scm.

Arguments
cvty represents the convexity at a point or along a single edge (or something equivalent), such as convex, tangent convex etc.
; cvty:mixed
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(cvty:mixed (pt-cvty-info:instantiate
    (edge:mid-pt-cvty-info
    (list-ref edge-list 0)) -1))
;; #f

[Top]


cvty:tangent

Action
Determines whether the given cvty is tangent or not.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(cvty:tangent cvty)

Arg Types
cvty scm_cvty

Returns
boolean

Description
Returns #t if the given cvty is tangent and #f if not. Equivalent to the C++ cvty::tangent.

Note: Additional enquiry functions such as cvty:concave-tangent are defined in scm/examples/cvty.scm.

Arguments
cvty represents the convexity at a point or along a single edge (or something equivalent), such as convex, tangent convex etc.
; cvty:tangent
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(cvty:tangent (pt-cvty-info:instantiate
    (edge:mid-pt-cvty-info
    (list-ref edge-list 0)) -1))
;; #f

[Top]


cvty:unknown

Action
Determines whether this cvty is unknown or not.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(cvty:unknown cvty)

Arg Types
cvty scm_cvty

Returns
boolean

Description
Returns #t if the given cvty is unknown and #f if not. Equivalent to the C++ cvty::unknown.

Arguments
cvty represents the convexity at a point or along a single edge (or something equivalent), such as convex, tangent convex etc.
; cvty:unknown
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(cvty:unknown (pt-cvty-info:instantiate
    (edge:mid-pt-cvty-info
    (list-ref edge-list 0)) -1))
;; #f

[Top]


cvty:unset

Action
Determines whether this cvty is unset or not.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(cvty:unset cvty)

Arg Types
cvty scm_cvty

Returns
boolean

Description
Returns #t if the given cvty is unset and #f if not. Equivalent to the C++ cvty::unset.

Arguments
cvty represents the convexity at a point or along a single edge (or something equivalent), such as convex, tangent convex etc.
; cvty:unset
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(cvty:unset (pt-cvty-info:instantiate
    (edge:mid-pt-cvty-info
    (list-ref edge-list 0)) -1))
;; #f

[Top]


ed-cvty-info:angles

Action
Returns the angles recorded in an ed-cvty-info attribute.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(ed-cvty-info:angles ed-cvty-info)

Arg Types
ed-cvty-info scm_ed_cvty_info

Returns
(real . real)

Description
Returns the maximum and minimum signed angles between face normals along an edge, as stored in the ed-cvty-info. Negative numbers imply concave, positive numbers imply convex. Equivalent to the C++ ed_cvty_info::angles.

Arguments
ed-cvty-info stores the maximum and minimum signed angles between face normals along an edge.
; ed-cvty-info:angles
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
; Get recorded angles.
(ed-cvty-info:angles (edge:ed-cvty-info
    (list-ref edge-list 0)))
;; (1 . 1)

[Top]


ed-cvty-info:instantiate

Action
Instantiate the given cvty convexity information to a given tolerance.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(ed-cvty-info:instantiate ed-cvty-info tolerance)

Arg Types
ed-cvty-info scm_ed_cvty_info
tolerance real

Returns
scm_cvty

Description
Based on the given angle tolerance for determining the limit for 'smoothness', this extension determines the convexity of the edge for which the ed-cvty-info was computed. Equivalent to the C++ ed_cvty_info::instantiate.

Arguments
ed-cvty-info represents the convexity of an edge.

tolerance specifies the angle tolerance.
; ed-cvty-info:instantiate
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(ed-cvty-info:instantiate (edge:ed-cvty-info
    (list-ref edge-list 0)) .01)
;; #[cvty: cvx]

[Top]


ed-cvty-info:tangent-convexity

Action
Returns the tangent convexity of an ed-cvty-info.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(ed-cvty-info:tangent-convexity ed-cvty-info)

Arg Types
ed-cvty-info scm_ed_cvty_info

Returns
scm_ed_cvty_info

Description
This extension returns the convexity of an ed-cvty-info if that edge was viewed with an angle tolerance large enough for it to be considered a smooth (tangent) edge. Entirely equivalent to the C++ ed_cvty_info::tangent_convexity.

Arguments
ed-cvty-info represents the convexity of an edge.
; ed-cvty-info:tangent-convexity
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(ed-cvty-info:tangent-convexity
    (edge:ed-cvty-info (list-ref edge-list 0)))
;; #[cvty: knf]
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(ed-cvty-info:tangent-convexity
    (edge:ed-cvty-info (list-ref edge-list 0)))
;; #[cvty: knf]

[Top]


ed-cvty-info:unknown

Action
Returns whether the convexity of an ed-cvty-info is unknown.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(ed-cvty-info:unknown ed-cvty-info)

Arg Types
ed-cvty-info scm_ed_cvty_info

Returns
boolean

Description
Returns #t if the convexity computed in an ed-cvty-info is unknown. Otherwise, it returns #f. Equivalent to the C++ ed_cvty_info::unknown.

Arguments
ed-cvty-info represents the convexity of an edge.
; ed-cvty-info:unknown
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(ed-cvty-info:unknown (edge:ed-cvty-info
    (list-ref edge-list 0)))
;; #f

[Top]


ed-cvty-info:unset

Action
Returns whether the convexity of an ed-cvty-info is unset.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(ed-cvty-info:unset ed-cvty-info)

Arg Types
ed-cvty-info scm_ed_cvty_info

Returns
boolean

Description
Returns #t if the convexity computed in an ed-cvty-info is unset. Otherwise it returns #f. Equivalent to the C++ ed_cvty_info::unset. It should not actually be possible to create an "unset" ed-cvty-info, but this function is provided for completeness.

Arguments
ed-cvty-info represents the convexity of an edge.
; ed-cvty-info:unset
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
; Find out whether convexity is unset.
(ed-cvty-info:unset (edge:ed-cvty-info
    (list-ref edge-list 0)))
;; #f

[Top]


edge:check-geometry

Action
Checks the geometry on an EDGE.

Filename
scm/scmext/intr/chk_scm.cpp

APIs
api_check_edge

Syntax
(edge:check-geometry edge [insanity-type] [acis-opts])

Arg Types
edge edge
insanity-type string
acis-opts acis-options

Returns
entity | (entity ...)

Description
This extension performs geometric checks on an edge. The results are printed to the debug file, which can be set with the debug:file extension.

Arguments
edge represents the input edge.

With the optional argument insanity-type, only the specified insanities are printed to the debug file. The option check_abort becomes invalid when insanity-type is specified. The valid insanity-types are "ERROR", "WARNING', or "NOTE".

The optional argument acis-opts helps enable journaling and versioning options.
; edge:check-geometry
; Internal knot multiplicities creates a G1 discontinuity
(define ctrlpts_pos (list (position -2 0 0)(position -1.5 0 0)(position 0 0 0)
                    (position .75 0.5 0)(position 1 0.5 0)(position 1.1 1 0)
                    (position 1.2 1 0)(position 1.5 1 0) (position 1.9 .75 0)
                    (position 2 0.5 0)(position 2.1 .25 0)(position 2.5 0 0)
                    (position 3 0 0)(position 4 0 0)))
;; ctrlpts_pos
(define knot_v (list 0 0 0 1 2 3 4 4 4 5 6 7 7 7 8 9 9 9))
;; knot_v
(define spline (edge:spline-from-ctrlpts ctrlpts_pos knot_v))
;; spline
; This should report: entid [nnn]: Warning: curve not G1
(edge:check-geometry spline)
;; entid 22318448: Warning: curve not G1
;; ()

[Top]


edge:check-smoothness

Action
Analyzes a curve for C1 or G1 discontinuities.

Filename
scm/scmext/intr/curve_chk_smooth_scm.cpp

APIs
api_check_cur_smoothness

Syntax
(edge:check-smoothness edge [acis-opts])

Arg Types
edge edge
acis-opts acis-options

Returns
List of paired list. Each pair contains the type of discontinuity and corresponding parametric space point on the edge.

Description
Given an edge, this function examines the underlying curve and returns a list of parametric space points where there are C1/G1 discontinuities. The discontinuities can be of the following types:

Arguments
edge represents the given input edge.

acis-opts contains parameters for versioning and journaling.

Limitations
This extension works only for intcurves because other curves are always continuous.

Example

(part:clear)
;list of control points
(define ctrlpts_pos (list (position -2 0 0) (position -1.5 0 0) (position 0 0 0)
                    (position .75 0.5 0) (position 1 0.5 0) (position 1.1 1 0)
                    (position 1.2 1 0) (position 1.5 1 0) (position 1.9 .75 0)
                    (position 2 0.5 0) (position 2.1 .25 0) (position 2.5 0 0)
                    (position 3 0 0) (position 4 0 0)))
;;ctrlpts_pos
;knot vector
(define knot_v (list 0 0 0 1 2 3 4 4 4 5 6 7 7 7 8 9 9 9))
;;knot_v
;create a spline edge with G1 discontinuity
(define spline (edge:spline-from-ctrlpts ctrlpts_pos knot_v))
;;spline
;check smoothness
(edge:check-smoothness spline)
;;(("G1" . 7) ("G1" . 4))

[Top]


edge:convexity

Action
Determines the convexity of an edge.

Filename
scm/scmext/intr/chk_scm.cpp

APIs
api_edge_convexity_param

Syntax
(edge:convexity edge [param] [acis-opts])

Arg Types
edge edge
param real
acis-opts acis-options

Returns
string

Description
This extension returns the convexity of an edge. If param is supplied, the convexity at that point is determined. Otherwise, convexity is determined at the mid-point of the edge.

Arguments
The optional argument acis-opts helps enable journaling and versioning options.
; edge:convexity
; Create a couple blocks for example.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
(define block2 (solid:block (position 0 10 0)
    (position 20 20 10)))
;; block2
; Unite the two blocks
(define unite (solid:unite block1 block2))
;; unite
; Find the edges of blocks 1 and 2
(define edgelist (entity:edges unite))
;; edgelist
; Define edges 1 and 2
(define edge1 (list-ref edgelist 0))
;; edge1
; verify edge1 is concave.
(edge:convexity edge1)
;; "concave"
(define edge2 (list-ref edgelist 17))
;; edge2
(edge:convexity edge2)
;; "convex"
; OUTPUT convexity

Figure. edge:convexity

[Top]


edge:ed-cvty-info

Action
Computes convexity information for a whole edge, or part of an edge.

Filename
scm/scmext/intr/cvty_scm.cpp

APIs
None

Syntax
(edge:ed-cvty-info edge [use-curvatures=#t]
    [approx-ok=#f] [interval=entire common-range])

Arg Types
edge edge
use-curvatures boolean
approx-ok boolean
interval real . real
common-range real

Returns
scm_ed_cvty_info

Description
Computes convexity information for an entire edge, or part thereof. This includes the [sine of] the minimum and maximum angles along the edge (+ve for convex, -ve for concave). This also applies to the convexity of this edge if viewed with an angle tolerance large enough to regard it as "flat").

; edge:ed-cvty-info
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(define edge1 (list-ref edge-list 0))
;; edge1
; Get information on an edge for a 0.01 angle
; tolerance.
(ed-cvty-info:instantiate (edge:ed-cvty-info
    edge1) 0.01)
;; #[cvty: cvx]

[Top]


edge:end-pt-cvty-info

Action
Computes convexity information at end point of edge.

Filename
scm/scmext/intr/cvty_scm.cpp

APIs
None

Syntax
(edge:end-pt-cvty-info edge [use-curvatures=#t])

Arg Types
edge edge
use-curvatures boolean

Returns
scm_pt_cvty_info

Description
Computes convexity information at end point along an edge. This consists of an angle (the [sine of the] angle between surface normals there, +ve meaning convex), and the convexity of the edge here if viewed with an angle tolerance sufficiently large that we would regard this point as tangent. Note that for tolerant edges, the "common range" of the edge is used, which may differ slightly. This is the range over which the nominal edge curve and the coedge 3D curves appear to overlap "sensibly".
; edge:end-pt-cvty-info
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(edge:end-pt-cvty-info (list-ref edge-list 0))
;; #[pt_cvty_info: 1 [cvty: knf] (tol 1e-10)]

[Top]


edge:entity-rel

Action
Returns the relationship between an edge and another entity (point, edge, face or body).

Filename
scm/scmext/intr/edent_scm.cpp

APIs
api_edent_rel

Syntax
(edge:entity-rel edge entity [ao])

Arg Types
edge edge
entity entity
ao acis-options

Returns
(string (position position ...) (pair pair ...))

Description
Determines the relationships between the given edge and the given entity that may be a point, edge, face, or body.

If no relationship exists between the edge and the entity, then an empty list is returned. If a relationship is returned, a list is returned with three entries. The first entry is a string describing the relationship, the second is a list of intersection points found between the edge and the entity, and the third is a list of the changes in relationship as the edge passes through the corresponding intersection points.

A point may be on or off the edge. In this case, the first entry in the returned list will be either "point on edge" or "point off edge". If the point is on the edge, the second entry will be a list containing the position of the point, otherwise it will be an empty list. The relations list is always empty for point-edge relations, as there is no sense in which the change in relationship can be described.

An edge may intersect, overlap, or be identical to the edge. The edge may lie in the surface of a face and be completely inside, partially inside, or on the boundary of the face, or it may simply intersect the face. Likewise, an edge may be inside, partially inside, or on the boundary of a body. The notion of being inside/outside is meaningful only if the boundary bounds a finite volume.

Arguments
edge is the input edge.

entity is a point, edge, face, or body.

ao contains journaling and versioning information.
; edge:entity-rel
; Define an edge
(define e1 (edge:linear (position 0 0 0)
   (position 20 0 0)))
;; e1
; Define another edge
(define e2 (edge:linear (position 10 0 0)
    (position 30 0 0)))
;; e2
(edge:entity-rel e1 e2)
;; ("overlapping edges" (#[position 10 0 0]
;; #[position 20 0 0]) (("tangent" . "coincident")
;; ("coincident" . "unknown")))

[Top]


edge:geometric-insanities

Action
Reports problems with the geometry of an EDGE.

Filename
scm/scmext/intr/chk_scm.cpp

APIs
api_check_edge

Syntax
(edge:geometric-insanities edge [insanity-type] [acis-opts])

Arg Types
edge edge
insanity-type string
acis-opts acis-options

Returns
(insanity ...)

Description
This extension performs geometric checks on an edge. Any problems found with the geometry are returned as a list of insanity objects. If no problems are found, an empty list is returned. This extension provides the same functionality as edge:check-geometry.


Arguments
edge represents the input edge.

With the optional argument insanity-type, only the specified insanities are printed to the debug file. The option check_abort becomes invalid when insanity-type is specified. The valid insanity types are "ERROR", "WARNING', or "NOTE".
 
The optional argument acis-opts helps enable journaling and versioning options.
; edge:geometric-insanities
; Internal knot multiplicities create a G1 discontinuity
(define ctrlpts_pos (list (position -2 0 0)(position -1.5 0 0)(position 0 0 0)
                    (position .75 0.5 0)(position 1 0.5 0)(position 1.1 1 0)
                    (position 1.2 1 0)(position 1.5 1 0) (position 1.9 .75 0)
                    (position 2 0.5 0)(position 2.1 .25 0)(position 2.5 0 0)
                    (position 3 0 0)(position 4 0 0)))
;; ctrlpts_pos
(define knot_v (list 0 0 0 1 2 3 4 4 4 5 6 7 7 7 8 9 9 9))
;; knot_v
(define spline (edge:spline-from-ctrlpts ctrlpts_pos knot_v))
;; spline
(edge:geometric-insanities spline)
;; (#[edge warning: curve not G1]
;; )

[Top]


edge:intersect

Action
Gets the intersection between two edges or curves.

Filename
intr/intr_scm/icrv_scm.cpp

APIs
api_inter_ed_ed

Syntax
(edge:intersect edge1 edge2 [acis-opts])

Arg Types
edge1 edge
edge2 edge
acis-opts acis-options

Returns
(position ...)

Errors
EDGE with no CURVE

Description
This extension returns an empty list if the curves do not intersect. It returns a list of positions where the input curves intersect if there is a finite number of intersection points. If the boolean bounded is #t, the default, and if the curves share a portion of the underlying geometry, then this extension returns a list containing the endpoints of the shared portion. If the boolean bounded is #f, and if the curves share a portion of the underlying geometry, then this extension returns a list of the endpoints of the shared portion.

The bounded geometry of a spline edge and the fully underlying geometry of spline edges coincide. Thus, when bounded is #f, extrapolated extensions of spline edges does not occur.


Arguments
edge1 specifies an edge.
 
edge2 specifies an edge.
 
The optional argument acis-opts helps enable journaling and versioning options.


Limitations
The acis-options object only applies to api_intersect_curves.
; curve:intersect
; Create circular edge 1.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
; Create circular edge 2.
(define edge2 (edge:circular
    (position 0 10 0) 20 -180))
;; edge2
; Determine the intersections of the two edges.
(curve:intersect edge1 edge2)
;; (#[position -18.9983551919633 16.25 0]
;; #[position 18.9983551919633 16.25 0])
; Additional example.
(define line1 (edge:linear (position 0 5 0)
    (position 0 -40 0)))
;; line1
(define line2 (edge:linear (position -40 -10 0)
    (position 20 5 0)))
;; line2
; find point of intersection between lines and
; but only intersections within bounds
(curve:intersect line1 line2)
;; (#[position 0 4.44089209850063e-16 0])
(curve:intersect line1 line2 #f)
;; (#[position 0 4.44089209850063e-16 0])

[Top]


edge:mid-pt-cvty-info

Action
Computes convexity information at mid-point of edge.

Filename
scm/scmext/intr/cvty_scm.cpp

APIs
None

Syntax
(edge:mid-pt-cvty-info edge [use-curvatures=#t])

Arg Types
edge edge
use-curvatures boolean

Returns
scm_pt_cvty_info

Description
Computes convexity information at a midpoint along an edge. This consists of an angle (the [sine of the] angle between surface normals there, +ve meaning convex), and the convexity of the edge here if viewed with an angle tolerance sufficiently large that we would regard this point as tangent. Note that for tolerant edges, the *common range* of the edge is used, which may differ slightly. This is the range over which the nominal edge curve and the coedge 3D curves appear to overlap "sensibly".

; edge:mid-pt-cvty-info
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(edge:mid-pt-cvty-info (list-ref edge-list 0))
;; #[pt_cvty_info: 1 [cvty: knf] (tol 1e-10)]

[Top]


edge:pt-cvty-info

Action
Computes convexity information at a point on an edge.

Filename
scm/scmext/intr/cvty_scm.cpp

APIs
None

Syntax
(edge:pt-cvty-info edge param
    [use-curvatures=#t])

Arg Types
edge edge
param real
use-curvatures boolean

Returns
scm_pt_cvty_info

Description
Computes convexity information at a specified parameter point (param the start-point) along an edge. This consists of an angle (the [sine of the] angle between surface normals there, +ve meaning convex), and the convexity of the edge here if viewed with an angle tolerance sufficiently large that we would regard this point as tangent.

; edge:pt-cvty-info
; Create a block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(edge:pt-cvty-info (list-ref edge-list 0) 1)
;; #[pt_cvty_info: 1 [cvty: knf] (tol 1e-10)]

[Top]


edge:split-at-proportion

Action
Splits an edge with a new vertex at the defined proportion of the way along the edge.

Filename
scm/scmext/intr/icrv_scm.cpp

APIs
None

Syntax
(edge:split-at-proportion edge proportion)

Arg Types
edge edge
proportion real

Returns
vertex

Description
This extension is provided to test sg_split_edge_at_vertex.

Arguments
proportion argument takes a real range between 0 and 1.
; edge:split-at-proportion
; create solid block.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define split (edge:split-at-proportion
    (car (entity:edges b)) 0.5))
;; split

[Top]


edge:split-at-vertex

Action
Splits an edge at a vertex which is known to lie within the domain of the edge.

Filename
scm/scmext/intr/icrv_scm.cpp

APIs
None

Syntax
(edge:split-at-vertex edge {vert | pos})

Arg Types
edge edge
vert vertex
pos position

Returns
edge

Description
This extension tests sg_split_edge_at_vertex. If the second argument is a vertex, then this is incorporated into the body; otherwise, it will make one.

Arguments
edge is the edge to be split.
vert is the vertex at which an edge is to be split.
pos is the domain of the edge to be split.
Limitations
If a vertex is passed, then it should have no owner. The vertex or position should lie within the edge's curve and parameters.
; edge:split-at-vertex
; create solid block.
(define b (solid:block (position 0 0 0)
(position 10 10 10)))
(entity:fix-transform b)
(define e (list-ref (entity:edges b) 0))
(define v  (vertex:from-position (edge:mid-point e)))
(edge:split-at-vertex e v)
(define p (edge:mid-point e))
(edge:split-at-vertex e p)

[Top]


edge:start-pt-cvty-info

Action
Computes convexity information at start point of edge.

Filename
scm/scmext/intr/cvty_scm.cpp

APIs
None

Syntax
(edge:start-pt-cvty-info edge [use-curvatures=#t])

Arg Types
edge edge
use-curvatures boolean

Returns
scm_pt_cvty_info

Description
Computes convexity information at a start point along an edge. This consists of an angle (the [sine of the] angle between surface normals there, +ve meaning convex), This also applies to the convexity of this edge if viewed with an angle tolerance large enough to regard it as "tangent"). For tolerant edges, the *common range* of the edge is used and may differ slightly. This is the range over which the nominal edge curve and the coedge 3D curves appear to overlap "sensibly".
; edge:start-pt-cvty-info
; create a block
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(edge:start-pt-cvty-info (list-ref edge-list 0))
;; #[pt_cvty_info: 1 [cvty: knf] (tol 1e-10)]

[Top]


edge:tangent?

Action
Determines whether the given edge is tangent or not.

Filename
scm/scmext/intr/cvty_scm.cpp

APIs
api_edge_tangent

Syntax
(edge:tangent? edge [tol] [ao])

Arg Types
edge edge
tol real
acis-opts acis-options

Returns
boolean

Description
This command inquires the given EDGE to determine if it is a tangent edge under the given tolerance. It performs a check similar to the checker.

Arguments
edge is the given input EDGE.

The optional argument tol specifies the tolerance in radians.

The optional argument acis-opts helps enable journaling and versioning options.
; edge:tangent?
;
(part:clear)
;; #t
; Create a surface and attach a blend attribute to one of the edges.
(define block (solid:block
(position 0 0 0)(position 1 1 1)))
;; block
(blend:round (list-ref (entity:edges block)3) .25 "fix")
;; #t
; Define the edges on this surface
(define e1 (list-ref (entity:edges block)0))
;; e1
(entity:set-color e1 1)
;; ()
(define e2 (list-ref (entity:edges block)1))
;; e2
(entity:set-color e2 3)
;; ()
(define e3 (list-ref (entity:edges block)2))
;; e3
(entity:set-color e3 1)
;; ()
(define e4 (list-ref (entity:edges block)3))
;; e4
(entity:set-color e4 3)
;; ()
(edge:tangent? e1)
;; #f
(edge:tangent? e2)
;; #t
(edge:tangent? e3)
;; #f
(edge:tangent? e4)
;; #t

[Top]


entity:check

Action
Checks the data structure, topology, and geometry on a single or list of entities.

Filename
scm/scmext/intr/chk_scm.cpp

APIs
api_check_entity

Syntax
(entity:check entity-list [check-level]
    [insanity-type] [acis-opts])

Arg Types
entity-list entity | (entity ...)
check-level integer
insanity-type string
acis-opts acis-options

Returns
entity | (entity ...)

Description
This extension checks an entity or list of entities for bad data or invalidities. The results are printed to a debug file (or standard output) set by the debug:file extension.
By default, checks are performed up to and including the level specified by the option check_level. The range of effective check levels is any integer multiple of 10, between 10 and 70 inclusive; the default value is 20. Any other value is invalid, and the behavior of the Checker may be unpredictable with an invalid check level. Alternatively, the check level may be specified using the argument check-level. This does not alter the value of the option or the default level for future checks.
With the optional insanity-type, only the specified insanities are printed. The option check_abort becomes invalid when insanity-type is specified. The options are "ERROR", "WARNING", or "NOTE".
The option show_warning_msg controls whether or not WARNING-severity checks are performed. By default, this option is set to #f in release builds and #t in debug builds.
Refer to Table 1 in ACIS Checker for information on the checks performed.
If improper face-face intersections or improper edge-edge intersections are found (these checks are invoked at level 70), a wire BODY representing the bad intersections is created for visual inspection. See also solid:check-ff-ints.

Arguments
entity-list specifies the particular entities that are to be checked for bad data or invalidities.

check-level specifies the level (that is, multiple of 10, between 10 and 70) to which checks are performed. The default value is 20.

insanity-type specifies the type of insanities that are to be printed.

acis-opts helps enable journaling and versioning options.
; entity:check
; Create solid block 1.
(define block1 (solid:block (position 0 0 0)
    (position 10 10 10)))
;; block1
; Determine if the entity passes the checks.
(entity:check block1)
; checked:
;   1 lumps
;   1 shells
;   0 wires
;   6 faces
;   6 loops
;   24 coedges
;   12 edges
;   8 vertices
;; ()
; Create a circular edge.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
; Determine if edge1 passes the checks.
(entity:check edge1)
; entid 1236816: edge without backptr
; entid 1231288: vertex has edge 1236816
; in group 0 times
; entid 1231312: vertex has edge 1236816
; in group 0 times
; checked:
;   0 lumps
;   0 shells
;   0 wires
;   0 faces
;   0 loops
;   0 coedges
;   1 edges
;   2 vertices
;; (#[entity 3 1])

[Top]


entity:dist

Action
Gets the minimum distance between two entities or entity and a position.

Filename
scm/scmext/intr/ilaw_scm.cpp

APIs
api_entity_entity_distance, api_entity_point_distance

Syntax
(entity:dist part1 part2 [acis-opts])

Arg Types
part1 entity | position
part2 entity | position
acis-opts acis-options

Returns
(position . (entity | entity ...) . string)

Description
Using the two input entities, this finds a position on each entity such that the distance between the two is the minimum distance. Supported entities include VERTEX, EDGE, LOOP, FACE, WIRE, SHELL, LUMP, and BODY. The command can also find the minimum distance using an entity and a position, or a position and an entity.

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

Limitations
If part1 is defined as a position, part2 must be an entity.
; entity:dist
; Create a law surface and lemon torus.
(define c1 (face:law "vec
    (x,y,sin (x)*cos (y))" -10 10 -10 10))
;; c1
(define c2 (face:torus
    (position 0 0 9.5) -5 10 0 360 0 360
    (gvector 0 0 -1)))
;; c2
; Get minimum distance between faces
(entity:dist c1 c2)
;; (0.60223495915902 #[position 0.407311827177182 0
;; 0.396142511453466] #[par-pos 0.407311827177182
;; 0] #[entity 2 1] "FACE" #[position
;; 8.88178419700125e-016 1.08766893609269e-031
;; 0.839745962155614] 0 #[entity 4 1] "VERTEX")

[Top]


entity:extrema

Action
Finds an extreme position on an entity.

Filename
scm/scmext/intr/rtst_scm.cpp

APIs
api_entity_extrema

Syntax
(entity:extrema entity vector1 [vector2] [vector3] [acis-opts])

Arg Types
entity entity
vector1 gvector
vector2 gvector
vector3 gvector
acis-opts acis-options

Returns
((entity | (entity ...)) . position)

Arguments
vector1vector2 and vector3 are positions in the entity.
 
The optional argument acis-opts helps enable journaling and versioning options.
; entity:extrema
; create topology to illustrate command.
(define s1 (solid:block
    (position 0 0 0) (position 10 10 5)))
;; s1
(define s2 (solid:block
    (position 3 0 5) (position 7 3 8)))
;; s2
(define s3 (solid:block
    (position 3 7 5) (position 7 10 2)))
;; s3
(define unite (bool:unite s1 s2))
;; unite
(define subtract (bool:subtract s1 s3))
;; subtract
(define extrema (entity:extrema s1 (gvector 1 1 1)
    (gvector 0 0 1) (gvector 1 0 0)))
;; extrema

[Top]


entity:insanities

Action
Checks the data structure, topology, and geometry on a single or list of entities.

Filename
scm/scmext/intr/chk_scm.cpp

APIs
api_check_entity

Syntax
(entity:insanities entity-list [check-level]
    [insanity-type] [acis-opts])

Arg Types
entity-list entity | (entity ...)
check-level integer
insanity-type string
acis-opts acis-options

Returns
(insanity ...)

Description
This Scheme extension checks an entity or list of entities for bad data or invalidities. It returns a list of insanity objects, each one representing a problem found in the input entity or entities. If no problems are found, this Scheme extension returns an empty list. entity:insanities provides the same functionality as entity:check, except that no body is created to represent bad face-face or edge-edge intersections.
By default, checks are performed up to and including the level specified by the option check_level. The range of effective check levels is any integer multiple of 10, between 10 and 70 inclusive; the default value is 20. Any other value is invalid, and the behavior of the Checker may be unpredictable with an invalid check level. Alternatively, the check level may be specified using the argument check-level. This does not alter the value of the option or the default level for future checks.
With the optional insanity-type, only the specified insanities are printed. The option check_abort becomes invalid when insanity-type is specified. The options are "ERROR", "WARNING", or "NOTE".
The option show_warning_msg controls whether or not WARNING-severity checks are performed. By default, this option is set to #f in release builds and #t in debug builds.
Refer to Table 1 in ACIS Checker for information on the checks performed.

Arguments
entity-list specifies the particular entities that are to be checked for bad data or invalidities.
 
check-level specifies the level (that is, a multiple of 10, between 10 and 70) to which checks are performed. The default value is 20.
 
insanity-type specifies the type of insanities that are to be printed.
 
acis-opts enables journaling and versioning options.
; entity:insanities
; Create solid block 1. No problems here!
(define block1 (solid:block (position 0 0 0)
    (position 10 10 10)))
;; block1
; Determine if the entity passes the checks.
(entity:insanities block1)
()
; Create a circular edge.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
; Determine if edge1 passes the checks.
(entity:insanities edge1)
; (#[edge error: edge without backptr]
;; )

[Top]


entity:pattern

Action
Creates a pattern of entities from a seed entity.

Filename
scm/scmext/intr/ilaw_scm.cpp

APIs
api_pattern_apply_to_entity

Syntax
(entity:pattern entity pattern [copy-pat
    [seed-index [no-cross-face-list] [check]]] [acis-opts])

Arg Types
entity entity
pattern pattern
copy-pat boolean
seed-index integer
no-cross-face-list entity | (entity ...)
check boolean
acis-opts acis-options

Returns
entity

Description
This Scheme extension applies the pattern to the seed entity, entity. By default, a copy of the pattern is made, and it is the copy that is actually applied to the entity. This behavior can be overridden by setting copy-pat to FALSE. However, when copying is overridden and in-pat is shared by multiple bodies, a transform placed upon the bodies is transferred to the pattern multiple times, which is clearly undesirable. Also by default, entity is associated with the first pattern element (index 0), but may be associated with another element by furnishing the associated zero-based seed-index.

Arguments
For cases in which the pattern is applied to a "bump" on a substrate rather than to an autonomous entity, the limits of the bump are automatically computed, but the user may choose to override the default limits by furnishing a list of no-cross-faces.
 
For performance reasons, the extension does not check the generated pattern of entities for intersection, containment, or compatibility unless the user sets the flag check to TRUE.
 
The optional argument acis-opts helps enable journaling and versioning options.
; entity:pattern
; Make a spherical body.
(define body (solid:sphere (position 0 0 0) 1))
;; body
; Make a circular pattern.
(define center (position 11 2 3))
;; center
(define normal (gvector 0 0 1))
;; normal
(define num 12)
;; num
(define pat (pattern:elliptical center normal num))
;; pat
; Apply the pattern to the body.
(define new-pattern (entity:pattern body pat))
;; new-pattern

[Top]


entity:point-distance

Action
Returns the minimum distance between an entity and a position.

Filename
scm/scmext/intr/ilaw_scm.cpp

APIs
api_entity_point_distance

Syntax
(entity:point-distance entity position [acis-opts])

Arg Types
entity entity
position position
acis-opts acis-options

Returns
real

Description
This extension finds the distance between an entity and a position. The closest point on the entity is also returned.

Arguments
The optional argument acis-opts helps enable journaling and versioning options.
; entity:point-distance
; Create a block and get the distance
; between a given point and the block.
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
(define distance1 (entity:point-distance
    block1 (position 30 25 37)))
; Point on entity 10.000000 20.000000 20.000000
;; distance1

[Top]


entity:touch

Action
Determines whether the two defined entities (or any two entities in the lists) "touch" (distance < 2 * resabs).

Filename
scm/scmext/intr/ilaw_scm.cpp

APIs
api_entity_entity_touch

Syntax
(entity:touch {entity1 | entity-list1}
    {entity2 | entity-list1 | entity-list2} [acis-opts])

Arg Types
entity1 entity
entity2 entity
entity-list1 entity | (entity ...)
entity-list2 entity | (entity ...)
acis-opts acis-options

Returns
boolean

Description
Using the two input entities or entity lists, determines whether the entities touch each other or if any entity in entity-list1 touches any entity in entity-list2. Supported entities include VERTEX, EDGE, LOOP, FACE, WIRE, SHELL, LUMP, and BODY.

Arguments
The optional argument acis-opts helps enable journaling and versioning options.
; entity:touch
; Create four cylinders.
(define c1 (face:cylinder (position 0 0 0)
    (position 0 0 1) 1 1))
;; c1
(define c2 (face:cylinder (position 1 0 0)
    (position 1 0 1) 1 1))
;; c2
(define c3 (face:cylinder (position 2 5 0)
    (position 2 5 1) 1 1))
;; c3
(define c4 (face:cylinder (position 3 5 0)
    (position 3 5 1) 1 1))
;; c4
(zoom-all)
;; #[view 1573816]
; See if c1 touches c2
(entity:touch c1 c2)
;; #t
; See if any cylinders in the first list touch
; any in second list
(entity:touch (list c1 c2) (list c3 c4))
;; #f

[Top]


face:check-geometry

Action
Checks the geometry on a FACE.

Filename
scm/scmext/intr/chk_scm.cpp

APIs
api_check_face

Syntax
(face:check-geometry face [insanity-type] [acis-opts])

Arg Types
face face
insanity-type string
acis-opts acis-options

Returns
entity | (entity ...)

Description
This extension performs geometric checks on a face. The results are printed to the debug file, which can be set with the debug:file extension.

Arguments
face represents the input face.

With the optional argument insanity-type, only the specified insanities are printed to the debug file. The option check_abort becomes invalid when insanity-type is specified. The valid insanity-types are "ERROR", "WARNING', or "NOTE".

The optional argument acis-opts helps enable journaling and versioning options.
; face:check-geometry
(wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))
;; #[entity 1 1]
(define w1 (wire-body (list (edge:linear (position 0 30 30) (position 0 -30 30))
           (edge:linear (position 0 -30 30) (position 0 -30 -30))
           (edge:linear (position 0 -30 -30) (position 0 30 -30))
           (edge:linear (position 0 30 -30) (position 0 30 30)))))
;; w1
(define w2 (entity:copy w1))
;; w2
(entity:move w2 25 0 0)
;; #[entity 7 1]
(define block (sheet:skin-wires (list w1 w2)))
;; block
(entity:rotate block 0 0 1 45)
;; #[entity 8 1]
(entity:delete (list w1 w2))
;; ()
(define cyl2 (solid:cylinder (position 0 0 0)
             (position 25 0 0) 30))
;; cyl2
(entity:rotate cyl2 0 0 1 -45)
;; #[entity 9 1]
(entity:move cyl2 0 150 0)
;; #[entity 9 1]
(define face1 (list-ref (entity:faces block) 0))
;; face1
(define face2 (list-ref (entity:faces cyl2) 2))
;; face2
(entity:set-color face1 1)
;; ()
(entity:set-color face2 1)
;; ()
; Set the face take-off factors to '5' and '5'. This will
; create a self-intersecting surface.
; Also, set "self_int_test" to false, allowing the operation to
; create a self-intersecting surface.
(define interface (slinterface:face-lofting face1 5 face2 5
                  (skin:options "perpendicular" #t "allow_same_uv" #t "self_int_test" #f)))
;; interface
(slinterface:align-wires interface)
;; #t
(define body (slinterface:build-body interface))
;; body
(slinterface:delete-interface interface)
;; #t
(define f1 (cadr (pick:face (ray (position 451.765 137.953 -183.507)
           (gvector -0.902473 -0.129551 0.410804)))))
;; f1
; This should report: entid [nnn]: Error: surface self-intersects
(face:check-geometry f1)
;; entid 22202408: Error: surface self-intersects
;; ()

[Top]


face:clash

Action
Tests whether two faces clash.

Filename
intr/intr_scm/clash_scm.cpp

APIs
api_clash_faces

Syntax
(face:clash face-a face-b [ao])

Arg Types
face-a face
face-b face
ao acis-options

Returns
string

Description
This extension tests whether the input faces clash: that is, whether there are points on both faces which are within resabs of each other. If the faces do clash, then the manner in which they clash is also determined. The extension returns one of the following strings:

Arguments
face-a specifies the first face to test.

face-b specifies the second face to test.

ao specifies ACIS options like journaling and versioning.
; face:clash
; Create a pair of interlocking faces (define f1 (face:sphere (position 0 0 0) 5)) ;f1 (define f2 (face:torus (position 0 0 0) 5 2)) ;f2 ; Test for clash between the faces (face:clash f1 f2) ; “Interlocking"

[Top]


face:closest-point

Action
Returns the closest point on a face to a given position in space.

Filename
scm/scmext/intr/query_scm.cpp

APIs
api_find_cls_ptto_face

Syntax
(face:closest-point face position)

Arg Types
face entity
position position

Returns
position

Description
This extension returns the position of the point on the given face which is closest to the input position. The returned position may be in the interior of the face, or on one of its edges or vertices.

Arguments
face specifies the face on which the closest point to the input position is to be found.

position specifies the position for which the closest point on the face is required.
; face:closest-point
; Create a cylindrical face
(define c (face:cylinder (position 0 0 0) (position 10 0 0) 2)) ;c ; Choose a position
(define pos (position 3 5 0))
;pos
(face:closest-point c pos)
;; #[position 3 2 0]

[Top]


face:geometric-insanities

Action
Reports problems with the geometry on a FACE.

Filename
scm/scmext/intr/chk_scm.cpp

APIs
api_check_face

Syntax
(face:geometric-insanities face [insanity-type] [acis-opts])

Arg Types
face face
insanity-type string
acis-opts acis-options

Returns
entity | (entity ...)

Description
This extension performs geometric checks on a face. Any problems found with the geometry are returned as a list of insanity objects. If no problems are found, an empty list is returned. This extension provides the same functionality as face:check-geometry.

Arguments
face represents the input face.

With the optional argument insanity-type, only the specified insanities are printed to the debug file. The option check_abort becomes invalid when insanity-type is specified. The valid insanity types are "ERROR", "WARNING', or "NOTE".

The optional argument acis-opts enables journaling and versioning options.
; face:geometric-insanities
(wcs (position 0 0 0) (gvector 1 0 0) (gvector 0 1 0))
;; #[entity 1 1]
(define w1 (wire-body (list (edge:linear (position 0 30 30) (position 0 -30 30))
           (edge:linear (position 0 -30 30) (position 0 -30 -30))
           (edge:linear (position 0 -30 -30) (position 0 30 -30))
           (edge:linear (position 0 30 -30) (position 0 30 30)))))
;; w1
(define w2 (entity:copy w1))
;; w2
(entity:move w2 25 0 0)
;; #[entity 7 1]
(define block (sheet:skin-wires (list w1 w2)))
;; block
(entity:rotate block 0 0 1 45)
;; #[entity 8 1]
(entity:delete (list w1 w2))
;; ()
(define cyl2 (solid:cylinder (position 0 0 0)
             (position 25 0 0) 30))
;; cyl2
(entity:rotate cyl2 0 0 1 -45)
;; #[entity 9 1]
(entity:move cyl2 0 150 0)
;; #[entity 9 1]
(define face1 (list-ref (entity:faces block) 0))
;; face1
(define face2 (list-ref (entity:faces cyl2) 2))
;; face2
(entity:set-color face1 1)
;; ()
(entity:set-color face2 1)
;; ()
; Set the face take-off factors to "5" and "5". This will
; create a self-intersecting surface.
; Also, set "self_int_test" to false, allowing the operation to
; create a self-intersecting surface.
(define interface (slinterface:face-lofting face1 5 face2 5
                  (skin:options "perpendicular" #t "allow_same_uv" #t "self_int_test" #f)))
;; interface
(slinterface:align-wires interface)
;; #t
(define body (slinterface:build-body interface))
;; body
(slinterface:delete-interface interface)
;; #t
(define f1 (cadr (pick:face (ray (position 451.765 137.953 -183.507)
           (gvector -0.902473 -0.129551 0.410804)))))
;; f1
(face:geometric-insanities f1)
;; (#[face error: surface self-intersects]
;; ) 

[Top]


face:get-silhouette

Action
Computes the silhouette curves on the face.

Filename
scm/scmext/intr/icrv_scm.cpp

APIs
api_silhouette_edges

Syntax
(face:get-silhouette face [from-pos to-pos] [proj-type] [transf] [ao])

Arg Types
face face
from-pos position
to-pos position
proj-type boolean
transf transform
acis-opts acis-options

Returns
edge ...

Errors
There must be at least one view.

Description
Computes the silhouette curves on the surface of the face and trims them to the boundaries of the face. The silhouette curves can be calculated for either a parallel or perspective projection.
It retrieves a list of EDGEs representing the bounded portion of the silhouette curves within the face.

Arguments
face is the face to be examined.
 
from-pos is the position of viewer.
 
to-pos helps is the position towards which user looks.
 
proj-type is the projection type: 0 for parallel and 1 for perspective.
 
transf is the transform.
 
acis-opts helps enable journaling and versioning options.
; face:get-silhouette
;; Define solid and reference
(part:clear)
;; #t
(view:dl)
;; #[view 15795402]
(define s (solid:sphere (position 0 0 0) 1))
;; s
(iso)
;; #[view 15795402]
(zoom-all)
;; #[view 15795402]
(define f (list-ref (entity:faces s)0))
;; f
(face:get-silhouette f
    (position 2 2 2)(position -2 -2 -2))
;; (#[entity 3 1])

[Top]


face:point-relationship

Action
Determines the relationship of a position within a given face's surface to that face.

Filename
scm/scmext/intr/ifac_scm.cpp

APIs
api_point_in_face

Syntax
(face:point-relationship face-entity test-position
    [transf] ["par-pos-guess" u-guess v-guess]
    [prev-pos [prev-pos-containment]]
    [use-cache = 0 [cache-size = 10]] [acis-opts])

Arg Types
face-entity face
test-position position
transf transform
u-guess double
v-guess double
prev-pos position
prev-pos-containment string
use-cache integer
cache-size integer
acis-opts acis-options

Returns
string

Description
Returns "inside", "outside", "boundary", or "unknown" to indicate the containment relationship between the face given by entity and the position given by test-position. It is presumed that the specified position is known to lie within the surface belonging to the face.
The transform object will be considered only if is specified otherwise, if the face belongs to a body, it will find the transform of that body and will input into the API. If it is desired to override the body transformation, provide an identinty transf.
The par-pos-guess argument provides additional help by providing a coordinate in parametric space for an initial guess on where the position may lie. If no argument is provided it will use the default (a null reference).
If a previous position is specified, a containment description must be provided ("inside", "outside", "boundary", or "unknown"). This position can provide help in finding the position on the face at a faster rate. It is recommended to use a position that was previously found using this function. The scheme command will use the proper api_point_in_face function if there are previous positions.

The optional argument use-cache, if supplied, is:
     0, the cache is not used. Will be input as FALSE in api_point_in_face.
     1, the cache is used to determine point in face relationships. Will be input as TRUE.
     2, this function runs in a testing mode - it tries the point in face containments first without using the cache, then tries again with the cache verifying the answers remain the same. Will be
         input as TRUE also.

The optional argument cache-size specifies the size of the cache array points. This argument is only meaningful when use-cache is either 1 or 2.

Debug mode (cache = 2):
The function returns the containment string corresponding to the point in face answers for the point, except when run in debug mode (use-cache equal to 2), in which case the percentage improvement of the cached time to the time without using the cache is returned, i.e. (time_without - time_with) / time_without * 100.



Arguments
face-entity specifies a face entity.
 
test-position specifies the position on the face.
 
transf specifies the body transformation.
 
u-guess specifies initial guess of the point along u.
 
v-guess specifies initial guess of the point along v.
 
prev-pos specifies the previous position.
 
prev-pos-containment gives containment description previous position. It can take one of the following values: "inside", "outside", "boundary", or "unknown"
 
use-cache specifies if caching is used. Possible values are 0, 1 or 2.
 
cache-size specifies size of cache array points. Size can be from 0 to 10.
 
acis-opts helps enable journaling and versioning options.
; face:point-relationship
; Create a planar face.
(define face
    (face:plane (position 0 0 0) 10 20
    (gvector 0 0 1)))
;; face
; Define position 1
(define test1 (position 0 0 0))
;; test1
; Relationship between face and position 1
(face:point-relationship face test1)
;; "boundary"
; Define position 2
(define test2 (position 5 10 0))
;; test2
; Relationship between face and position 2
(face:point-relationship face test2)
;; "inside"
; Define position 3
(define test3 (position 15 10 0))
;; test3
; Relationship between face and position 3
(face:point-relationship face test3)
;; "outside"

[Top]


face:point-relationship-list

Action
Determines the relationship of a LIST of positions within a given face's surface to that face.

Filename
scm/scmext/intr/ifac_scm.cpp

APIs
api_point_in_face

Syntax
(face:point-relationship-list face-entity position-list
    [transf] ["par-pos-guess" u-guess v-guess]
    [use-cache = 0 [cache-size = 10]] [acis-opts])

Arg Types
face-entity face
position-list position
transf transform
u-guess double
v-guess double
use-cache integer
cache-size integer
acis-opts acis-options

Returns
string

Description
Tests a list of positions for a given face.
The transform object will be considered only if is specified otherwise, if the face belongs to a body, it will find the transform of that body and will input into the API. If it is desired to override the body transformation, provide an identinty transf.
The par-pos-guess argument provides additional help by providing a coordinate in parametric space for an initial guess on where the position may lie. If no argument is provided it will use the default (a null reference).
If the optional argument use-cache if supplied, is:
     0, the cache is not used. Will be input as FALSE in api_point_in_face
     1, the cache is used to determine point in face relationships. Will be input as TRUE
     2, this function runs in a testing mode - it tries the point in face containments first without using the cache, then tries again with the cache verifying the answers remain the same. Will be
         input as TRUE also.

The optional argument cache-size specifies the size of the cache array points. This argument is only meaningful when use-cache is either 1 or 2.
Debug mode (cache = 2): When run in debug mode (use-cache equal to 2), in which case the percentage improvement of the cached time to the time without using the cache is returned, i.e. (time_without - time_with) / time_without * 100.

Arguments
face-entity specifies a face entity.

position-list specifies the list of positions.

transf specifies the body transformation.

u-guess specifies initial guess of the point along u.

v-guess specifies initial guess of the point along v.

use-cache specifies if caching is used.

cache-size specifies size of cache array points.

acis-opts enables journaling and versioning options.
; face:point-relationship-list
; Create a planar face.
(define face
    (face:plane (position 0 0 0) 10 20
    (gvector 0 0 1)))
;; face
; Define position 1
(define test1 (position 0 0 0))
;; test1
; Define position 2
(define test2 (position 5 10 0))
;; test2
; Define position 3
(define test3 (position 15 10 0))
;; test2
; Make a list
(define l (list test1 test2 test3))
;; l
; Relationship between face and list not using the cache
 (face:point-relationship-list face l)
;;
; Relationship between face and list using the cache
(face:point-relationship-list face l 1)
;;

[Top]


face:ray-at-position

Action
Gets the position on and normal to a face closest to a given position.

Filename
scm/scmext/intr/ifac_scm.cpp

APIs
None

Syntax
(face:ray-at-position face-entity test-position)

Arg Types
face-entity face
test-position position

Returns
ray

Description
The face normal is computed based on test-position and this extension returns it as a ray. The position on the entity face closest to the test-position is located.

Arguments
face-entity specifies a face entity.

test-position specifies the position on the face.
; face:ray-at-position
; Create a solid block.
(define block1
    (solid:block (position 0 0 0)
    (position 40 40 40)))
;; block1
; Get a list of the block's faces.
(define faces1 (entity:faces block1))
;; faces1
; Find the position and normal on the faces
; closest to the given points.
(face:ray-at-position (car (cdr faces1))
    (position 0 0 0))
;; #[ray (0 0 0) (0 0 -1)]
(face:ray-at-position (car (cdr (cdr (cdr
    (cdr (cdr faces1)))))) (position 50 100 30))
;; #[ray (40 40 30) (1 0 0)]

[Top]


insanity:aux-msg

Action
Returns any auxiliary messages for an insanity object.

Filename
scm/scmext/intr/insanity_scm.cpp

APIs
None

Syntax
(insanity:aux-msg insanity)

Arg Types
insanity insanity

Returns
(string...)

Description
This extension returns a list of any auxiliary messages relating to the given insanity object. If there are no auxiliary messages, an empty string is returned in the list.

Arguments
insanity specifies the insanity object for which the auxiliary messages are required.
; insanity:aux-msg
; Create a circular edge.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
; Determine if edge1 passes the checks.
(define insanities (entity:insanities edge1))
; (#[edge error: edge without backptr]
;; )
(insanity:aux-msg (car insanities))
; ("")

[Top]


insanity:entity

Action
Returns the entity which has the problem represented by an insanity object.

Filename
scm/scmext/intr/insanity_scm.cpp

APIs
None

Syntax
(insanity:entity insanity)

Arg Types
insanity insanity

Returns
entity

Description
This extension returns the Scheme entity to which the input insanity applies, that is, the entity which has the problem described by the insanity.

Arguments
insanity specifies the insanity object for which the entity is required.
; insanity:entity
; Create a circular edge.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
edge1
;; #[entity 1 1]
; Determine if edge1 passes the checks.
(define insanities (entity:insanities edge1))
; (#[edge error: edge without backptr]
;; )
(insanity:entity (car insanities))
;; #[entity 1 1]

[Top]


insanity:fix

Action
Attempts to fix problems with entities identified by the checker.

Filename
scm/scmext/intr/insanity_scm.cpp

APIs
api_fix_check_problems

Syntax
(insanity:fix insanity-list [acis-opts])

Arg Types
insanity-list insanity | insanity...)
acis-opts acis-options

Returns
((insanity | (insanity...)) . (insanity | insanity...)))

Description
The face normal is computed based on test-position and this extension returns it as a ray. The position on the entity face closest to the test-position is located.

Arguments
insanity-list specifies the list of insanities to attempt to fix.

acis-opts enables journaling and versioning options.
; insanity:fix
; Load in a part with problems
(define body (part:load 'overclamped_spline.sat))
; body
(define is (entity:insanities body 30))
;  checked:
;        1 lumps
;        1 shells
;        0 wires
;        1 faces
;        1 loops
;        5 coedges
;        5 edges
;        5 vertices
;; is
is
;(#[edge error: Curve approximation has knots with multiplicity greater
; than the curve degree]
; #[edge error: error in control point coincidence]
; )
(insanity:fix is)
;((#[edge error: Curve approximation has knots with multiplicity
; greater than the curve degree])
; #[edge error: error in control point coincidence])
 (entity:insanities (entity 1) 30)
; checked:
;        1 lumps
;        1 shells
;        0 wires
;        1 faces
;        1 loops
;        5 coedges
;        5 edges
;        5 vertices
;()

[Top]


insanity:message

Action
Returns the message (description) for an insanity object.

Filename
scm/scmext/intr/insanity_scm.cpp

APIs
None

Syntax
(insanity:message insanity)

Arg Types
insanity insanity

Returns
string

Description
This extension returns a textual description of the problem represented by a Scheme insanity object as a string. The possible descriptions are listed in the "Message" column of Table 1 in ACIS Checker.

Arguments
insanity specifies the insanity object for which the message is required.
; insanity:message
; Create a circular edge.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
; Determine if edge1 passes the checks.
(define insanities (entity:insanities edge1))
; (#[edge error: edge without backptr]
;; )
(insanity:message (car insanities))
;; "edge without backptr"

[Top]


insanity:print

Action
Prints an insanity object or a list of insanity objects in the format used by entity:check.

Filename
scm/scmext/intr/insanity_scm.cpp

APIs
None

Syntax
(insanity:print insanity)

Arg Types
insanity insanity | (insanity...)

Returns
Unspecified

Description
This extension prints the details of an insanity object or a list of such objects, in the same format as used by entity:check.

Arguments
insanity specifies the insanity object(s) to be printed.
; insanity:print
; Create a circular edge.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
; Determine if edge1 passes the checks.
(define insanities (entity:insanities edge1))
; (#[edge error: edge without backptr]
;; )
(insanity:print (car insanities))
; entid  11130856: Error: edge without backptr
;;()

[Top]


insanity:sub-category

Action
Returns the sub-category for an insanity object.

Filename
scm/scmext/intr/insanity_scm.cpp

APIs
None

Syntax
(insanity:sub-category insanity)

Arg Types
insanity insanity

Returns
string

Description
This extension returns a string describing the sub-category for the given insanity object. The currently defined sub-categories are listed in the documentation for the insanity_sub_category class in the SPAintr Framework. If no sub-category is set for the given insanity, the string "No sub category" is returned.

Arguments
insanity specifies the insanity object for which the sub-category is required.
; insanity:sub-category
; Create a circular edge.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
; Determine if edge1 passes the checks.
(define insanities (entity:insanities edge1))
; (#[edge error: edge without backptr]
;; )
(insanity:sub-category (car insanities))
; "No sub category"

[Top]


insanity:type

Action
Returns the type of an insanity object.

Filename
scm/scmext/intr/insanity_scm.cpp

APIs
None

Syntax
(insanity:type insanity)

Arg Types
insanity insanity

Returns
string

Description
This extension returns the type of a Scheme insanity object as a string. The possible strings returned are "error", "warning", "note", "info" or "null insanity". The last of these indicates that the insanity object is null.

Arguments
insanity specifies the insanity object for which the type is required.
; insanity:type
; Create a circular edge.
(define edge1
    (edge:circular (position 0 0 0) 25 0 185))
;; edge1
; Determine if edge1 passes the checks.
(define insanities (entity:insanities edge1))
; (#[edge error: edge without backptr]
;; )
(insanity:type (car insanities))
; "error"

[Top]


law:boundary-field

Action
Creates a boundary field around the defined entity.

Filename
scm/scmext/intr/ilaw_scm.cpp

APIs
api_create_boundary_field, api_get_coedges, api_get_faces, api_get_wires

Syntax
(law:boundary-field entity-list options [acis-opts])

Arg Types
entity-list entity | (entity ...)
options string
acis-opts acis-options

Returns
entity

Description
The following list shows the valid options for the second argument options:

"empty_field"
"uniform_vec_field" [(vector) optional vector]
"face_normal_field"
"face_tangent_field"
"direction control"
"reverse"

Arguments
The optional argument acis-opts helps enable journaling and versioning options.
; law:boundary-field
; Example not available for this release.

[Top]


law:min-dist

Action
Gets the minimum distance between faces.

Filename
scm/scmext/intr/ilaw_scm.cpp

APIs
api_entity_entity_distance

Syntax
(law:min-dist entity1 entity2)

Arg Types
entity1 entity
entity2 entity

Returns
real

Description
Finds a position on each entity such that the distance between the two is the minimum distance. Supported entities include vertex, edge, loop, face, wire, shell, lump, and body.

Arguments
entity1 is the first entity that could be any of vertex, edge, loop, face, wire, shell, lump or body.

entity2 is the first entity that could be any of vertex, edge, loop, face, wire, shell, lump or body.
; law:min-dist
; Create a law surface and lemon torus.
(define c1
    (face:law "vec(x,y,sin(x)*cos(y))"
    -10 10 -10 10))
;; c1
(define c2
    (face:torus (position 0 0 9.5)
    -5 10 0 360 0 360 (gvector 0 0 -1)))
;; c2
; Get minimum distance between faces
(define t10 (law:min-dist c1 c2))
; Point1 0.840486 0.000000 0.744968
; Point2 0.549500 0.000000 1.181163
;; t10

[Top]


massprops:get-centroid

Action
Returns the calculated centroid.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops:get-centroid mp)

Arg Types
mp massprops

Returns
position

Description
The center of gravity is calculated with respect to the world coordinate system, and therefore changes if the body is transformed. This method returns (0, 0, 0) if the centroid has not been calculated.

Arguments
mp is a massprops object returned by the body:massprops extension. Its contents are queried by means of extensions such as this one.
See the (body:massprops) example.

[Top]


massprops:get-inertia

Action
Returns the calculated inertia.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops:get-inertia mp)

Arg Types
mp massprops

Returns
tensor as a string

Description
The inertia tensor is calculated with respect to the world coordinate system, and therefore changes if the body is transformed. The major diagonal of the inertia tensor returned contains values for the inertias about each axis. For the inertia about the x-axis:
      (integral)((y*y + z*z)dV)
The off-diagonal terms are for the products of inertia; for example:
      (integral)((x*y)dV)
This method returns the zero tensor if the inertia has not been calculated.

Arguments
mp is a massprops object returned by the body:massprops extension. Its contents are queried by means of extensions such as this one.
See the (body:massprops) example.

[Top]


massprops:get-level-used

Action
Returns the level used in the object's calculation.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops:get-level-used mp)

Arg Types
mp massprops

Returns
string

Description
Returns "no-mass-props" if no calculations have been performed. Otherwise, this extension returns "volume-only", "volume-and-centroid", or "volume-centroid-and-inertia."

Arguments
mp is a massprops object returned by the body:massprops extension. Its contents are queried by means of extensions such as this one.
See the (body:massprops) example.

[Top]


massprops:get-p-axes

Action
Returns the calculated principal axes.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops:get-p-axes mp)

Arg Types
mp massprops

Returns
(gvector gvector gvector)

Description
The principal axes are calculated with respect to the world coordinate system, and therefore change if the body is transformed. Each axis should be orthogonal to the other two axes. This method returns the x-, y-, and z-axes if the principal axes have not been calculated.

Arguments
mp is a massprops object returned by the body:massprops extension. Its contents are queried by means of extensions such as this one.
See the (body:massprops) example.

[Top]


massprops:get-p-moments

Action
Returns the calculated principal moments.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops:get-p-moments mp)

Arg Types
mp massprops

Returns
(real real real)

Description
The principal moments of inertia are with respect to the coordinate system defined by the center of gravity and the principal axes. (These three values should be relatively constant under translational and rotational transformations, although their order may change depending on the principal axes.) This method returns zeroes if the principal moments have not been calculated.

Arguments
mp is a massprops object returned by the body:massprops extension. Its contents are queried by means of extensions such as this one.
See the (body:massprops) example.

[Top]


massprops:get-rel-accy-vol-achieved

Action
Returns the relative accuracy of the calculated volume.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops:get-rel-accy-vol-achieved mp)

Arg Types
mp massprops

Returns
real

Description
Returns the relative accuracy of the calculated volume.

Arguments
mp is a massprops object returned by the body:massprops extension. Its contents are queried by means of extensions such as this one.
See the (body:massprops) example.

[Top]


massprops:get-volume

Action
Returns the volume.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops:get-volume mp)

Arg Types
mp massprops

Returns
real

Description
Returns zero if no calculation has been performed.

Arguments
mp is a massprops object returned by the body:massprops extension. Its contents are queried by means of extensions such as this one.
See the (body:massprops) example.

[Top]


massprops:options

Action
Returns a massprops-options object, with internal data initialized to their default values.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops:options)

Arg Types
None

Returns
massprops-options

Description
Returns a default massprops-options object. Unless explicitly altered, use of this object by (body:massprops) entails that:
See the (body:massprops) example.

[Top]


massprops-options:get-level

Action
Returns an indicator of the mass properties to be calculated.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops-options:get-level mpo)

Arg Types
mpo massprops-options

Returns
string

Description
Returns an indicator of the mass properties to be calculated.

Arguments
mpo is the massprops-options object whose properties are being queried.
See the (body:massprops) example.

[Top]


massprops-options:get-one-sided-sheet-opt

Action
Returns an indicator of the way in which voids and open, one-sided sheets are to be treated.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops-options:get-one-sided-sheet-opt mpo)

Arg Types
mpo massprops-options

Returns
string

Description
Returns an indicator of the way in which voids and open, one-sided sheets are to be treated.

Arguments
mpo is the massprops-options object whose properties are being queried.
See the (body:massprops) example.

[Top]


massprops-options:get-plane-info

Action
Returns a position and normal vector defining the projection plane to be used in calculating mass properties.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops-options:get-plane-info mpo)

Arg Types
mpo massprops-options

Returns
(position gvector)

Description
Returns a position and normal vector defining the projection plane to be used in calculating mass properties.

Arguments
mpo is the massprops-options object whose properties are being queried.
See the (body:massprops) example.

[Top]


massprops-options:get-req-rel-accy

Action
Returns the desired relative accuracy for mass property calculations.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops-options:get-req-rel-accy mpo)

Arg Types
mpo massprops-options

Returns
real

Description
Returns the desired relative accuracy for mass property calculations.

Arguments
mpo is the massprops-options object whose properties are being queried.
See the (body:massprops) example.

[Top]


massprops-options:get-sheet-thickness

Action
Returns the thickness to be associated with sheets in mass property calculations.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops-options:get-sheet-thickness mpo)

Arg Types
mpo massprops-options

Returns
real

Description
Returns the thickness to be associated with sheets in mass property calculations.

Arguments
mpo is the massprops-options object whose properties are being queried.
See the (body:massprops) example.

[Top]


massprops-options:get-use-plane-info

Action
Returns a flag indicating whether or not user-specified projection-plane information is to be used in calculating the mass properties.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops-options:get-use-plane-info mpo)

Arg Types
mpo massprops-options

Returns
boolean

Description
Returns a flag indicating whether or not user-specified projection-plane information is to be used in calculating the mass properties.

Arguments
mpo is the massprops-options object whose properties are being queried. .
See the (body:massprops) example.

[Top]


massprops-options:set-level

Action
Sets an indicator of the mass properties to be calculated.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops-options:set-level mpo level)

Arg Types
mpo massprops-options
level string

Returns
string

Description
The choice of settings is as follows:

The former level is returned.

Arguments
mpo is the massprops-options object whose properties are being set. It can later be used to request optional behavior from the body:massprops extension by passing it as an input argument.
level is the indicator of the mass properties to be calculated.
See the (body:massprops) example.

[Top]


massprops-options:set-one-sided-sheet-opt

Action
Sets an indicator of the way in which voids and open, one-sided sheets are to be treated.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops-options:set-one-sided-sheet-opt mpo osso)

Arg Types
mpo massprops-options
osso string

Returns
string

Description
The choice of settings is as follows:

The value "closed-only" causes an error to be thrown when the body is found to have one or more open, single-sided sheets. The value "closed-only" also produces an error when a closed solid is found to have a negative volume, that is, when it forms a void. The other two choices, "solid" and "2sided", cause the volume (positive or negative) of any body to be calculated as though for a solid or a double-sided sheet body, respectively, with the latter calculation dependent upon the specified thickness.

The former one-sided-sheet option is returned.



Arguments
mpo is the massprops-options object whose properties are being set. It can later be used to request optional behavior from the body:massprops extension by passing it as an input argument.
osso is the indicator of the way in which voids and open, one-sided sheets are to be treated. Values include "closed-only", "2sided", and "solid".
See the (body:massprops) example.

[Top]


massprops-options:set-plane-info

Action
Sets the position and normal vector defining the projection plane to be used in calculating mass properties.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops-options:set-plane-info mpo root normal)

Arg Types
mpo massprops-options
root position
normal vector

Returns
(position gvector)

Description
The algorithm behind (body:massprops) works by adding the volumes obtained by sweeping the faces of a solid model to a reference plane. It is not necessary for you to specify this plane, as the algorithm attempts to make an optimal choice automatically. This method is provided only for cases in which you want to override this choice. Note that the values entered here are not to be used unless (massprops-options:set-plane-info) is also called with an argument of #t.
When using this method, you should attempt to select a projection plane that simplifies the body as much as possible. For instance, if the body were an extrusion, you would choose a plane perpendicular to the extrusion direction. This makes the numerical integration simpler. In general, for speed, choose the plane so that as many faces as possible project onto it as lines; that is, are edge-on to it. To improve the accuracy of the result, set the plane to pass through a point within the body; generally, this is the mid-point of its box.

The former projection-plane info are returned.

Arguments
mpo is the massprops-options object whose properties are being set. It can later be used to request optional behavior from the body:massprops extension by passing it as an input argument. .
root is a position on the projection plane to be used in calculating mass properties.
normal is a vector normal to the projection plane to be used in calculating mass properties.
See the (body:massprops) example.

[Top]


massprops-options:set-req-rel-accy

Action
Sets the desired accuracy for mass property calculations to the specified relative error.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops-options:set-req-rel-accy mpo err)

Arg Types
mpo massprops-options
err real

Returns
real

Description
For example, entering 0.01 requests a maximum error of one percent.
Note that there is a limitation to the current algorithm in that it does have a bound on how precisely the algorithm can calculate mass properties, because of hard-coded convergence criteria in the functions. When the returned accuracy exceeds the requested value, the application may try tightening the latter and repeating the calculation in order to achieve a more accurate result. If the mass-properties values nevertheless remain unchanged by this process, they are as close as can be achieved by the algorithm.
The former requested accuracy is returned.

Arguments
mpo is the massprops-options object whose properties are being set. It can later be used to request optional behavior from the body:massprops extension by passing it as an input argument.
err specifies the desired relative accuracy for the mass property calculation.
See the (body:massprops) example.

[Top]


massprops-options:set-sheet-thickness

Action
Sets the thickness to be associated with sheets in mass property calculations..

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops-options:set-sheet-thickness mpo thickness)

Arg Types
mpo massprops-options
thickness real

Returns
real

Description
Generally, double-sided (sheet or embedded) faces are ignored when calculating mass properties - The assumption being that a sheet of zero thickness has a zero volume. This behavior can be altered by changing the value of the specified sheet thickness from its default of 0.0 to a positive value. This enables (body:massprops) to treat double-sided sheets in the body as being approximations to thin-shell bodies with the given thickness, and contributions to the mass properties that are calculated for them also.
Some caveats apply when using this:

The former sheet thickness is returned.

Arguments
mpo is the massprops-options object whose properties are being set. It can later be used to request optional behavior from the body:massprops extension by passing it as an input argument.
thickness is the value specified for the sheet thickness.
See the (body:massprops) example.

[Top]


massprops-options:set-use-plane-info

Action
Sets a flag indicating whether or not user-specified projection-plane information is to be used in calculating the mass properties.

Filename
intr/intr_scm/mprop_scm.cxx

APIs
None

Syntax
(massprops-options:set-use-plane-info mpo flag)

Arg Types
mpo massprops-options
flag boolean

Returns
boolean

Description
The former projection-plane-info flag is returned. See the Description for massprops-options:set-plane-info for more details.

Arguments
mpo is the massprops-options object whose properties are being set. It can later be used to request optional behavior from the body:massprops extension by passing it as an input argument.
flag is the flag indicating whether or not user-specified projection-plane information is to be used in calculating the mass properties.
See the (body:massprops) example.

[Top]


pt-cvty-info:angle

Action
Returns the angle recorded in a pt-cvty-info.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(pt-cvty-info:angle pt-cvty-info)

Arg Types
pt-cvty-info scm_pt_cvty_info

Returns
real

Description
Returns the angle stored in a pt-cvty-info for the point along an edge for which the pt-cvty-info was recorded. Negative numbers infer concave, positive numbers infer convex.

Arguments
pt-cvty-info represents the convexity of a single point along the edge.
; pt-cvty-info:angle
; Create a block
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(pt-cvty-info:angle (edge:mid-pt-cvty-info
    (list-ref edge-list 0)))
;; 1

[Top]


pt-cvty-info:instantiate

Action
Returns the convexity of a pt-cvty-info for a given smooth angle tolerance.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(pt-cvty-info:instantiate pt-cvty-info tol)

Arg Types
pt-cvty-info scm_pt_cvty_info
tol real

Returns
scm_pt_cvty_info

Description
Returns the convexity of the given pt-cvty-info, for the given tolerance that determines when an edge is regarded as "smooth". The tolerance (tol) may be passed as -1 to emulate the historical behavior of edge:convexity. Equivalent to the C++ pt_cvty_info::instantiate.

Arguments
pt-cvty-info represents the convexity of a single point along the edge.
; pt-cvty-info:instantiate
; Defines some geometry and return the convexity.
(define w (solid:wiggle 60 60 60 "sym"))
;; w
(define edge (list-ref (entity:edges w) 0))
;; edge
(pt-cvty-info:instantiate
    (edge:mid-pt-cvty-info edge) 0.01)
;; #[cvty: cvx]

[Top]


pt-cvty-info:tangent-convexity

Action
Returns the tangent convexity of a pt-cvty-info for a given smooth angle tolerance.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(pt-cvty-info:tangent-convexity pt-cvty-info)

Arg Types
pt-cvty-info scm_pt_cvty_info

Returns
scm_pt_cvty_info

Description
Returns the convexity of the given pt-cvty-info, for the given tolerance that determines when an edge is regarded as "smooth". Equivalent to the C++ pt_cvty_info::tangent_convexity.

Arguments
pt-cvty-info represents the convexity of a single point along the edge.
; pt-cvty-info:tangent-convexity
; Create a block with a wiggle top
(define w (solid:wiggle 60 60 60 "sym"))
;; w
; Define the edges of the block
(define edge (list-ref (entity:edges w) 0))
;; edge
(pt-cvty-info:tangent-convexity
    (edge:mid-pt-cvty-info edge))
;; #[cvty: cvx knf]

[Top]


pt-cvty-info:unknown

Action
Determines whether a pt-cvty-info is unknown.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(pt-cvty-info:unknown pt-cvty-info)

Arg Types
pt-cvty-info scm_pt_cvty_info

Returns
boolean

Description
Returns #t if the given pt-cvty-info is unknown; e.g., it could not be computed for some reason.

Arguments
pt-cvty-info represents the convexity of a single point along the edge.
; pt-cvty-info:unknown
; Create a block
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(pt-cvty-info:unknown (edge:mid-pt-cvty-info
    (list-ref edge-list 0)))
;; #f

[Top]


pt-cvty-info:unset

Action
Returns whether a pt-cvty-info is unset.

Filename
scm/scmext/intr/cvty_typ.cpp

APIs
None

Syntax
(pt-cvty-info:unset pt-cvty-info)

Arg Types
pt-cvty-info scm_pt_cvty_info

Returns
boolean

Description
Returns #t if a pt-cvty-info is unset. This should never be the case, but is provided for completeness.

Arguments
pt-cvty-info represents the convexity of a single point along the edge.
; pt-cvty-info:unset
; Create a block
(define block1 (solid:block (position 0 10 0)
    (position 10 20 20)))
;; block1
; Define the edges of block1
(define edge-list (entity:edges block1))
;; edge-list
(pt-cvty-info:unset (edge:mid-pt-cvty-info
    (list-ref edge-list 0)))
;; #f

[Top]


ray:get-ents

Action
Retrieves a list of hits of a specified entity type by firing a ray at a body.

Filename
scm/scmext/intr/get_ents_scm.cpp

APIs
api_get_ents

Syntax
(ray:get-ents ray_point ray_direction ray_radius "type_string" target_body [acis-opts])

Arg Types
ray_point position
ray_direction gvector
ray_radius real
"type_string" string
target_body entity
acis-opts acis-options

Returns
list of entities hit by the ray.


Description
This scheme extension fires a ray at a body from the given ray point in the given ray direction, with given ray radius and returns a list containing entities hit by the ray. Only the entities specified by "type_string" will be returned; all the other hits are discarded.

Arguments

ray_point represents the base point of the ray.

ray_direction represents the direction of the ray.

ray_radius represents the radius of the ray.

"type_string" contains the name of type of entities required. This string can have the following valid values:

target_body represents the target body in which you need to select the entities.

acis-opts contains information related to versioning and journaling.

(part:clear)
;create a solid block
(define blk (solid:block 0 0 0 10 10 10))
;;blk
;set start point of ray.
(define pt (position 5 5 -5))
;;pt
;set direction of the ray.
(define v (gvector 0 0 1))
;;v
;set radius of ray.
(define ray_rad 0.01)
;;ray_rad
;set type of entities wanted to FACE
(define type "FACE")
;get list of faces hit by given ray
(define f_list (ray:get-ents pt v ray_rad type blk))
;;f_list
f_list
;;(#[entity 2 1] #[entity 3 1])
;set the color of selected faces to RED
(entity:set-color f_list RED)
;; ()
;set start point of ray.
(define pt1 (position 5 0 -5))
;set type of entities wanted tp COEDGE
(define type "COEDGE")
;get list of coedges hit by given ray
(ray:get-ents pt1 v ray_rad type blk)
;;(#[entity 4 1] #[entity 5 1] #[entity 6 1] #[entity 7 1])
;OUTPUT Examples

[Top]


solid:classify-position

Action
Classifies a point with respect to a solid.

Filename
scm/scmext/intr/rtst_scm.cpp

APIs
api_point_in_body

Syntax
(solid:classify-position entity test-position
     [use-boxes] [acis-opts])

Arg Types
entity entity
test-position position
use-boxes boolean
acis-opts acis-options

Returns
integer

Errors
First object is not a solid.
Second object is not a position.

Description
This extension returns -1 if the position is inside the solid, 0 if the position is on the surface of the solid, or 1 for the position is outside the solid. This extension returns #f if the containment cannot be determined. To test when the body may be a void, set the use-boxes flag to FALSE. This will make testing slower, however.

Arguments
The argument entity specifies a solid body entity.

The argument test-position specifies the location on the entity to classify.

The optional argument use-boxes, when set to #f, tests when the body may be void.

The optional argument acis-opts helps enable journaling and versioning options.
; solid:classify-position
; Create a solid block.
(define block1 (solid:block (position 0 0 0)
    (position 15 15 15)))
;; block1
; Classify point 1 with respect to the solid.
(solid:classify-position block1 (position 6 3 8))
;; -1
(solid:classify-position block1 (position 0 0 0))
;; 0
; Classify point 2 with respect to the solid.
(solid:classify-position block1
    (position -4 -4 -4))
;; 1

[Top]


solid:ray-test

Action
Gets the position where a ray intersects a solid.

Filename
scm/scmext/intr/rtst_scm.cpp

APIs
api_ray_test_body

Syntax
(SOLID:RAY-TEST entity ray [ray-radius] [hits-wanted] [acis-opts])

Arg Types
entity body
ray ray
ray-radius double
hits-wanted integer
acis-opts acis-options

Returns
((entity . position) ...)

Description
Returns the position(s) where a ray intersects a solid. This extension returns pairs. The first element of each pair is the entity hit by the ray, and the second element of the pair is the position where the ray intersects the solid. The pairs are sorted along the direction of the ray. If the ray intersects a single face more than once, the extension returns the first intersection.

Arguments
The argument entity must be a solid body.

The argument ray consists of a position and a direction.

The argument ray-radius specifies the radius of the ray that is getting shot. It is set to 0.1 by default in the scheme command.

The argument hits-wanted specifies the number of maximum entities to be returned. The default value, 0 indicates that all possible entities are returned.

The optional argument acis-opts helps enable journaling and versioning options.
; solid:ray-test
; Create a solid block.
(define block1 (solid:block (position 0 0 0)
    (position 40 40 40)))
;; block1
; Determine where the ray intersects the solid block.
(solid:ray-test block1 (ray (position 0 0 0)
    (gvector 0 0 1)))
;; ((#[entity 4 1] . #[position 0 0 0])
;; (#[entity 3 1] . #[position 0 0 40]))

[Top]


tcoedge-bad-crv:csl

Action
Returns information from a tm-chk-info of derived type tcoedge-bad-crv.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tcoedge-bad-crv:csl tm-check)

Arg Types
tm-check tm-chk-info

Returns
string

Errors
Argument is not a tcoedge_bad_crv.

Description
Returns the information from the check_status enum (see kernel/kernint/d3_chk/chk_stat.hxx). For example, this function could return ("check_non_C1" "check_self_intersects").

Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tcoedge-bad-crv:csl
; Requires a bad sat file to generate this error.
; Example/bad sat file not available at this time.

[Top]


tcoedge-bad-crv?

Action
Returns #t when the given object is a tm-chk-info of derived type tcoedge_bad_crv.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tcoedge-bad-crv? tm-check)

Arg Types
tm-check tm-chk-info

Returns
boolean
Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tcoedge-bad-crv?
; Build block for example.
(define block (solid:block (position 0 0 0)
    (position 10 10 10)))
;; block
(define errors (tm-check:all (car
    (entity:edges block))))
;; errors
(tcoedge-bad-crv? (car errors))
;; #f

[Top]


tcoedge-bs2-non-g1?

Action
Return #t if the given object is a tm-chk-info of derived type tcoedge_bs2_non_G1.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tcoedge-bs2-non-g1? t)

Arg Types
tm-check tm-chk-info

Returns
boolean
Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tcoedge-bs2-non-g1
; Create geometry to illustrate command.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tcoedge-bs2-non-g1? (car errors))
;; #f

[Top]


tcoedge-bs2-outside-sf?

Action
Return #t if the given object is a tm-chk-info of derived type tcoedge_bs2_outside_sf.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tcoedge-bs2-outside-sf? tm-check)

Arg Types
tm-check tm-chk-info

Returns
boolean
Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tcoedge-bs2-outside-sf?
; Create geometry to illustrate command.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tcoedge-bs2-outside-sf? (car errors))
;; #f

[Top]


tcoedge-crv-non-g1?

Action
Return #t if the given object is a tm-chk-info of derived type tcoedge_crv_non_G1.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tcoedge-crv-non-g1? tm-check)

Arg Types
tm-check tm-chk-info

Returns
boolean
Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tcoedge-crv-non-g1?
; Create geometry to illustrate command.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tcoedge-crv-non-g1? (car errors))
;; #f

[Top]


tedge-bad-crv:csl

Action
Returns the check_status_list from a tm-chk-info of derived type tedge_bad_crv.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tedge-bad-crv:csl tm-check)

Arg Types
tm-check tm-chk-info

Returns
(string ...)

Errors
Argument is not a tedge_bad_crv.

Description
A list of strings is returned, being the printed representation of the check_status enum (see kernel/kernint/d3_chk/chk_stat.hxx). For example, this extension could return ("check_non_C1" "check_self_intersects").

Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tedge-bad-crv:csl
; Requires a bad sat file to generate this error.
; Example/bad sat file not available at this time.

[Top]


tedge-bad-crv?

Action
Return #t if the given object is a tm-chk-info of derived type tedge_bad_crv.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tedge-bad-crv? tm-check)

Arg Types
tm-check tm-chk-info

Returns
boolean
Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tedge-bad-crv?
; Create geometry to illustrate command.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tedge-bad-crv? (car errors))
;; #f

[Top]


tedge-crv-non-g1?

Action
Return #t if the given object is a tm-chk-info of derived type tedge_crv_non_G1.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tedge-crv-non-g1? tm-check)

Arg Types
tm-check tm-chk-info

Returns
boolean
Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tedge-crv-non-g1?
; Create geometry to test command.
(define b (solid:block
    (position 0 0 0) (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tedge-crv-non-g1? (car errors))
;; #f

[Top]


tedge-local-self-int?

Action
Return #t if the given object is a tm-chk-info of derived type tedge_local_self_int.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tedge-local-self-int? tm-check)

Arg Types
tm-check tm-chk-info

Returns
boolean
Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tedge-local-self-int?
; Create geometry to illustrate command.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tedge-local-self-int? (car errors))
;; #f

[Top]


tedge-remote-self-int:other-edge-param

Action
Returns the other parameter value of the self-intersection.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tedge-remote-self-int:other-edge-param tm-check)

Arg Types
tm-check tm-chk-info

Returns
real | boolean

Description
The self-intersection is represented by two parameter values. The Scheme extension tm-chk-info:edge-param returns the first; this Scheme extension returns the second (other) parameter value of the self-intersection.

Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tedge-remote-self-int:other-edge-param
; Create geometry to illustrate command.
(define block (solid:block (position 0 0 0)
    (position 10 10 10)))
;; block
; Get list of all edges on block.
(define edges (car (entity:edges block)))
;; edges
(tm-check:all edges)
;; (#[tm_bad_topology 58e23b8])
(tedge-remote-self-int? edges)
;; #f
(define t (tedge-remote-self-int:other-edge-param
    (car edges))
;; t

[Top]


tedge-remote-self-int?

Action
Returns #t if the given object is a tm-chk-info of derived type tedge_remote_self_int.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tedge-remote-self-int? tm-check)

Arg Types
tm-check tm-chk-info

Returns
boolean
Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tedge-remote-self-int?
; Create geometry to illustrate command.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tedge-remote-self-int? (car errors))
;; #f

[Top]


tedge-tcoedge-bad-geom?

Action
Returns #t if the given object is a tm-chk-info of derived type tedge_tcoedge_bad_geom.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tedge-tcoedge-bad-geom? tm-check)

Arg Types
tm-check tm-chk-info

Returns
boolean
Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tedge-tcoedge-bad-geom?
; Create geometry to illustrate command.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tedge-tcoedge-bad-geom? (car errors))
;; #f

[Top]


tedge-tcoedge-bad-tol?

Action
Returns #t if the given object is a tm-chk-info of derived type tedge_remote_self_int.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tedge-tcoedge-bad-tol tm-check)

Arg Types
tm-check tm-chk-info

Returns
boolean
Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tedge-tcoedge-bad-tol?
; Create geometry to illustrate command.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tedge-tcoedge-bad-tol? (car errors))
;; #f

[Top]


tedge-tcoedge-ranges:start

Action
Returns the start flag from a tm-chk-info of derived type tedge_tcoedge_ranges.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tedge-tcoedge-ranges:start tm-check)

Arg Types
tm-check tm-chk-info

Returns
boolean

Errors
Argument is not a tedge_tcoedge_ranges.

Description
The start flag from a tedge-tcoedge-ranges error object is returned.

Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tedge-tcoedge-ranges:start
; Requires a bad sat file to generate this error.
; Example/bad sat file not available at this time.

[Top]


tedge-tcoedge-ranges?

Action
Returns #t if the given object is a tm-chk-info of derived type tedge_tcoedge_ranges.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tedge-tcoedge-ranges? tm-check)

Arg Types
tm-check tm-chk-info

Returns
boolean
Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tedge-tcoedge-ranges?
; Create geometry to illustrate command.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tedge-tcoedge-ranges? (car errors))
;; #f

[Top]


tm-bad-topology?

Action
Returns #t if the given object is a boolean of derived type tm_bad_topology.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tm-bad-topology? tm-check)

Arg Types
tm-check boolean

Returns
boolean
Arguments
tm-check is an object of type boolean that contains tolerant modeling check details.
; tm-bad-topology?
; Create geometry to illustrate command.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tm-bad-topology? (car errors))
;; #t

[Top]


tm-check:all

Action
Performs all the tolerant modelling geometry checks on this edge and its coedges.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:all edge)

Arg Types
edge edge

Returns
(edge ...)

Errors
Argument not an EDGE.

v
Description
Performs all of the tolerant modeling geometry tests on this tedge and its coedges. Therefore it invokes: tm-check:tm-bad-topology, tm-check:tedge, tm-check:tcoedge (for each coedge), tm-check:tedge-tcoedge (for each coedge), tm-check:tedge-self-int, and tm-check:tedge-tol. A list of any tm-chk-info error objects that are generated is returned (or an empty list if all is fine). Note that in general, if an early check fails, then the later checks may be omitted (on the grounds that they are not even guaranteed to work unless certain preconditions are guaranteed.)

Arguments
edge is an argument of type edge on which tolerant modelling geometry checks are performed.
; tm-check:all
; Create geometry to illustrate command.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix
    (car (entity:edges b)))))
;; e
(tm-check:all e)
;; ()
; this tedge is fine

[Top]


tm-check:tcoedge

Action
Performs all the tolerant edge tests that apply to the parameter and 3-space curves of this coedge. (Amalgamates a number of basic tests.).

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tcoedge coedge)

Arg Types
coedge coedge

Returns
(coedge ...)

Errors
Argument is not a TCOEDGE.

Description
Performs all the tm-check tests that apply to this coedge's parameter-space and 3-space curves, without reference to the edge itself. This test performs in order: tm-check:tcoedge-bs2-non-g1, tm-check:tcoedge-bs2-outside-sf, tm-check:tcoedge-crv-non-g1, tm-check:tcoedge-bad-crv. A list of any tm-chk-info error objects that are generated is returned (or an empty list if all is fine).

Arguments
coedge is an argument of type tcoedge on which tolerant edge tests are to be performed.
; tm-check:tcoedge
; Create geometry to illustrate command.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix
    (car (entity:edges b)))))
;; e
(tm-check:tcoedge (car (entity:tcoedges e)))
;; ()
; coedge geometry is fine

[Top]


tm-check:tcoedge-bad-crv

Action
Tests validity of the 3D geometry of a tolerant coedge.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tcoedge-bad-crv coedge)

Arg Types
coedge coedge

Returns
(coedge ...)

Errors
Argument is not TCOEDGE.

Description
Returns as tm-check:tm-bad-topology would if the coedge's edge is not a TEDGE. Otherwise it checks the coedge 3D curve geometry for being invalid, according to the standard ACIS curve checker. If any problems are identified, a tm-chk-info of derived type tcoedge-bad-crv is returned which lists (via tcoedge-bad-crv:csl) the check_status_list (see kernel/kernint/d3_chk/chk_stat.hxx) of problems returned by the curve checker. If the geometry is valid, an empty list is returned.

Arguments
coedge is an argument of type tcoedge whose 3D geometry is to be tested.
; tm-check:tcoedge-bad-crv
; Create geometry to illustrate command.
(define b (solid:block
    (position 0 0 0) (position 10 10 10)))
;; b
(define e (car (tolerant:fix
    (car (entity:edges b)))))
;; e
(tm-check:tcoedge-bad-crv (car (entity:tcoedges e)))
;; ()
; geometry is valid

[Top]


tm-check:tcoedge-bs2-non-g1

Action
Tests whether the parameter curve (bs2_curve) of a tcoedge is G1 in parameter space.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tcoedge-bs2-non-g1 coedge)

Arg Types
coedge tcoedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TCOEDGE.

Description
Returns as tm-check:tm-bad-topology would if the coedge's edge is not a TEDGE. Otherwise it checks the coedge parameter space curve for being G1 in parameter space. If any problems are identified, a tm-chk-info of derived type tcoedge-bs2-non-g1 is returned which lists (via tm-chk-info:coedge-param) the coedge parameter where there is a problem. Note that the coedge parameter is negated if the coedge is reversed to match the edge's sense. If the parameter curve is G1, an empty list is returned.

Arguments
coedge is an argument of type tcoedge whose parametric curve is tested for the above mentioned condition.
; tm-check:tcoedge-bs2-non-g1
; Check to see if the parameter curve is G1 or not.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tcoedge-bs2-non-g1
    (car (entity:tcoedges e)))
;; ()
; bs2_curve is G1

[Top]


tm-check:tcoedge-bs2-outside-sf

Action
Tests whether the parameter curve (bs2_curve) of a tcoedge strays outside the boundary of the coedge's face's surface.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tcoedge-bs2-outside-sf coedge)

Arg Types
coedge tcoedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TEDGE.

Description
Returns as tm-check:tm-bad-topology would if coedge's edge is not a TEDGE. Otherwise, checks the coedge parameter space curve to see if it strays outside the boundaries of the coedge's face's surface. The resolution used is resabs in parameter and will pick up most significant problems. If any problems are identified, a tm-chk-info of derived type tcoedge-bs2-outside-sf is returned which lists (via tm-chk-info:coedge-param) the coedge parameter where there is a problem. The coedge parameter is negated if the coedge is reversed so as to have the same sense as the edge itself. If the parameter curve is fine in this respect, an empty list is returned.

Arguments
coedge is an argument of type tcoedge whose parametric curve is tested for the above mentioned condition.
; tm-check:tcoedge-bs2-outside-sf
; Check a parameter curve of a coedge.
(define block (solid:block (position 0 0 0)
    (position 10 10 10)))
;; block
(define list (car (tolerant:fix (car
    (entity:edges block)))))
;; list
(tm-check:tcoedge-bs2-outside-sf (car
    (entity:tcoedges block)))
;; ()
; bs2_curve lies within surface

[Top]


tm-check:tcoedge-crv-non-g1

Action
Tests whether the 3D curve of a tolerant coedge is G1 or not.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tcoedge-crv-non-g1 edge)

Arg Types
coedge tcoedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TEDGE.

Description
Returns as tm-check:tm-bad-topology would if the coedge is not a TCOEDGE. Otherwise it checks the coedge 3D curve for being G1. If any problems are identified, a tm-chk-info of derived type tcoedge-crv-non-g1 is returned which lists (via tm-chk-info:coedge-param) the coedge parameter where there is a problem. Note that the coedge parameter is negated if the coedge is reversed so as to have the same sense as the edge itself. If the 3D curve is G1, an empty list is returned.

Arguments
edge is an argument of type TEDGE whose 3D cure is tested for G1 continuity.
; tm-check:tcoedge-crv-non-g1
; Check to see if the coedge is G1 or not.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tcoedge-crv-non-g1 (car
    (entity:tcoedges e)))
;; ()
; 3D curve is G1

[Top]


tm-check:tedge

Action
Performs all the tolerant edge tests that apply to the curve of this edge. (Amalgamates together a number of more basic tests.).

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tedge edge)

Arg Types
edge tedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TEDGE.

Description
Performs all the tm-check tests that apply to this edge curve, without reference to any of the edge's coedges. This test performs in order: tm-check:tedge-crv-non-g1, tm-check:tedge-bad-crv. A list of any tm-chk-info error objects that are generated is returned (or an empty list if all is fine).

Arguments
edge is an argument of type TEDGE on which all the tolerant edge tests are performed.
; tm-check:tedge
; Check all tolerant edge checks.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tedge e)
;; ()
; edge geometry is fine

[Top]


tm-check:tedge-bad-crv

Action
Test whether the geometry of a tolerant edge is illegal or not.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tedge-bad-crv edge)

Arg Types
edge tedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TEDGE.

Description
Returns as tm-check:tm-bad-topology would if the edge is not a TEDGE. Otherwise it checks whether the edge geometry is invalid, according to the standard ACIS curve checker. If any problems are identified, a tm-chk-info of derived type tedge-bad-crv is returned which lists (via tedge-bad-crv:csl) the check_status_list of problems returned by the curve checker. If the geometry is valid, an empty list is returned.

Arguments
edge is an argument of type TEDGE for which the geometry is tested for legality.
; tm-check:tedge-bad-crv
; Check to see if the edge is a legal edge.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tedge-bad-crv e)
;; ()
; geometry is valid

[Top]


tm-check:tedge-crv-non-g1

Action
Tests whether the geometry of a tolerant edge is G1 or not.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tedge-crv-non-g1 edge)

Arg Types
edge tedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TEDGE.

Description
Returns as tm-check:tm-bad-topology would if the edge is not a TEDGE. Otherwise it checks the edge geometry for being G1. If it is not, a list containing a tm-chk-info of derived type tedge_crv_non_g1 is returned (and tm-chk-info:edge-param gives the parameter of the problem). If the geometry is G1, an empty list is returned.

Arguments
edge is an argument of type TEDGE for which the geometry is tested for G1 continuity.
; tm-check:tedge-crv-non-g1
; Check to see if the curve is G1 or not.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tedge-crv-non-g1 e)
;; ()
; geometry is valid

[Top]


tm-check:tedge-local-self-int

Action
Tests whether the geometry of a tolerant edge has local self-intersections (i.e., creases up on itself).

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tedge-local-self-int edge)

Arg Types
edge tedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TEDGE.

Description
Returns as tm-check:tm-bad-topology would if the edge is not a TEDGE. Otherwise it checks the edge geometry for having local self-intersections (i.e., regions where the tube around the edge, of radius equal to the edge tolerance, creases up on itself). If so, a list containing a tm-chk-info of derived type tedge-local-self-int is returned. This may indicate the edge parameter of the problem (via tm-chk-info:edge-param). If there are no local self-intersections, an empty list is returned.

Arguments
edge is an argument of type TEDGE for which the local self-intersections are tested.
; tm-check:tedge-local-self-int
; Check for edge local self-intersections.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tedge-local-self-int e)
;; ()
; geometry is valid

[Top]


tm-check:tedge-remote-self-int

Action
Tests the geometry of a tolerant edge to determine remote self-intersections.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tedge-remote-self-int edge)

Arg Types
edge tedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TEDGE.

Description
Returns as tm-check:tm-bad-topology would if the edge is not a TEDGE. Otherwise it checks the edge geometry for having remote self-intersections (i.e., regions where the tube around the edge, of radius equal to the edge tolerance, returns to re-intersect itself). If so, a list containing a tm-chk-info of derived type tedge-remote-self-int is returned. This may indicate the two edge parameters of the problem (via tm-chk-info:edge-param and tedge-remote-self-int:other-edge-param). If there are no remote self-intersections, an empty list is returned.

Arguments
edge is an argument of type TEDGE for which the remote self-intersections are tested.
; tm-check:tedge-remote-self-int
; Check for edge remote self-intersections.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tedge-remote-self-int e)
;; ()
; geometry is valid

[Top]


tm-check:tedge-self-int

Action
Tests a tolerant edge for local and remote self-intersections. (Amalgamates a number of more basic tests).

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tedge-self-int edge)

Arg Types
edge tedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TEDGE.

Description
Tests whether this TEDGE has any local or remote self-intersections. This tests uses the edge tolerance, so the checks tm-check:tedge and then tm-check:tcoedge and tm-check:tedge-tcoedge (for each coedge of the edge) should already have been passed. This test then performs in order: tm-check:tedge-local-self-int, tm-check:tedge-remote-self-int. A list of any tm-chk-info error objects that are generated is returned (or an empty list if all is fine).

Arguments
edge is an argument of type TEDGE for which the local and remote self-intersections are tested.
; tm-check:tedge-self-int
; Check for edge self-intersection.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tedge-self-int e)
;; ()
; edge geometry does not self-intersect

[Top]


tm-check:tedge-tcoedge

Action
Performs all the tolerant edge tests that ensure that this edge geometry and coedge geometry are compatible for tolerant modeling.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tedge-tcoedge coedge)

Arg Types
coedge tcoedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TCOEDGE.

Description
Performs all the tm-check tests that apply to this coedge and edge together, to ensure that they are compatible. It therefore performs in order: tm-check:tedge-tcoedge-ranges, tm-check:tedge-tcoedge-bad-geom. (It is assumed that the edge and coedge have already been individually checked for validity using tm-check:tedge and tm-check:tcoedge.) A list of any tm-chk-info error objects that are generated is return (or an empty list if all is fine).

Arguments
coedge is an argument of type TCOEDGE for which the compatibility is tested.
; tm-check:tedge-tcoedge
; Check all tests for edge tolerance.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tedge-tcoedge (car (entity:tcoedges e)))
;; ()
; coedge geometry is fine

[Top]


tm-check:tedge-tcoedge-bad-geom

Action
Tests whether the 3D curves of a tcoedge and its edge have compatible directions and curvatures all along their length.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tedge-tcoedge-bad-geom coedge)

Arg Types
coedge tcoedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TCOEDGE.

Description
Returns as tm-check:tm-bad-topology would if the coedge's edge is not a TEDGE. Otherwise it analyses the coedge 3D curve and the curve of its edge to determine whether they have sympathetic directions and curvatures all along their length. This is necessary for tolerant modeling to work properly.

Arguments
coedge is an argument of type TCOEDGE for which the compatibility is tested.
; tm-check:tedge-tcoedge-bad-geom
; Check the coedge for bad geometry.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tedge-tcoedge-bad-geom (car
    (entity:tcoedges e)))
;; ()
; geometry is valid

[Top]


tm-check:tedge-tcoedge-bad-tol

Action
Tests whether the 3D curve of a tcoedge strays outside the computed tolerance zone of a tolerant edge.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tedge-tcoedge-bad-tol coedge)

Arg Types
coedge tcoedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TCOEDGE.

Description
Returns as tm-check:tm-bad-topology would if the coedge's edge is not a TEDGE. Otherwise it analyses the coedge 3D curve and the curve of its edge to determine whether the coedge strays further from the edge than the edge's tolerance.
; tm-check:tedge-tcoedge-bad-tol
; Check the coedge for bad tolerance.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tedge-tcoedge-bad-tol (car
    (entity:tcoedges e)))
;; ()
; geometry is valid

[Top]


tm-check:tedge-tcoedge-ranges

Action
Tests whether the ends of the 3D curves of a tcoedge and its edge are sufficiently compatible for tolerant modeling to work.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tedge-tcoedge-ranges coedge)

Arg Types
coedge tcoedge

Returns
(tm-chk-info ...)

Errors
Argument is not a TCOEDGE.

Description
Returns as tm-check:tm-bad-topology would if the coedge's edge is not a TEDGE. Otherwise it analyses the start and end of the coedge 3D curve and the curve of its edge to determine whether the curves overlap sensibly and have compatible directions so that tolerant modeling can work on them.

Arguments
coedge is an argument of type TCOEDGE for which the compatibility is tested.
; tm-check:tedge-tcoedge-ranges
; Check the coedge and edge for compatibility.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tedge-tcoedge-ranges (car
    (entity:tcoedges e)))
;; ()
; geometry is valid

[Top]


tm-check:tedge-tol

Action
Tests whether the recorded tolerance of this TEDGE is correct.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tedge-tol tedge)

Arg Types
tedge tedge

Returns
(tm-chk-info ...)

Errors
Argument is not an TEDGE.

Description
Tests whether the recorded tolerance of this tedge is correct. As this test uses the edge tolerance, the checks tm-check:tedge and then tm-check:tcoedge and tm-check:tedge-tcoedge (for each coedge of the edge) should already have been passed. This test then performs in order: tm-check:tedge-tcoedge-bad-tol for each coedge of the edge. A list of any tm-chk-info error objects that are generated is returned (or an empty list if all is fine).

Arguments
tedge is an argument of type tedge for which the correctness of recorded tolerance is tested.
; tm-check:tedge-tol
; Check the recorded tolerance of a tedge.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define e (car (tolerant:fix (car
    (entity:edges b)))))
;; e
(tm-check:tedge-tol e)
;; ()
; tolerance is correct

[Top]


tm-check:tm-bad-topology

Action
Tests whether the topology of a given edge is correct for it being a tolerant edge.

Filename
scm/scmext/intr/tmchk_scm.cpp

APIs
None

Syntax
(tm-check:tm-bad-topology edge)

Arg Types
edge tedge

Returns
(tm-chk-info ...)

Errors
Argument not an EDGE.

Description
Checks whether the given EDGE is actually a TEDGE; that it has geometry; that it has at least one COEDGE; that all its COEDGEs are actually TCOEDGEs, and that all have geometry. If any of these tests fails, returns a list of one tm-chk-info of derived type tm-bad-topology (otherwise an empty list if all is fine). This error object points to the edge that was checked; if the problem actually involved one of the coedges then that coedge is pointed to also.

Arguments
tedge is an argument of type tedge for which the correctness of topology is tested.
; tm-check:tm-bad-topology
; Check for bad topology and return the information.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:tm-bad-topology
    (car (entity:edges b))))
;; errors
; the EDGE was not a TEDGE

[Top]


tm-chk-info:coedge

Action
Returns the coedge that caused a particular error.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tm-chk-info:coedge tm-check)

Arg Types
tm-check tm-chk-info

Returns
entity | boolean

Description
Returns the coedge recorded within the tm-chk-info that was the cause of the reported error, or #f if no edge is recorded.

Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tm-chk-info:coedge
; Print out the coedge where an error occurs.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tm-chk-info:coedge (car errors))
;; #f

[Top]


tm-chk-info:coedge-param

Action
Returns the coedge parameter, if known, where a particular error occurs. The coedge parameter is corrected to have the same sense as the edge.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tm-chk-info:coedge-param tm-check)

Arg Types
tm-check tm-chk-info

Returns
real | boolean

Description
Returns the coedge parameter recorded within the tm-chk-info where the particular error being reported occurs, or #f if no coedge parameter is present.

Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tm-chk-info:coedge-param
; Print out the coedge parameter of a given tolerant
; model information set.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tm-chk-info:coedge-param (car errors))
;; #f

[Top]


tm-chk-info:edge

Action
Returns the edge that caused a particular error.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tm-chk-info:edge tm-check)

Arg Types
tm-check tm-chk-info

Returns
real | boolean

Description
Returns the edge recorded within the tm-chk-info that was the cause of the reported error, or #f if no edge is recorded.

Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tm-chk-info:edge
; Print out the edge where an error occurs.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(define checks (tm-chk-info:edge (car errors)))
;; checks

[Top]


tm-chk-info:edge-param

Action
Returns the edge parameter, if known, where a particular error occurs.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tm-chk-info:edge-param tm-check)

Arg Types
tm-check tm-chk-info

Returns
real | boolean

Description
Returns the edge parameter recorded within the tm-chk-info where the particular error being reported occurs, or #f if no edge parameter is present.

Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
; tm-chk-info:edge-param
; Print out the edge parameter of a given tolerant
; model information set.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tm-chk-info:edge-param (car errors))
;; #f

[Top]


tm-chk-info:print

Action
Prints a full and relatively readable description of the entire contents of a tm-chk-info on an output port, terminating with a newline.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tm-chk-info:print tm-check [port])

Arg Types
tm-check tm-chk-info
port string

Returns
tm-chk-info

Description
Prints a full and relatively readable description of the entire contents of the tm-chk-info (first argument) on the given output port (second argument), defaulting to the current output port if the second argument is omitted. The output terminates with a new line.

Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.
 
port specifies the output port to which the the contents of tm-check are written and the output is terminated with a newline.
; tm-chk-info:print
; Print out the contents of a given tolerant model
; information set.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tm-chk-info:print (car errors))
; tm_bad_topology: edge 20469008
;; #[tm_bad_topology 4059b210]

[Top]


tm-chk-info:print1

Action
Prints a full and relatively readable description of the entire contents of a tm-chk-info on an output port, terminating without a newline.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tm-chk-info:print1 tm-check [port])

Arg Types
tm-check tm-chk-info
port string

Returns
tm-chk-info

Description
Prints a full and relatively readable description of the entire contents of the tm-chk-info (first argument) on the given output port (second argument), default to the current output port if the second argument is omitted. The output is terminated without a newline.

Arguments
tm-check is an object of type tm-chk-info that contains tolerant modeling check details.

port specifies the output port to which the the contents of tm-check are written and the output is terminated without a newline.
; tm-chk-info:print1
; Print out the contents of a given tolerant model
; information set.
(define b (solid:block (position 0 0 0)
    (position 10 10 10)))
;; b
(define errors (tm-check:all (car (entity:edges b))))
;; errors
(tm-chk-info:print1 (car errors))
; tm_bad_topology: edge 1413712
;; #[tm_bad_topology 4059b210]

[Top]


tm-chk-info?

Action
Determines whether the given Scheme object is a tm-chk-info.

Filename
scm/scmext/intr/tmchk_typ.cpp

APIs
None

Syntax
(tm-chk-info? object)

Arg Types
object scheme-object

Returns
boolean

Description
Returns #t if the given object is a tm-chk-info.

Arguments
object is a variable of type scheme-object. The scheme tests if this object is a tm-chk-info.
; tm-chk-info?
; Check to see if a Scheme Object is a
; tolerant model.
(define cube (solid:block (position 0 0 0)
    (position 10 10 10)))
;; cube
(define errors (tm-check:all (car
    (entity:edges cube))))
;; errors
(tm-chk-info? (car errors))
;; #t

[Top]


wire-body:self-intersect?

Action
Checks to see if a wire-body intersects itself.

Filename
scm/scmext/intr/icrv_scm.cpp

APIs
None

Syntax
(wire-body:self-intersect? wire-body [acis-opts])

Arg Types
wire-body wire-body
acis-opts acis-options

Returns
boolean

Description
This extension tests to see if a wire-body self intersects. If a self intersection is found, the extension returns true. Otherwise it returns false.

Arguments
wire-body is an input variable of type wire-body that needs to be tested for self intersection.

acis-opts is an acis-options variable.  This is used to enable versioning and journaling options.
; wire-body:self-intersect?
; No example available at this time.

[Top]