Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

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

1 Answer 1

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

 
discard

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.