MathGroup Archive 2004

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

Search the Archive

Re: Re: Conditinal Plots

  • To: mathgroup at smc.vnet.net
  • Subject: [mg51122] Re: [mg51037] Re: Conditinal Plots
  • From: Garry Helzer <gah at math.umd.edu>
  • Date: Tue, 5 Oct 2004 04:37:10 -0400 (EDT)
  • References: <opjsr38bywkq@legacy> <200410020718.DAA26337@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I missed the original posting by philippe so I don't know the precise 
question or philippe's email address.

Clipping a graphic to one side of a plane is a basic computational 
geometry task but it is considered rather low level and Mathematica has 
no user level function that will do the clipping.  With such a function 
one could plot the graphic over a sufficiently large domain and then 
clip by the vertical planes over the polygon edges.

The lecture notes on Geometry for Computer Graphics at

http://www.math.umd.edu/~gah/

contain an algorithm for such clipping  which is implemented in the 
accompanying package Peano.m. However the implementation is for show 
rather than go?and slow. Further, the mathematics used is not widely 
known and some study of the lecture notes would be necessary before the 
function could be used with confidence (the trivector defining the 
plane is one of the arguments).

The more general question of clipping  a graphic at a surface is 
addressed in the article "Clipping Polygons" in The Mathematica 
Journal, volume 8, number 4. That article contains an illustration of a 
surface ( a monkey saddle) plotted over a rectangle, then clipped by 
the cylinder over the circle x^2+y^2=1. Unfortunately, when the issue 
is downloaded the package with the clipping function is not included. 
The package works under version 4 but needs modification to work under 
version 5 because of a syntax change to the function FindRoot. I intend 
to produce a version 5 form of the package but will not be able to do 
so for several months.

On Oct 2, 2004, at 3:18 AM, philippe wrote:

> If you really want to trim your plot with a cylinder you can try to
> adapt the principle which is present in the "SurfaceColor" example in
> the help browser.
> To get the line drawn on the surface, first convert your plot to a
> generic graphics (Graphics[....]), then type %//InputForm.
> You will have the internal structure of the graphic. Then, with
> replacement rules, you can keep only the part you are interested in.
> You can try something like that.
>
>
>
> On 3 Sep 04 11:04:27 -0400 (EDT), matt wrote:
>> Dear all,
>>
>> Í´m trying to produce a 3D plot with a 2D ploygon (within unit
> circle)
>> as its base. Equivalently, I want my 3D surface to sit inside (be
>> bounded by) a cylinder with n-gon cross section.
>>
>> How can I trim off the edges?
>> I´ve tried to use
>> If[ (condition), Plot, Blah] but it doesn´t seem to work.....
>
>
Garry Helzer
gah at math.umd.edu


  • Prev by Date: Re: Re: Derivatives of user-defined control-flow functions
  • Next by Date: Newbie facing $RecursionLimit and Stack Space on OSX
  • Previous by thread: Re: Conditinal Plots
  • Next by thread: Re: Re: Re: Conditinal Plots