ContourPlot3D中重叠的网格线

Ale*_*kov 8 3d rendering wolfram-mathematica 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]
Run Code Online (Sandbox Code Playgroud)

screenshot1

仔细看看它们:

Show[p, PlotRange -> {{-.16, -.05}, {0, .1}}]
Run Code Online (Sandbox Code Playgroud)

screenshot2

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

Ale*_*kov 5

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

MeshStyle -> {{GrayLevel[.7], Tube[0.01]}}
Run Code Online (Sandbox Code Playgroud)

为了让Mesh线条显示为扁平物体,可以使用Glow:

MeshStyle -> {{Glow[GrayLevel[.7]], Black, Tube[0.005]}}
Run Code Online (Sandbox Code Playgroud)

现在网格很好地呈现:

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]
Run Code Online (Sandbox Code Playgroud)

截图

Show[p, PlotRange -> {{-.16, -.05}, {0, .1}}]
Run Code Online (Sandbox Code Playgroud)

截图