Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

rendering with Polygon vs. Cuboid

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27316] rendering with Polygon vs. Cuboid
  • From: pinhead at sonic.net (Matthias Schabel)
  • Date: Tue, 20 Feb 2001 03:05:25 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

With the proviso that the code is cludgy and that I'm not really
proficient in Mathematica, I'm curious to know why the call to
boxCuboid and the call to boxCube don't render the same way - the
former gives me what I expect, while the latter is truncated along 
the y-axis.  Since RotateShape doesn't allow me to operate on the
Cuboid primitives, I obviously would like the polygon representation 
to work.  BTW, the overall objective here is to be able to create
groups of polygons representing an object and then render multiple 
copies of the same object with differing orientations using
RotateShape, TranslateShape, etc...

Thanks in advance for any advice...

Matthias

Notebook[{
Cell[BoxData[
    \(<< Graphics`Shapes`\)], "Input",
  InitializationCell->True],

Cell[BoxData[
    \(\(cube[start_, 
          end_] := {Polygon[{{start[\([1]\)], start[\([2]\)], 
                start[\([3]\)]}, {end[\([1]\)], start[\([2]\)], 
                start[\([3]\)]}, {end[\([1]\)], end[\([2]\)], 
                start[\([3]\)]}, {start[\([1]\)], end[\([2]\)], 
                start[\([3]\)]}}], 
          Polygon[{{start[\([1]\)], start[\([2]\)], 
                end[\([3]\)]}, {end[\([1]\)], start[\([2]\)], 
                end[\([3]\)]}, {end[\([1]\)], end[\([2]\)], 
                end[\([3]\)]}, {start[\([1]\)], end[\([2]\)], 
                end[\([3]\)]}}], 
          Polygon[{{start[\([1]\)], start[\([2]\)], 
                start[\([3]\)]}, {start[\([1]\)], end[\([2]\)], 
                start[\([3]\)]}, {start[\([1]\)], end[\([2]\)], 
                end[\([3]\)]}, {start[\([1]\)], start[\([2]\)], 
                end[\([3]\)]}}], 
          Polygon[{{end[\([1]\)], start[\([2]\)], 
                start[\([3]\)]}, {end[\([1]\)], end[\([2]\)], 
                start[\([3]\)]}, {end[\([1]\)], end[\([2]\)], 
                end[\([3]\)]}, {end[\([1]\)], start[\([2]\)], 
                end[\([3]\)]}}], 
          Polygon[{{start[\([1]\)], start[\([2]\)], 
                start[\([3]\)]}, {end[\([1]\)], start[\([2]\)], 
                start[\([3]\)]}, {end[\([1]\)], start[\([2]\)], 
                end[\([3]\)]}, {start[\([1]\)], start[\([2]\)], 
                end[\([3]\)]}}], 
          Polygon[{{start[\([1]\)], end[\([2]\)], 
                start[\([3]\)]}, {end[\([1]\)], end[\([2]\)], 
                start[\([3]\)]}, {end[\([1]\)], end[\([2]\)], 
                end[\([3]\)]}, {start[\([1]\)], end[\([2]\)], 
                end[\([3]\)]}}]};\)\)], "Input",
  InitializationCell->True],

Cell[BoxData[{
    \(frameCuboid[x_, y_, z_, dx_, dy_, dz_] := 
      Cuboid[{x, y, z}, {x + dx, y + dy, z + dz}]\),
"\[IndentingNewLine]", 
    \(frameCube[x_, y_, z_, dx_, dy_, 
        dz_] := \[IndentingNewLine]cube[{x, y, z}, {x + dx, y + dy, 
          z + dz}]\)}], "Input"],

Cell[BoxData[{
    \(\(boxCuboid[x_, y_, z_] := {frameCuboid[x, y, z, 36, 24,
30.175], 
          frameCuboid[x + 1, y - 1, z + 1, 17, 2, 22], 
          frameCuboid[x + 1, y - 1, z + 23, 17, 2, 6], 
          frameCuboid[x + 18, y - 1, z + 1, 17, 2, 22], 
          frameCuboid[x + 18, y - 1, z + 23, 17, 2, 6]};\)\), "\n", 
    \(Show[Graphics3D[boxCuboid[0, 0, 0]]]\)}], "Input"],

Cell[BoxData[{
    \(\(boxCube[x_, y_, z_] := {frameCube[x, y, z, 36, 24, 30.175], 
          frameCube[x + 1, y - 1, z + 1, 17, 2, 22], 
          frameCube[x + 1, y - 1, z + 23, 17, 2, 6], 
          frameCube[x + 18, y - 1, z + 1, 17, 2, 22], 
          frameCube[x + 18, y - 1, z + 23, 17, 2, 6]};\)\), "\n", 
    \(Show[Graphics3D[boxCube[0, 0, 0]]]\)}], "Input"]
},
FrontEndVersion->"4.0 for Microsoft Windows",
ScreenRectangle->{{0, 1024}, {0, 695}},
WindowSize->{496, 599},
WindowMargins->{{18, Automatic}, {Automatic, 23}}
]


  • Prev by Date: Re: Two Y-Axes
  • Next by Date: UnitStep[] Problem.
  • Previous by thread: Re: Two Y-Axes
  • Next by thread: UnitStep[] Problem.