For example, according to the doc, the Ball
is a filled ball in 2D and 3D.
However,
Graphics3D[{Ball[]},
ClipPlanes -> InfinitePlane[{{0, 0, 0}, {0, 1, 1}, {1, 1, 2}}]]
Shows a hollow ball, the same as Sphere
What is wrong? How to make the cut object solid, and even better, can set the opacity to it?
update
What I actually want to do is to construct Wigner-Seitz cell by series of middle cutting planes. like this
update 2023-2-26
I optimized @chyanog's solution, especially the PlotRange
is adjusted automatically, otherwise it will give misleading result for long vector list.
BZview[bVecList_, opts : OptionsPattern[]] :=
Module[{color, opacity, reduction},
color = OptionValue["color"];
opacity = OptionValue["opacity"];
reduction = OptionValue["reduction"];
pts = DeleteCases[
Tuples[{-1, 0, 1}, 3], {0, 0, 0}] . (bVecList*(1 - reduction));
Graphics3D[{EdgeForm[Thick], FaceForm[color], Opacity[opacity],
RegionIntersection[
BoundaryDiscretizeGraphics[HalfSpace[#, # . #/2],
PlotRange -> (3*MinMax /@ Transpose@pts)] & /@ pts]},
Lighting -> "Neutral",Boxed -> False]
]
The "reduction" is essential for composing different BZ view when there are edges that coincide. For example, define
xx = 1.3;
aCon = {1., 0, 0};
bCon = {0, 1., 0};
cCon = {0, 0, xx};
aPrim = {0, 1./2, xx/2};
bPrim = {0, 1./2, -xx/2};
cPrim = {1., 0, 0};
primVecList = {aPrim, bPrim, cPrim};
conVecList = {aCon, bCon, cCon};
then
Show[BZview[conVecList],
BZview[primVecList, "color" -> Blue]]
gives
If we reduce the 2nd BZ a little bit.
Show[BZview[conVecList],
BZview[primVecList, "color" -> Blue, "reduction" -> 0.01]]
We get perfect
Show[DiscretizeGraphics@Ball[], ClipPlanes -> InfinitePlane[{{0, 0, 0}, {0, 1, 1}, {1, 1, 2}}]]
not pretty but something. $\endgroup$ClipPlanes
but it didn't work because the graphics primitive is not solid. $\endgroup$