Re: Clipping Live3DGraphics
- To: mathgroup at smc.vnet.net
- Subject: [mg76800] Re: Clipping Live3DGraphics
- From: Szabolcs <szhorvat at gmail.com>
- Date: Sun, 27 May 2007 05:07:07 -0400 (EDT)
- Organization: University of Bergen
- References: <f38rcq$i3b$1@smc.vnet.net>
chuck009 wrote:
> My understanding is that Live3DGrahics won't clip the plot to the plot range. Sometimes it's nice to be able to do this. The following code will clip a Graphics3D object to the specified inequality passed to ClipGraphics3D.
>
> For example, suppose I create:
>
> plot1=Graphics3D[Plot[Exp[x^2+y^2],{x,0,3},{x,0,3}],PlotRange->{{0,1},{0,1},{0,1}},AspectRatio->1,BoxRatios->{1,1,1}];
>
> If I pass plot1 to Live3DGraphics, it will plot everything. Suppose though I only wish to view the clipped plot with Abs[z]<=1. I enter:
>
> clipped=Fold[ClipGraphics3D,plot1,{z<=1,z>=-1}];
>
> then pass clipped to the Live applet.
>
> Is there an easier way to do this?
>
If you only need to clip to the PlotRange (and do not care about more
general clipping regions), then another solution is to use
PolygonIntersections -> False
Example:
<< Graphics`Polyhedra`
g = Show[Stellate@Polyhedron[Icosahedron], PlotRange -> {-1, 1}]
h = Show[g, PolygonIntersections -> False]
Now you can use h with LiveGraphics3D.
You can use this option to break up intersecting polygons too!
Szabolcs
P.S. You may find this article interesting:
http://www.mathematica-journal.com/issue/v8i4/features/helzer/index.html