Recently I have seen a code in mathematica about Slicing through Graphics3D in Slice through Graphics3D. My questions is: Is it possible to fill out these spheres? I have problem with generating randomly distributed filled spheres inside cube. Bakha

• gr = Graphics3D[{FaceForm[Yellow, Black], obj}, Axes -> True] kind of gives this effect since you can't perceive depth with black inside. Sep 29, 2014 at 8:58
• In my project I have to generate 3D model of randomly distributed filled spheres inside cube. As a result I have to show the distribution of the spheres in the cube layer by layer. Using the mentioned before Slice through Graphics3D problem I have a 3D model but when I am going to see it layer by layer I am seeing just square with empty region inside. Is it possible to fill it out Sep 29, 2014 at 9:39
• I understand your question and I maintain that my suggestion kind of gives the expected result. It's not the real deal, hence I posted it as a comment. Sep 29, 2014 at 10:10
• Is it possible to see it layer by layer separately? I mean to see first layer in first graph, second in second graph, etc., without adding one layer to others. Sep 29, 2014 at 23:21
• Dear @Bakha you have two profiles registered, it seems: here and here. Please follow the instructions at: stackoverflow.com/help/merging-accounts so your total reputation counts. Sep 30, 2014 at 1:23

With V10 you can use ClipPlanes

Graphics3D[{Red, Opacity[0.5], Cuboid[]},
Axes -> True,
ClipPlanes -> {{1, 1, -1, 0}},
ClipPlanesStyle -> {Directive[Opacity[0.2], Green]}]


Show[Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}],
ClipPlanes -> {{-1, 1, 0, 1}},
ClipPlanesStyle -> {Directive[Opacity[.3], Brown]}]


Something like this?

z = 100;
p = RandomReal[100, {z, 3}];
r = RandomReal[10, {z}];
spheres = GraphicsComplex[p, Sphere[Range[z], r]];

Grid[
Partition[
Map[
Graphics3D[{Red, spheres},
Axes -> True,
ClipPlanes -> {{0, 1, 0, #}},
ClipPlanesStyle -> {Directive[Opacity[0.2], Green]}] &,
Range[-1, -100, -10]],
5],
Dividers -> All]


• In my project I have to generate 3D model of randomly distributed filled spheres inside cube. As a result I have to show the distribution of the spheres in the cube layer by layer. Using the mentioned before Slice through Graphics3D problem I have a 3D model but when I am going to see it layer by layer I am seeing just square with empty region inside. Is it possible to fill it out? Sep 29, 2014 at 9:49