1
$\begingroup$

I have dozens of vertices and dozens of faces which is why I use the v={};i={} and Graphics3D and GraphicsComplex, which I'll keep for the below example even though it's not necessary in this case. Also I'll specify x,y,z points even though below I'm not using the z dimension.

I'm trying to remove an interior polygon from a face. When I was working with 2D I could specify a colored polygon and then specify an interior white polygon and the latter would override the former, but that's not working for me in 3D. I probably just have it set up wrong.

This is what doesn't work:

v = {{0, 0, 0}, {10, 0, 0}, {10, 10, 0}, {0, 10, 0}, {2, 2, 0}, {2, 5, 0}, {5, 5, 0}, {5, 2, 0}};
i = {{1, 2, 3, 4}};
{Graphics3D[{Red, GraphicsComplex[v, Polygon[i]]} ]    ;   
 i = {{5, 6, 7, 8}}; 
 Graphics3D[{White, GraphicsComplex[v, Polygon[i]]}]}
$\endgroup$
1
$\begingroup$
Graphics3D[Normal@PolyhedronData["Dodecahedron", "Faces"] /. 
           p : Polygon[__] :> {RandomChoice[{Red, White, Blue, Transparent}], p},
           Lighting -> "Neutral"]

Mathematica graphics

$\endgroup$
  • $\begingroup$ I'm sorry, I don't understand this. I want a 10 by 10 square with a 3 by 3 square inside of it removed. Maybe I'm not putting your answer in the right place. This is what I did: v = {{0, 0, 0}, {10, 0, 0}, {10, 10, 0}, {0, 10, 0}, {2, 2, 0}, {2, 5, 0}, {5, 5, 0}, {5, 2, 0}}; i = { {1, 2, 3, 4}}; {Graphics3D[{Red, GraphicsComplex[v, Polygon[i]]} ] ; i = {{5, 6, 7, 8}}; Graphics3D[{White, GraphicsComplex[v, Polygon[i]]}, Lighting -> "Neutral"]} $\endgroup$ – Howard Wilk Sep 30 '14 at 16:18
  • $\begingroup$ I'm new to this. I don't know what "rep points" are. I just posted this question at community.wolfram.com and attached it there. $\endgroup$ – Howard Wilk Sep 30 '14 at 16:32
  • $\begingroup$ Now that I tried to move this discussion to chat, I see what "rep points" are--and that I have 1, not enough to chat. Community.wolfram.com had an "Attachments"/"Add a file to this post" so that's what I did. Why don't you post your answer there? $\endgroup$ – Howard Wilk Sep 30 '14 at 17:06

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.