Re: Cropping a surface to a sphere

• To: mathgroup at smc.vnet.net
• Subject: [mg88246] Re: Cropping a surface to a sphere
• From: Szabolcs Horvát <szhorvat at gmail.com>
• Date: Tue, 29 Apr 2008 06:51:01 -0400 (EDT)
• Organization: University of Bergen
• References: <fv1ff5\$es6\$1@smc.vnet.net> <fv42fb\$5q4\$1@smc.vnet.net>

```David Park wrote:
>
> Here is a second version of the surface cropped to a sphere using a number
> of options.
>
> ContourPlot3D[-x^4 y^2 + x^2 y^4 + x^4 z^2 - y^4 z^2 - x^2 z^4 +
>    y^2 z^4 == 1, {x, -3, 3}, {y, -3, 3}, {z, -3, 3},
>  RegionFunction -> Function[{x, y, z, f}, x^2 + y^2 + z^2 <= 9],
>  ContourStyle -> {FaceForm[ColorData["Legacy"]["DarkSeaGreen"],
>     GrayLevel[.7]]},
>  PlotPoints -> 25,
>  Mesh -> False,
>
>  (* Use white lights instead of colored lights *)
>  Lighting -> "Neutral",
>  Axes -> False,
>  Boxed -> False,
>
>  (* The following options provide a smooth rotation with the mouse *)
>  SphericalRegion -> True,
>  RotationAction -> Clip,
>
>  (* The following option causes the plot to fill the viewing area *)
>  PlotRegion -> {{-.3, 1.3}, {-.3, 1.3}},
>  Background -> ColorData["Legacy"]["LightBeige"],
>  ImageSize -> 500]
>
> It's not clear that we need the bounding box or the axes. We might just say
> it is the surface out to a radius of 3. The colored lights add nothing to
> the plot. They only introduce confusion so we use Neutral lighting. We then
> use the ContourStyle option to give different colors to the inside and
> outside of the surface.  If you don't like the image jumping around when you
> use the mouse to rotate, you can use the SphericalRegion and RotationAction
> options. The PlotRegion option gives us an initial view such that the object
> fills the viewing area. You can also use the mouse zoom function to control
> this. Then we use a Background to tone down the plot and ImageSize to
> control the initial size. There are many other options that might be used.
>
> I hope you will agree that this is a much better presentation of the surface
> than my previous reply without all the options.

This looks very nice indeed---thank you for this demonstration of how to
make great looking graphics!

and sorry for not paying attention to the obviously outstanding option
RegionFunction ...

```

• Prev by Date: Re: Question about OneIdentity
• Next by Date: Re: Common Multiple Value Question
• Previous by thread: Re: Cropping a surface to a sphere
• Next by thread: delayed function assignment