Editing SGI Cube

From BRL-CAD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
[[category:tutorials]]
 
 
 
{|align="right"
 
{|align="right"
  |[[Image:Sgi_cube.png|thumb|256px|SGI Cube logo modeled and rendered in BRL-CAD]]
+
  |[[Image:Original_SGI_cube.png|thumb|left|64px|Original SGI cube logo]]
 
  |}
 
  |}
 +
 
Included below is an example shell script that uses BRL-CAD tools to procedurally create and render the SGI Cube (tm) logo.  The script sets up functions that create spheres (SPHs)  and cylinders (RCCs) going back and forth in various directions, creating the corresponding geometry for each of those directions.  All of the SPHs and RCCs are then combined via a Constructive Solid Geometry (CSG) union operation and material properties are set on the object.  The script then sets the orientation of a view that matches the original SGI logo and renders to a PNG image file.
 
Included below is an example shell script that uses BRL-CAD tools to procedurally create and render the SGI Cube (tm) logo.  The script sets up functions that create spheres (SPHs)  and cylinders (RCCs) going back and forth in various directions, creating the corresponding geometry for each of those directions.  All of the SPHs and RCCs are then combined via a Constructive Solid Geometry (CSG) union operation and material properties are set on the object.  The script then sets the orientation of a view that matches the original SGI logo and renders to a PNG image file.
  
<br style="clear: both" />
+
<center>
{|align="right"
+
{|align="left"
  |[[Image:Original_SGI_cube.png|thumb|left|64px|Original SGI cube logo]]
+
  |[[Image:Sgi_cube.png|thumb|256px|SGI Cube logo modeled and rendered in BRL-CAD]]
 
  |}
 
  |}
 +
</center>
 +
 
=Scripting MGED=
 
=Scripting MGED=
 
BRL-CAD's solid modeling editor, MGED, will run any non-modal modeling command provided after the name of the geometry database on the command line.  The "-c" option tells MGED to run in classic console mode.  MGED will also run a series of commands piped in or redirected to it via standard input.  This makes scripting MGED in just about any language rather straightforward.  While this example uses a shell script, it could have just as easily have been written in another programming language.  BRL-CAD provides a C API to most of the  geometry creation routines via BRL-CAD's libwdb "write database" library and BRL-CAD's librt ray-trace library.
 
BRL-CAD's solid modeling editor, MGED, will run any non-modal modeling command provided after the name of the geometry database on the command line.  The "-c" option tells MGED to run in classic console mode.  MGED will also run a series of commands piped in or redirected to it via standard input.  This makes scripting MGED in just about any language rather straightforward.  While this example uses a shell script, it could have just as easily have been written in another programming language.  BRL-CAD provides a C API to most of the  geometry creation routines via BRL-CAD's libwdb "write database" library and BRL-CAD's librt ray-trace library.
Line 131: Line 132:
 
</pre>
 
</pre>
 
  |}
 
  |}
<br style="clear: both" />
+
This script is available for download from [http://brlcad.svn.sourceforge.net/viewvc/*checkout*/brlcad/brlcad/trunk/src/proc-db/sgi.sh?content-type=text%2Fplain '''here'''].
This script is available for download from [https://sourceforge.net/p/brlcad/code/HEAD/tree/brlcad/trunk/src/proc-db/sgi.sh '''here'''].
 
  
 
The SGI Cube logo is a registered trademark of SGI.
 
The SGI Cube logo is a registered trademark of SGI.

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)