Package Documentation

Object: brep (The :surf Package)
Mixins: geometry-kernel-object-mixin, ifs-output-mixin, base-object

Author

Dave Cooper, Genworks

Description

A general superclass for all boundary representation geometric entities. This currently follows the smlib topology model, with breps containing regions, regions containing shells, and shells containing faces and edges. Shells which completely enclose a volume are considered to make up a solid brep.


Input Slots (optional)

brep-tolerance number

Overall tolerance for the created brep solid. Defaults to nil. Note that a value of nil indicates for SMLib to use value of 1.0e-05 of the longest diagonal length of the brep.


built-from gdl brep object

Defaults to nil. Specify this if you want this brep to be a clone of an existing brep. (note - this uses a shared underlying brep object, it does not make a copy)


color-decimal [from geometry-kernel-object-mixin] vector of three real numbers

The RGB color of this object as imported from an external format (e.g. IGES) or as specified in :display-controls. Defaults to the foreground color specified in *colors-default*. This message should not normally be overridden in user application code.


face-brep-colors list of color keywords

These indicate the colors for the breps produced by (the face-breps). If the number of face-breps exceeds the length of this list, the colors will be repeated in order. Defaults to a list with keys:

  • :green
  • :red
  • :blue
  • :purple-dark
  • :violet
  • :cyan.


hidden? [from vanilla-mixin*] boolean

Indicates whether the object should effectively be a hidden-object even if specified in :objects. Default is nil.


iges-level [from geometry-kernel-object-mixin] integer

Synonym for the layer.


image-file [from base-object] pathname or string

Points to a pre-existing image file to be displayed instead of actual geometry for this object. Defaults to nil


layer [from geometry-kernel-object-mixin] integer

The primary IGES-compatible level (layer) on which this object resides. Defaults to the first of the levels. This slot can be overridden in user code to specify a new layer which will be written out when this object is exported with the IGES output-format.


levels [from geometry-kernel-object-mixin] list of integers

The IGES-compatible levels (layers) on which this object resides. GDL does not currently support writing out multiple levels (layers) through the IGES writer ; only the first of these will be output if the object is exported with the IGES output-format (please contact Genworks if you need all levels (layers) to be written out).


obliqueness [from base-object] 3x3 orthonormal matrix of double-float numbers

This is synonymous with the orientation.


onclick-function [from base-object] lambda function of zero arguments, or nil

If non-nil, this function gets invoked when the user clicks the object in graphics front-ends which may or may not support this functionality (see viewport-html-div).


root [from vanilla-mixin*] gdl instance

The root-level node in this object's ``tree'' (instance hierarchy).


safe-children [from vanilla-mixin*] list of gdl instances

All objects from the :objects specification, including elements of sequences as flat lists. Any children which throw errors come back as a plist with error information


strings-for-display [from vanilla-mixin*] string or list of strings

Determines how the name of objects of this type will be printed in most places. This defaults to the name-for-display (generally the part's name as specified in its parent), followed by an index number if the part is an element of a sequence.


tessellation-parameters plist of keyword symbols and numbers

This controls tessellation for this brep. The keys are as follows:

  • :min-number-of-segments
  • :max-3d-edge-factor
  • :min-parametric-ratio
  • :max-chord-height
  • :max-angle-degrees
  • :min-3d-edge
  • :min-edge-ratio-uv
  • :max-aspect-ratio
and the defaults come from the following parameters:
   (list 
       :min-number-of-segments *tess-min-number-of-segments*
       :max-3d-edge-factor *tess-max-3d-edge-factor*
       :min-parametric-ratio *tess-min-parametric-ratio*
       :max-chord-height *tess-max-chord-height*
       :max-angle-degrees *tess-max-angle-degrees*
       :min-3d-edge *tess-min-3d-edge*
       :min-edge-ratio-uv *tess-min-edge-ratio-uv*
       :max-aspect-ratio *tess-max-aspect-ratio*)


visible-children [from vanilla-mixin*] list of gdl instances

Additional objects to display in Tatu tree. Typically this would be a subset of hidden-children. Defaults to NIL.



Input Slots (optional, settable)

density number

The density per unit volume of the brep. Defaults to 1


display-iso-curves-wireframe? boolean

Determines whether the isoparametric curves of each face of the brep are used for wireframe display. The default is T.


display-tessellation-lines-wireframe? boolean

Determines whether the tessellation grid-lines of the brep are used for wireframe display. The default is NIL.


isos plist with keys :n-u and :n-v

The number of isoparametric curves to be displayed in each direction. This value comes from the value of :isos on the display-controls if that exists, and defaults to *isos-default* otherwise.


max-3d-edge number

Used for tessellations. Computed from (the max-extent) and (the max-3d-edge-factor). WARNING: Modify this value at your peril. Small values can cause intractable tessellations. It is better to tweak max-3d-edge-factor to a small value like 0.1, as this will be taken relative to the max-extent of the brep.


max-3d-edge-factor number

Used for tessellations. Default comes from (the tessellation-parameters).


max-angle-degrees number

Used for tessellations. Default comes from (the tessellation-parameters).


max-aspect-ratio number

Used for tessellations. Default comes from (the tessellation-parameters).


max-chord-height number

Used for tessellations. Default comes from (the tessellation-parameters).


min-3d-edge number

Used for tessellations. Default comes from (the tessellation-parameters).


min-edge-ratio-uv number

Used for tessellations. Default comes from (the tessellation-parameters).


min-number-of-segments integer

Used for tessellations. Default comes from (the tessellation-parameters).


min-parametric-ratio number

Used for tessellations. Default comes from (the tessellation-parameters).


poly-brep-smooth-results? boolean

Smooth results for poly-brep? Defaults to t.



Input Slots (optional, defaulting)

center [from base-object] 3d point

Indicates in global coordinates where the center of the reference box of this object should be located.


display-controls [from base-object] plist

May contain keywords and values indicating display characteristics for this object. The following keywords are recognized currently:

:color
color keyword from the *color-table* parameter, or an HTML-style hexidecimal RGB string value, e.g. "#FFFFFF" for pure white. Defaults to :black.
:line-thickness
an integer, defaulting to 1, indicating relative line thickness for wireframe representations of this object.
:dash-pattern
(currently PDF/PNG/JPEG only). This is a list of two or three numbers which indicate the length, in pixels, of the dashes and blank spaces in a dashed line. The optional third number indicates how far into the line or curve to start the dash pattern.


height [from base-object] number

Z-axis dimension of the reference box. Defaults to zero.


length [from base-object] number

Y-axis dimension of the reference box. Defaults to zero.


orientation [from base-object] 3x3 matrix of double-float numbers

Indicates the absolute Rotation Matrix used to create the coordinate system of this object. This matrix is given in absolute terms (i.e. with respect to the root's orientation), and is generally created with the alignment function. It should be an orthonormal matrix, meaning each row is a vector with a magnitude of one (1.0).


width [from base-object] number

X-axis dimension of the reference box. Defaults to zero.



Computed Slots

adaptive-tolerance number

This is the actual tolerance stored in the SMLib object.


bounding-box [from base-object] list of two 3d points

The left front bottom and right rear top corners, in global coordinates, of the rectangular volume bounding the tree of geometric objects rooted at this object.


local-box [from base-object] list of two 3d points

The left front bottom and right rear top corners, in global coordinates, of the rectangular volume bounding this geometric object.


min-max-x-y-z

flag:
-- for debug testing only Plist with :min-x :max-x :min-y :max-y :min-z :max-z. Returns the extreme points of the bounding-box of the brep in each direction. This will be updated to return points on the brep itself, not necessarily the bounding box.

triangle-data list of plists, one for each face, format still being determined

. Contains triangle and connectivity data for the tessellation of this brep. Exact supported format will be documented here when ready.



Hidden Objects

composed-edges

The composed edges contained within this brep, this is valid just if the brep does not contain holes


edges-sequence sequence of gdl edge objects

The Edges contained within this brep aranged clockwise or anticlockwise, this is valid just if the brep does not contain holes


poly-brep polygonal brep object

This brep represented as a Polygonal Brep



Hidden Objects (sequence)

edges sequence of gdl edge objects

The Edges contained within this brep.


face-breps sequence of gdl brep objects

One brep for each face in the parent brep, containing only that face.


faces sequence of gdl face objects

The Faces contained within this brep.


regions sequence of gdl region objects

The Regions contained within this brep.


shells sequence of gdl shell objects

The Shells contained within this brep.


vertices sequence of gdl vertex objects

The Vertices contained within this brep.



GDL Functions

area number

Area covered by the faces of the brep.

keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

area-moments-of-inertia 3d vector (i

e. 3D Point). Returns the Area Moments of Inertia of the brep.

keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

area-products-of-inertia 3d vector (i

e. 3D Point). Returns the Area Products of Inertia of the brep.

keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

area-second-moment-about-coordinate-axii 3d vector (i

e. 3D Point). Returns the Area Second Moment About Coordinate Axii of the brep.

keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

area-static-moments 3d vector (i

e. 3D Point). Returns the Area Static Moments of the brep.

keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

brep-intersect? value nil or t

This function performs an intersection between this brep and another brep. The function returns a NIL value if no intersection is found and T if a intersection is found.

arguments:
other-brep GDL Brep
The brep with which to intersect
keyword arguments:
tolerance Number, Controls how precisely the intersection is computed, Default Value: (the adaptive-tolerance)
angle-tolerance Number, in radians, Default Value: (radians-to-degrees *angle-tolerance-radians-default*)
The angle tolerance for intersection

center-of-gravity 3d point

Center of gravity of the mass of the brep.

keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

in? boolean

Returns t or nil depending on whether the point given is within the boundary of the brep (including faces).

arguments:
point Point to check for

mass number

Mass represented by the brep, according to the density.

keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

moments plist

Returns the moments of the brep. The plist contains keys: :area-static-moments, :area-moments-of-inertia,

area-products-of-inertia:
:area-second-moment-about-coordinate-axii, :volume-static-moments,
volume-moments-of-inertia:
:volume-products-of-inertia, and :volume-second-moment-about-coordinate-axii.
keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

precise-properties multiple values: number, number, number, and plist

Returns the area, volume, mass, and moments for the brep. The moments are labeled as: :area-static-moments, :area-moments-of-inertia,

area-products-of-inertia:
:area-second-moment-about-coordinate-axii, :volume-static-moments,
volume-moments-of-inertia:
:volume-products-of-inertia, and :volume-second-moment-about-coordinate-axii.
keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

precise-properties-plist plist with keys: :area, :volume, :mass, :moments

Returns the area, volume, mass, and moments for the brep. The moments are labeled as: :area-static-moments, :area-moments-of-inertia,

area-products-of-inertia:
:area-second-moment-about-coordinate-axii, :volume-static-moments,
volume-moments-of-inertia:
:volume-products-of-inertia, and :volume-second-moment-about-coordinate-axii.
keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

properties plist with keys: :area, :volume, :barycenter

Returns the approximate area, volume, and barycenter (center of mass) for the brep. These are computed with tessellation techniques, which may be less precise than the analytic techniques used in precise-properties, but should be faster to compute and exhibit more stability.

keyword arguments:
edge-tess-tolerance Controls how precisely the properties are computed with respect to edge tessellation, Default Value: (the adaptive-tolerance)

tessellation plist or list

Contains tessellation data for the brep based on the values of the keyword args. This is used to produce the value of (the triangle-data).

keyword arguments:
min-number-of-segments nil, Default Value: (the min-number-of-segments)
max-3d-edge nil, Default Value: (the max-3d-edge)
min-parametric-ratio nil, Default Value: (the min-parametric-ratio)
max-chord-height nil, Default Value: (the max-chord-height)
max-angle-degrees nil, Default Value: (the max-angle-degrees)
min-3d-edge nil, Default Value: (the min-3d-edge)
min-edge-ratio-uv nil, Default Value: (the min-edge-ratio-uv)
max-aspect-ratio nil, Default Value: (the max-aspect-ratio)
in-memory? nil, Default Value: t

volume number

Volume enclosed by the brep.

keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

volume-moments-of-inertia 3d vector (i

e. 3D Point). Returns the Volume Moments of Inertia of the brep.

keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

volume-products-of-inertia 3d vector (i

e. 3D Point). Returns the Volume Products of Inertia of the brep.

keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

volume-second-moment-about-coordinate-axii 3d vector (i

e. 3D Point). Returns the Volume Second Moment about Coordinate Axii of the brep.

keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

volume-static-moments 3d vector (i

e. 3D Point). Returns the Volume Static Moments of the brep.

keyword arguments:
tolerance Controls how precisely the properties are computed, Default Value: (the adaptive-tolerance)

Package Documentation