next up previous contents
Next: -geofunction: Analytic description Up: Geometric primitives Previous: -gbor: A general body   Contents

-stlfile: CAD import via STL-file

This section is for importing a geometry description from a CAD system1.2 via a STL-file (STereo-Lithography). A STL-file describes a closed body via a set of triangles.

The so described body can be rotated, shrunk or expanded and shifted.

 ##############################################################################
 # Flags: nomenu, noprompt, nomessage,                                        #
 ##############################################################################
 # section -stlfile                                                           #
 ##############################################################################
 # file= /usr/local/gd1/examples/woman.stl                                    #
 # material  =  1                                                             #
 # whichcells= all, taboo= none, nboundaries=  1                              #
 # originprime    = ( 0.0, 0.0, 0.0 )                                         #
 # xprimedirection= ( 1.0, 0.0, 0.0 )                                         #
 # yprimedirection= ( 0.0, 1.0, 0.0 )                                         #
 # xscale = 1.0                                                               #
 # yscale = 1.0                                                               #
 # zscale = 1.0                                                               #
 # debend = no                          -- debend description around uaxis    #
 #    uaxis= z                          -- [xyz] : direction of debend-axis   #
 #    radius= 0.0                                                             #
 #    v0    = 0.0                       -- v0,w0: coordinates of the axis.    #
 #    w0    = 0.0                                                             #
 # show   = no                          -- ( yes | no )                       #
 ##############################################################################
 # doit, return, help                                                         #
 ##############################################################################


Example
 # /usr/local/gd1/examples-from-the-manual/stl-example.gdf

 -mesh
    volume= ( -0.4,0.4, -0.4,0.4, -0.4,0.35 )
    spacing= 0.5/70

 -stlfile
    material= 34
    file= /usr/local/gd1/examples/brain.stl
 define(SCALE, 0.1)
       xscale= SCALE, yscale= SCALE, zscale= SCALE
       origin= ( 0, 0, -2.2 )
       xprimedirection= ( 1, 1, 0 ), yprimedirection= ( 0, 0, 1 )
    doit

 -volumeplot
    scale= 3
    doit
Figure 1.13: A discretisation of a brain, imported as a STL-file.
\begin{figure}\centerline{
\psfig{figure=stl-example.ps,width=18cm,bbllx=-2pt,bblly=-2pt,bburx=760pt,bbury=552pt,clip=}
}\end{figure}


Example

 # /usr/local/gd1/examples-from-the-manual/stl-example2.gdf

 -mesh
     spacing= 2.2
 perfectmesh= yes
     volume= ( 0,200, 0,130, -200,0 )

 -stlfile
     file= /usr/local/gd1/examples/wagner60kASTL.stl
     xprime= ( 1, 0, 0 )
     yprime= ( 0, 0, -1 )
     material= 1, taboo= none
     show= yes,
     doit

 -volumeplot, scale= 2.5, eyepos= ( 1, 2, 0.5), doit
Figure 1.14: A discretisation of a Wagner bust, described as a STL-file.
\begin{figure}\centerline{
\psfig{figure=stl-example2.ps,width=18cm,bbllx=-2pt,bblly=-2pt,bburx=760pt,bbury=552pt,clip=}
}\end{figure}



Footnotes

... system1.2
AutoCAD can export its data as a STL-file. The command is 'stlout'.

next up previous contents
Next: -geofunction: Analytic description Up: Geometric primitives Previous: -gbor: A general body   Contents