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,

  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.

  • $\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 May 1 '13 at 16:13

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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