ContourPlot3D中重叠的网格线

时间:2011-08-28 06:06:10

标签: wolfram-mathematica rendering 3d vector-graphics mathematica-frontend

我在 Mathematica 7.0.1中Mesh生成的3D表面上渲染ContourPlot3D行时遇到问题:

p=ContourPlot3D[x^4+y^4+z^4-(x^2+y^2+z^2)^2+3(x^2+y^2+z^2)==3,
      {x, -2,2}, {y, -2, 2}, {z,-2,2},
     BoundaryStyle->Directive[Black,Thickness[.003]],
     ContourStyle->Directive[Orange,Opacity[0.5],Specularity[White,300]],
     PlotPoints->90,Ticks->None,
     MeshStyle->Directive[GrayLevel[.7],Thickness[.001]],
     Lighting->{{"Directional",RGBColor[1,1,1],
                           {ImageScaled@{1,0,1},ImageScaled@{0,0,0}}}}];
p=Graphics[Inset[p,{0,0},Center,{1,1}],
                        PlotRange->{{-.5,.5},{-.5,.5}},Frame->True]

screenshot1

仔细观察它们:

Show[p, PlotRange -> {{-.16, -.05}, {0, .1}}]

screenshot2

你会看到灰色的Mesh线在许多地方被表面形成三角形重叠,甚至看起来是虚线。有办法避免这种情况吗?

2 个答案:

答案 0 :(得分:5)

John Fultz has answered我的问题在官方新闻组中。 Mathematica 7用户(可能对于拥有不支持DepthPeeling呈现方法的图形卡的版本8用户)的解决方案是使用未记录的MeshStyle选项形式:

MeshStyle -> {{GrayLevel[.7], Tube[0.01]}}

如果Mesh行显示为平面对象,可以使用Glow

MeshStyle -> {{Glow[GrayLevel[.7]], Black, Tube[0.005]}}

现在网格很好地呈现:

p1 = ContourPlot3D[
   x^4 + y^4 + z^4 - (x^2 + y^2 + z^2)^2 + 3 (x^2 + y^2 + z^2) == 
    3, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
   BoundaryStyle -> Directive[Black, Thickness[.003]], 
   ContourStyle -> 
    Directive[Orange, Opacity[0.5], Specularity[White, 300]], 
   Ticks -> None, PlotPoints -> 40, 
   MeshStyle -> {{Glow[GrayLevel[.7]], Black, Tube[0.005]}}, 
   Lighting -> {{"Directional", 
      RGBColor[1, 1, 1], {ImageScaled@{1, 0, 1}, 
       ImageScaled@{0, 0, 0}}}}];
p = Graphics[Inset[p1, {0, 0}, Center, {1, 1}], 
  PlotRange -> {{-.5, .5}, {-.5, .5}}, Frame -> True, 
  GridLines -> Automatic]

screenshot

Show[p, PlotRange -> {{-.16, -.05}, {0, .1}}]

screenshot

答案 1 :(得分:4)

对于它的价值,我在Mac OS 10.7.1上的M8.0.1中没有看到这个问题:

enter image description here