MathGroup Archive 1999

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

Search the Archive

RE: planar polygon plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16429] RE: planar polygon plot
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Sat, 13 Mar 1999 02:21:43 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Richard Hsu wrote:
-------------

I want to plot a planar polygon in 3D with shading.
when the polygon is concave, the shading could be wrong.

For a simple example:

 Show[ Graphics3D[ Polygon[ { {0,0,0}, {1,0.5,0}, {2,0,0},
       {2,2,0}, {1,1.5,0}, {0,2,0} }  ]  ]  ];

I know what Mathematica is doing here, but want to know
if there is a easy way to get correct shading for general
3D planar polygons.

Thanks

------------------------

Is seems you will get want if the first point in the polygon is one of the
points that causes it to be a concave polygon.  Specifically either of the
following works for me. 


In[1]:=
Show[ Graphics3D[{Polygon[ { {1,1.5,0}, {0,2,0},{0,0,0} ,{1,0.5,0},
				{2,0,0},{2,2,0}
				} ]
  }]  ];

(* Graphic not shown *)



In[2]:=
Show[ Graphics3D[{Polygon[ {{1,0.5,0}, {2,0,0},
       {2,2,0}, {1,1.5,0}, {0,2,0},{0,0,0} } ]
  }]  ];

(* Graphic not shown *)


---------------------
I don't understand why you should have to worry about this.

It looks like you need to come up with a clever algorithm that will arrange
the points in an appropriate order for a general polygon.  I don't have time
for that right now, but I may post a solution in a week or so.

--------------------
Regards,
Ted Ersek


  • Prev by Date: the simplest way ...?
  • Next by Date: creating a frontend
  • Previous by thread: Re: the simplest way ...?
  • Next by thread: Re: planar polygon plot