2
$\begingroup$

If I have a Graphics3D object that was generated from manipulations to PolyhedronData rather than via an explicit equation, for example the Spikey Spikey 6!

(for which the entire code can be found here The Cover Image: Making the Mathematica 6 Surface-Textured Hyperbolic Dodecahedron, but which culminates with the following command,

Graphics3D[{EdgeForm[], 
  addHatToL /@ Take[Flatten[Take[LsOnDodecahedron, All]], All]}, 
 PlotRange -> All, Boxed -> False, ImageSize -> Full, 
 Lighting -> {{"Ambient", RGBColor[0.2, 0, 0]}, {"Point", 
    RGBColor[0.4, 0.4, 0.4], {2, 0, 2}}, {"Point", 
    RGBColor[0.4, 0.4, 0.4], {2, 2, 2}}, {"Point", 
    RGBColor[0.4, 0.4, 0.4], {0, 2, 2}}, {"Point", 
    RGBColor[0.2, 0, 0], {-2, -2, -2}}}]

Is there a way for me to extract/generate a table of 3D points along the surface of (or within, I don't actually care) the object?

I saw Efficiently determining if 3D points are within a surface composed of polygons, which went a bit over my head, but many of the answers given seemed to either require a 'nice' shape (i.e., no concave surfaces, no cusps, no self-intersections, etc.) or be based on the fact that he had generated the object with generated data sent to ListContourPlot3D, which is not the case here.

$\endgroup$
1
  • $\begingroup$ I assume you're aware of this, but the vertex coordinates of the original PolyhedronData object are accessible like this: PolyhedronData["GreatStellatedDodecahedron", "VertexCoordinates"] // N $\endgroup$
    – Jens
    Commented May 1, 2013 at 16:13

1 Answer 1

7
$\begingroup$

You can pull out the points by searching for Polygon objects in addHatToL /@ Take[Flatten[Take[LsOnDodecahedron, All]], All]:

p1 = addHatToL/@Take[Flatten[Take[LsOnDodecahedron, All]], All];
surfacepoints = Flatten[Flatten[Cases[Flatten[p1[[#]]],Polygon[m_] ->m], 1]&/@Range[Length[p1]], 1];

surfacepoints will then give you the points on the surface of the original picture.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.