Re: Smarter 3D listplot clipping

*To*: mathgroup at smc.vnet.net*Subject*: [mg15963] Re: Smarter 3D listplot clipping*From*: Martin Kraus <mkraus at theorie3.physik.uni-erlangen.de>*Date*: Fri, 19 Feb 1999 03:26:52 -0500*Organization*: Regionales Rechenzentrum Erlangen, Germany*References*: <7ag4ib$b0i@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Dan Truong wrote: > > In Short: > A question for Graphics3D/ListPlot3D knowledgeable people... > I want the Ideal clipping below, not regular > mathematica clipping. > > > Before: > > ___ > > __/\__\ > > \_\/ > > > > Regular Clipping: > > ___ > > /\__\ > > \/ > > > > Ideal: (how to do that?) > > ___ > > \__\ > > I do not think that this is ideal. For each clipped point you have to delete 4 polygons. Thus, the holes in your plot will be pretty large. > Work setting: > I have to display 3D plots for non square arrays. Then the function ListSurfacePlot3D from the Graphics`Graphics3D` package would be more appropriated. (See my adaption of Tom Wickham-Jones tutorial at: http://theorie3.physik.uni-erlangen.de/~mkraus/tutorial/tutorial2_3.html) > I use a square array, but zero values are meaningless. > When I plot the curve however zero values change the > look of the curve (making it harder to read). > I want to clip-out zero samples ideally: Zero samples > should not change the curves. Regular clipping however > clip the curve when it reaches zero, which means the > drop (see Reg. figure) is visible, clipping only the flat > zero values (Before figure). I don't want the drops towards > clipped regions drawn at all (3rd fig). > Note: I am stacking multiple ListPlot3D in the same figure > (that's why erratic drops bug me, since the surfaces > do not have any reason to cross), so the ListPlots are > already converted to Graphics3D. I also use the neat colorization > scheme given by jtischer on the forum a couple of weeks ago. > > Has someone found a solution to this problem? > > Would it be possible in Graphics3D to search for all polygons > with a corner having z < clipped region, and to remove those? > (I expect it to be harder to do while in ListPlot format (?) ) > If so, how could this be done (ie enumerate all polygons in a > Graphics3D object and delete those we wish), Here we go: array=Table[If[Random[]>0.1,Sin[i/2.]*Cos[j/2.]+1,0],{i,1,20},{j,1,20}]; (* generates a table of values with "holes" *) polys=Table[ Polygon[{{j,i,array[[i,j]]},{j,i+1,array[[i+1,j]]},{j+1,i+1, array[[i+1,j+1]]},{j+1,i,array[[i,j+1]]}}],{i,1,Length[array]-1},{j, 1,Length[array[[1]]]-1}]; (* generates the list of polygons *) clippedpolys= DeleteCases[polys,Polygon[l_List]/;Count[l,{_,_,z_/;(z<=0.)}]>0,2]; (* deletes the polygons which include points with z <= 0. *) Show[Graphics3D[clippedpolys]]; (* shows the rest of the polygons *) > and could it be implemented as a function like: > > clippedFig3D = True3DClip[fig3D]; > Show[clippedFig3D]; > > Dan- Sure, that could be done! ;) Hope that helps Martin Kraus