3
$\begingroup$

I'm trying to use SphericalPlot3D to create some images of a surface but I get some rough edges on the surface around the boundary. However, after rotating the image slightly these anomalies go away.

I'd like to find a way to create smooth images without rotating the picture manually. There's also a strange spot at my poles which is also problematic but seems more inevitable. I've tried numerous settings and automatically rotating the image but nothing seems to help with these edge distortions.

Here's my code for the top view of this surface:

a = 5;

b = 3;

\[Epsilon] = .75 - .5*Log[a]/Log[10];

freq[n_] = Sqrt[n (n - 1) (n + 2)];

t = \[Pi]/(2*freq[a]);

r1[\[Theta]_, \[Phi]_] = (1 + \[Epsilon]*Sin[t*freq[a]]*
     SphericalHarmonicY[a, b, \[Phi], \[Theta]]);

SphericalPlot3D[
 Re[r1[\[Theta] + \[Pi], \[Phi]]], {\[Phi], -\[Pi]/2, \[Pi]/
   2}, {\[Theta], 0, \[Pi]}, Mesh -> False, 
 ViewPoint -> {0, 0, Infinity}, Boxed -> False, Axes -> False, 
 Lighting -> {{"Spot", {Gray, 
     Specularity[1]}, {{.5, .5, 4}, {.5, .5, 0}}, \[Pi]/
     100}, {"Spot", {Gray, 
     Specularity[1]}, {{.5, .25, 4}, {.5, .25, 0}}, \[Pi]/
     150}, {"Spot", {Gray, 
     Specularity[1]}, {{.25, .5, 4}, {.25, .5, 0}}, \[Pi]/
     150}, {"Directional", Gray, {10, 10, 20}}}, 
 PlotStyle -> Specularity[1], PreserveImageOptions -> False]

Mathematica graphics

$\endgroup$
1
  • $\begingroup$ I've added the result I got when ran your code to your question. $\endgroup$ Jul 18, 2012 at 19:38

1 Answer 1

4
$\begingroup$

If you do

sp = SphericalPlot3D[...]

AbsoluteOptions@sp

You get

ViewPoint::nlist3: {0,0,[Infinity]} is not a list of three numbers. >>

So, there is a problem with Infinity there. Change it for a big number and the roughness goes away.

enter image description here

$\endgroup$
2
  • $\begingroup$ That's great, thanks. I really should have thought to try that myself. $\endgroup$ Jul 18, 2012 at 20:28
  • 1
    $\begingroup$ Or use ViewPoint -> Above. $\endgroup$ Jul 18, 2012 at 22:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.