Extending from these questions How to check if a 3D point is in a planar polygon? and How to check if a 2D point is in a polygon?.
I'm trying to do this to render specific shapes made up of spheres.
For a sphere it is easy:
(* generate a grid of points*)
d = 20;
points = Table[{x, y, z}, {x, -d, d}, {y, -d, d}, {z, -d, d}]~Flatten~2;
(*check if they are inside a spherical shell*)
points2 = Select[points, 8.5 < Norm[#] < 10 &];
(*render the spheres that are inside the spherical shell*)
Graphics3D[{Sphere[#, 0.75]} & /@ points2, Boxed -> False]
However, I want to try and do the same rendering for other shapes, for example a pentagonal dipyramid
Graphics3D[{Lighter@Lighter@Blue, Opacity[.8], EdgeForm[Thickness[ 0.005]], PolyhedronData["PentagonalDipyramid", "Faces"]}, Boxed -> False]
However, I'm not sure how to check if the points on the grid are with in the polyhedron.
I can access the faces... PolyhedronData["PentagonalDipyramid", "Faces"]
RegionPlot3D
example there). $\endgroup$