Package Documentation

Object: boxed-surface (The :surf Package)
Mixins: b-spline-surface

Description

This object behaves as a hybrid of a surface and a normal box. You pass in a surface-in, and it essentially traps the surface in a box, which will respond to normal GDL :center and :orientation. You can also pass a scale, or scale-x, or scale-y, or scale-z as with a transformed-surface.


Input Slots (required)

surface-in gdl surface object

This can be any type of surface, e.g. b-spline-surface, fitted-surface, or an edge from a solid brep. Note that the reference-box of this surface (i.e. its center and orientation) will have an effect on the resulting boxed-surface. If you want to consider the incoming surface-in as being in global space, then make sure its center is (0 0 0) and its orientation is nil or equivalent to geom-base::+identity-3x3+



Input Slots (optional)

brep-tolerance [from surface] number

Overall tolerance for the internal brep representation of this surface. Defaults to nil. Note that a value of nil indicates for SMLib a value of 1.0e-05 of the longest diagonal length of the brep.


built-from [from surface] gdl surface

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


center 3d point in global space

You can pass in a new center for the surface's reference box, which will move the whole box including the surface. This defaults to the orientation-center (if given), otherwise to the (the surface-in center).


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.


end-caps-on-brep? [from surface] boolean

Indicates whether to attempt automatic endcaps on conversion of this surface to a brep. Note that this might change in future to a keyword value for :min, :max, or :both to provide more control.


from-center 3d point in global space

The center with respect to which this object should be positioned. Normally this should not be specified by user code, unless you know what you are doing [e.g. to override the center of a surface-in which is meaningless and force it to be interpreted as a surface in global space, you could specify this as (the center) when passing it in from the parent]. Default is (the surface-in orientation).


from-object gdl object which mixes in base-object

The current boxed-surface will be positioned and oriented with respect to the center and orientation of this object. The default is (the surface-in).


from-orientation 3x3 transformation matrix

The orientation with respect to which this object should be oriented. Normally this should not be specified by user code, unless you know what you are doing [e.g. to override the orientation of a surface-in which is meaningless and force it to be interpreted as a surface in the parent's coordinate system, you could specify this as (the orientation) when passing it in from the parent]. Default is (the surface-in orientation).


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


orientation 3x3 transformation matrix

This will be the new orientation for the box and the contained surface. Default is (the surface-in orientation) -- i.e. identical orientation with the provided surface-in.


orientation-center 3d point in global space

If you provide this, the surface's reference box will be moved to have its center at this point, before any orientation is applied. This will become the new center of the resulting boxed-surface, unless you explicitly pass in a different center. Default is nil.


rational? [from surface] boolean

Returns non-nil iff this surface is rational, i.e. all weights are not 1.


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


scale number

The overall scale factor for X, Y, and Z, if no individual scales are specified. Defaults to 1.


scale-x number

The scale factor for X. Defaults to 1.


scale-y number

The scale factor for Y. Defaults to 1.


scale-z number

The scale factor for Z. Defaults to 1.


sew-and-orient-brep? [from surface] boolean

Indicates whether brep representation should undergo a sew-and-orient operation. Defaults to nil.


show-box? boolean

This determines whether the reference box is displayed along with the surface. Default is nil.


show-control-polygon? boolean

This determines whether the control polygon is displayed along with the surface. Default is t (will be changed to nil).


show-tight-box? boolean

This determines whether the tight box is displayed along with the surface. Default is nil.


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 [from surface] plist of keyword symbols and numbers

This controls tessellation for the brep of this surface. 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*)


tolerance [from surface] number

Approximation tolerance for display purposes.


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, defaulting)

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.


isos [from surface] 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.



Computed Slots

control-points [from b-spline-surface] list of lists of 3d points

The control net.


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.


u-degree [from b-spline-surface] integer

Degree of surface in U direction. Defaults to 3.


u-knot-vector [from b-spline-surface] list of numbers

Knots in U direction. Default is NIL, which indicates a uniform knot vector in U direction.


v-degree [from b-spline-surface] integer

Degree of surface in V direction. Defaults to 3.


v-knot-vector [from b-spline-surface] list of numbers

Knots in V direction. Default is NIL, which indicates a uniform knot vector in V direction.


weights [from b-spline-surface] list of lists of numbers

A weight to match each control point. Should be congruent with control-points (i.e. same number of rows and columns). Default is a value of 1.0 for each weight, resulting in a nonrational surface.


width [from base-object] number

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


Examples


 (define-object boxed-surfaces-test (base-object)

   ;;bounding-box-from-points gives errors  
  
   :objects
   ((b-spline :type 'test-b-spline-surface)
   
    (boxed :type 'boxed-surface
           :surface-in (the b-spline))
   
    (translated :type 'boxed-surface
                :surface-in (the b-spline)
                :center (translate (the center) :left 15))
   
    (twisted :type 'boxed-surface
             :surface-in (the boxed)
             :orientation 
             (alignment :left (the (face-normal-vector :top))
                        :rear (rotate-vector-d (the (face-normal-vector :rear))
                                               30
                                               (the (face-normal-vector :top)))))
    (rotated :type 'boxed-surface
             :surface-in (the b-spline)
             :display-controls (list :color :purple)
             :orientation 
             (alignment :left 
                        (rotate-vector-d (the (face-normal-vector :left))
                                         50
                                         (the (face-normal-vector :rear)))))
    
    (rotated-about :type 'boxed-surface
                   :surface-in (the b-spline)
                   :display-controls (list :color :purple)
                   :orientation-center (translate (the center) :right 2.5)
                   ;;:center (translate (the center) :up 5)
                   :orientation 
                   (alignment :left 
                              (rotate-vector-d (the (face-normal-vector :left))
                                               45
                                               (the (face-normal-vector :rear)))))
    
    (moved-up :type 'boxed-surface
              :surface-in (the rotated-about)
              :center (translate (the rotated-about center) 
                                 :up 7
                                 :left 5))
   
    (straightened :type 'boxed-surface
                  :surface-in (the moved-up)
                  :orientation 
                  (alignment :left 
                             (rotate-vector-d 
                              (the-child surface-in (face-normal-vector :left))
                              45
                              (the-child surface-in (face-normal-vector :rear)))
                             :rear (the-child surface-in (face-normal-vector 
                                                          :rear))))

    (rotated-straightened :type 'boxed-surface
                          :surface-in (the straightened)
                          :orientation (the moved-up orientation)
                          :orientation-center 
                          (translate (the-child surface-in center)  :up 2.5))
  
    (rotated-straightened-moved :type 'boxed-surface
                                :surface-in (the rotated-straightened)
                                :center (translate (the-child surface-in center)
                                                   :right 5))

    (center-sphere :type 'sphere 
                   :radius 0.3 
                   :center (the moved-up-and-straightened orientation-center))
      
    (moved-up-and-straightened 
     :type 'boxed-surface
     :surface-in (the straightened)
     :center (translate (the-child orientation-center) :right 7)
     :orientation 
     (alignment :left (the-child surface-in (face-normal-vector :rear))
                :front
                (rotate-vector-d 
                 (the-child surface-in (face-normal-vector :left))
                 45
                 (the-child surface-in (face-normal-vector :rear))))
     :orientation-center (translate (the straightened center) :up 2.5))
 
    (moved-up-and-straightened-1
     :type 'boxed-surface
     :surface-in (the straightened)
     :center (translate (the-child surface-in center) :right 14)
     :orientation (the rotated-straightened orientation)
     :orientation-center (translate (the straightened center) :up 2.5))
    
    (moved-up-and-straightened-2 
     :type 'boxed-surface
     :surface-in (the straightened)
     :center (translate (the-child surface-in center) :right 21)
     :orientation (the rotated-straightened orientation)
     :orientation-center (translate (the straightened center) :up 2.5))
    
    (transformed :type 'boxed-surface
                 :surface-in (the b-spline)
                 :center (translate (the center) :left 50)
                 :orientation 
                 (alignment :rear 
                            (rotate-vector-d (the (face-normal-vector :rear))
                                             30
                                             (the (face-normal-vector :right)))))))
 

Package Documentation