公告:网站程序已升级到1.8.3,修复了提问时可能报错的问题,请清除浏览器缓存
2019-11-10

欢迎来到 Mathematica 问答社区

提问时请贴上文本代码

语法高亮:在编辑器中点击

被禁止的话题:广告破解

请阅读:《提问的智慧》

备用域名:mma.ooo

支持LaTex数学公式
行内公式标识符:\$ 或“$\backslash ($”+“$\backslash )$”,
行间公式标识符:\$\$ 或 “$\backslash [$”+“$\backslash ]$”

社区建议QQ群:365716997

分类

0 投票
478 浏览

如何画出类似如下的简单核壳结构的示意图。如何类似下图那样挖空一个扇形区域?

谢谢!

分类:绘图 | 用户: 奋斗的大灰狼 (206 分)

1个回答

0 投票


应该用纹理,这里没有去找相应的,暂时可以用用 Mathematica 12.1 提供的各种 Shading。而且为了效果好,应该独立画出各个曲面片而不是用 RegionPlot3D ,也不需要用 RegionFunction 写不等式,用 MeshFunction 和 MeshShading 。

SetOptions[ContourPlot3D, Boxed -> False, Axes -> False, 
  Lighting -> Automatic, BoundaryStyle -> None, 
  Mesh -> {{0}, {0}, {0}}];
f1 = x^2 + y^2 + z^2 - 1;
f2 = x^2 + y^2 + z^2 - 2^2;
f3 = x;
f4 = y;
f5 = z;
pureFun[f_] := (Evaluate[
     f /. {x -> Slot@1, y -> Slot@2, z -> Slot@3}]) &;
s1 = ContourPlot3D[f1 == 0, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, 
   MeshFunctions -> pureFun /@ {f3, f4, f5}, 
   MeshShading -> {{{None, None}, {None, None}}, {{None, 
       StippleShading[0.9]}, {None, None}}}, MeshStyle -> None];
s2 = ContourPlot3D[f2 == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
   MeshFunctions -> pureFun /@ {f3, f4, f5}, 
   MeshShading -> {{{HatchShading[], HatchShading[]}, {HatchShading[],
        HatchShading[]}}, {{HatchShading[], None}, {HatchShading[], 
       HatchShading[]}}}, MeshStyle -> None];
s3 = ContourPlot3D[f3 == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
   MeshFunctions -> pureFun /@ {f1, f2, f4, f5}, 
   MeshShading -> {{{{None, None}, {None, None}}, {{None, 
        None}, {None, None}}}, {{{None, 
        HalftoneShading[0.6, Orange]}, {None, None}}, {{None, 
        None}, {None, None}}}}, MeshStyle -> None];
s4 = ContourPlot3D[f4 == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
   MeshFunctions -> pureFun /@ {f1, f2, f3, f5}, 
   MeshShading -> {{{{None, None}, {None, None}}, {{None, 
        None}, {None, None}}}, {{{None, None}, {None, None}}, {{None, 
        HalftoneShading[0.6, Orange]}, {None, None}}}}, 
   MeshStyle -> None];
s5 = ContourPlot3D[f5 == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
   MeshFunctions -> pureFun /@ {f1, f2, f3, f4}, 
   MeshShading -> {{{{None, None}, {None, None}}, {{None, 
        HalftoneShading[0.8, Orange]}, {None, None}}}, {{{None, 
        None}, {None, None}}, {{None, None}, {None, None}}}}, 
   MeshStyle -> None];
Show[s1, s2, s3, s4, s5, PlotRange -> All]

用户: cvgmt (276 分)
修改于 用户:cvgmt
...