Using SphericalPlot3D, I find I get two types of artifact:

  1. A discontinuity in the surface reflectance at $\theta=0,2\pi$
  2. Little edges, or perhaps gaps between faces, showing in some regions — this depends very much on the angle that the object is viewed from. If you run the code below, it might not show it without some rotation.

They can both be seen in this


How do I get rid of them?

Here's the code to reproduce the problem.

GreatCircleDistance[a_, b_] := ArcCos[(a.b)/(Norm[a, 2] Norm[b, 2])]

SphereToCart[{r_, ϕ_, θ_}] = r {Cos[θ] Sin[ϕ], Sin[θ] Sin[ϕ], Cos[ϕ]}

TotalDistance[θ_, ϕ_] := 
  3 + 
    Plus @@ 
      (Exp[-10 GreatCircleDistance[SphereToCart[{1, θ, ϕ}], #]^2] & /@
        (PolyhedronData["Icosahedron", "VertexCoordinates"] // N))

SphericalPlot3D[TotalDistance[θ, ϕ], {θ, 0, π}, {ϕ, 0, 2 π}, 
  PlotStyle -> Directive[Orange, Opacity[1], Specularity[White, 10]], 
  Mesh -> None, 
  PlotPoints -> 30]
  • $\begingroup$ What version are you using? $\endgroup$ – Young Jul 24 '16 at 3:48
  • 4
    $\begingroup$ Looks like a discontinuity in the computed normals. Using ParametricPlot3D[] instead works: With[{icos = N[PolyhedronData["Icosahedron", "VertexCoordinates"]]}, ParametricPlot3D[With[{sph = {Cos[ϕ] Sin[θ], Sin[θ] Sin[ϕ], Cos[θ]}}, (3 + Sum[Exp[-10 VectorAngle[sph, pts]^2], {pts, icos}]) sph], {θ, 0, π}, {ϕ, 0, 2 π}, Mesh -> None, PlotPoints -> 30, PlotStyle -> Directive[Orange, Specularity[1, 10]]]]. $\endgroup$ – J. M. is away Jul 24 '16 at 4:28
  • $\begingroup$ @Young Version 10.3 $\endgroup$ – Lucas Jul 25 '16 at 2:55
  • $\begingroup$ @J.M. I agree it is a problem with normals, I think it might count as an bone fide bug too (the normal calculation is probably missing a factor of two somewhere). $\endgroup$ – Lucas Jul 25 '16 at 3:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.