An Outbreak of Tetrahedra: 3D Transformations
An Outbreak of Tetrahedra: 3D Transformations
A few years ago I got this laser-scan of my face. This is a quick exploration of using symbolic rules to transform the geometry.
First I import the STL file and convert to triangles...
First I import the STL file and convert to triangles...
faceScan=Normal@Import[CloudObject[
https://www.wolframcloud.com/obj/jonm/FaceScan.stl
],{"STL","Graphics3D"}]Out[]=
A simple symbolic transformation rule can replace every triangle in the mesh with a tetrahedron, oriented to the normal to the surface. It makes a nice horror-effect!
faceTransformed=ReplaceAllfaceScan,Triangle[x_]TetrahedronAppendx,x[[1]]+Cross[x[[1]]-x[[3]],x[[2]]-x[[3]]]
1
4
Out[]=
A little lighting control gives it more impact:
Show[faceTransformed,BackgroundBlack,Lighting{{"Point",White,{-50,-50,100}},{"Point",Red,{-50,100,100}}}]
Out[]=
Playing around with the viewpoint...
pan=Interpolation[{{0,{-2.93,0.38,1.65}},{1,{-0.53,0.267,3.33}}},InterpolationOrder1];
And the size of the tetrahedron makes a fun animation for a tweet:
In[]:=
Export"animation.gif",(Join[#1,Reverse[#1]]&)TableShowfaceScan/.Triangle[x_]TetrahedronAppendx,x1+(t+4)(x〚1〛-x〚3〛)(x〚2〛-x〚3〛),BackgroundBlack,Lighting{{"Point",White,{-50,-50,100}},{"Point",Red,{-50,100,100}}},SphericalRegionTrue,ViewAngle0.25,ViewVertical{-0.537,0.801,0.261},ViewPointpan[LogisticSigmoid[t]],{t,-4,4,0.14},ImageSize450
1
16