Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
I assume you're aware of this, but the vertex coordinates of the original PolyhedronData object are accessible like this: PolyhedronData["GreatStellatedDodecahedron", "VertexCoordinates"] // N – Jens May 1 '13 at 16:13
up vote 7 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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