Design Scripting Documentation
     
 
     
  Bounds Scale  
     
     
  Inputs:  
     
a bounding box and a scale factor
     
  Outputs:  
     
a scaled bounding box
     
  Implementation
01  function bounds_scale( bounds, factor )
02    dim min: min = bounds( BOUNDS_MIN )
03    dim max: max = bounds( BOUNDS_MAX )
04    dim cnt: cnt = vertex_middle( min, max )
05    bounds_scale = bounds_new( _
06      vertex_new( _
07        ( min( VERTEX_X ) - cnt( VERTEX_X ) ) * factor + cnt( VERTEX_X ), _
08        ( min( VERTEX_Y ) - cnt( VERTEX_Y ) ) * factor + cnt( VERTEX_Y ), _
09        ( min( VERTEX_Z ) - cnt( VERTEX_Z ) ) * factor + cnt( VERTEX_Z )  _
10      ), _
11      vertex_new( _
12        ( max( VERTEX_X ) - cnt( VERTEX_X ) ) * factor + cnt( VERTEX_X ), _
13        ( max( VERTEX_Y ) - cnt( VERTEX_Y ) ) * factor + cnt( VERTEX_Y ), _
14        ( max( VERTEX_Z ) - cnt( VERTEX_Z ) ) * factor + cnt( VERTEX_Z )  _
15      )  _
16    )
17  end function
 
     

Creative Commons License
The Design Scripting Library, including its sources, online documentation and graphics, are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

Online Documentation generated by { vbdoclib } version 1.0
Color-Coding generated by { vbcc } version 2.0
Page timestamp: { Feb. 2, 2006 }





 
     
     
 
Documentation
Cover Page
Expand
Collapse
 
Array
 
Bitmap File
 
Bounding Box
 
Color
 
Container
 
Doclet
 
Ellipse
 
Intersection
 
Language
 
Map
 
Matrix
 
Number
 
Nurbs
 
Range
 
STL File
 
Streams
 
String
 
Surface
 
Text File
 
Triangle
 
Vector
 
Vertex
 
Wave File