Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Decompose a graphics 3D primitive into polygons when possible
ResourceFunction["PrimitiveToPolygons"][pr] decomposes the graphics 3D primitive pr into polygons when possible. |
A Parallelepiped object is converted to polygons:
In[1]:= | ![]() |
Out[1]= | ![]() |
Display as tubes:
In[2]:= | ![]() |
Out[2]= | ![]() |
Using VertexTextureCoordinates:
In[3]:= | ![]() |
Out[3]= | ![]() |
Number of polygons:
In[4]:= | ![]() |
Out[4]= | ![]() |
A tetrahedron with edge length 2:
In[5]:= | ![]() |
Out[5]= | ![]() |
Using VertexColors:
In[6]:= | ![]() |
Out[6]= | ![]() |
A pyramid:
In[7]:= | ![]() |
Out[7]= | ![]() |
A simplex in dimension 3 with texture:
In[8]:= | ![]() |
Out[8]= | ![]() |
Other graphics primitives:
In[9]:= | ![]() |
Out[9]= | ![]() |
Using Polyhedron:
In[10]:= | ![]() |
Out[10]= | ![]() |
Using Polyhedron with VertexTextureCoordinates:
In[11]:= | ![]() |
Out[11]= | ![]() |
Scale and rotate polygons:
In[12]:= | ![]() |
Out[12]= | ![]() |
In[13]:= | ![]() |
Out[13]= | ![]() |
A Raster3D with gray levels:
In[14]:= | ![]() |
Out[14]= | ![]() |
A Raster3D with RGB colors:
In[15]:= | ![]() |
Out[15]= | ![]() |
The resource functions PerforatePolygons and OutlinePolygons internally use PrimitiveToPolygons:
In[16]:= | ![]() |
Out[16]= | ![]() |
In[17]:= | ![]() |
Out[17]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License