2
$\begingroup$

I am attempting to geometrically transform a polyhedron (namely rotate and translate the polyhedron in global coordinates) and than find the new vertices. Here is what I have so far, but I am stuck at how to get the new vertices since there doesn't seem to be a nice function for it.

θz = 90 °;
rotationaxis = {1, 1, 0};
position = {1, 1, 0};
graphics = Graphics3D[GeometricTransformation[GeometricTransformation[
 N[PolyhedronData["SnubCube", "GraphicsComplex"]], 
 RotationMatrix[θz, rotationaxis]], 
 TranslationTransform[position]]]

Any assistance is appreciated!

$\endgroup$
1
$\begingroup$
  1. You can use the transformations on the coordinates directly without using GeometricTransformation:

gc = N@PolyhedronData["SnubCube", "GraphicsComplex"];
vertices = RotationMatrix[θz, rotationaxis].# & /@ 
  (TranslationTransform[position] /@ gc[[1]]) ;
gc2 = GraphicsComplex[vertices, gc[[2]]];
Normal[gc2] == Normal[graphics[[1]]] /. Polygon[x_, __] :> Polygon[x]

True

Graphics3D[{gc2, Red, PointSize[Large], Point@vertices}] 

enter image description here

Alternatively, you can use Normal in two ways:

  1. You can wrap GeometricTransformation with Normal (which, when possible, will perform the transformations explicitly):

graphics2 = Graphics3D[Normal @ GeometricTransformation[GeometricTransformation[
       N[PolyhedronData["SnubCube", "GraphicsComplex"]], 
       RotationMatrix[θz, rotationaxis]], 
      TranslationTransform[position]]] ;
vertices2 = DeleteDuplicates[Join @@ Cases[graphics2[[1]], Polygon[x_, ___] :> x, ∞]];
Sort[vertices2] == Sort[vertices] 

True

  1. You can convert GraphicsComplex into ordinary lists of graphics primitives and directives using Normal:

vertices3 = DeleteDuplicates[Join @@ Cases[Normal[graphics][[1]], 
  Polygon[x_, ___] :> x, ∞]]; 
Sort[vertices3] == Sort[vertices]  

True

$\endgroup$
  • $\begingroup$ Perfect! Thank you! $\endgroup$ – Novice Nov 9 '18 at 16:37
  • $\begingroup$ @Novice, my pleasure. Welcome to mma.se. $\endgroup$ – kglr Nov 9 '18 at 16:38
1
$\begingroup$

You could use TransformedRegion instead. Start with a region object:

region = PolyhedronData["SnubCube", "Region"];

Transform the region using TransformedRegion:

transformed = TransformedRegion[
    region,
    TranslationTransform[position] @* RotationTransform[θz, rotationaxis]
]

enter image description here

Get the vertices using MeshCoordinates:

MeshCoordinates[transformed]

{{-0.179457, 0.69909, 0.569122}, {1.03684, 0.158297, 1.04678}, {0.356908, -0.120748, 0.368676}, {0.500478, 0.978135, 1.24722}, {1.8417, 0.963156, -1.04678}, {1.30091, 2.17946, -0.569122}, {1.02187, 1.49952, -1.24722}, {2.12075, 1.64309, -0.368676}, {0.69909, -0.179457, -0.569122}, {0.963156, 1.8417, 1.04678}, {-0.28744, 1.32846, -0.200445}, {1.94969, 0.333786, 0.678102}, {0.158297, 1.03684, -1.04678}, {2.17946, 1.30091, 0.569122}, {1.66621, 0.050314, -0.678102}, {0.67154, 2.28744, 0.200445}, {-0.120748, 0.356908, -0.368676}, {1.49952, 1.02187, 1.24722}, {1.32846, -0.28744, 0.200445}, {0.050314, 1.66621, 0.678102}, {0.978135, 0.500478, -1.24722}, {1.64309, 2.12075, 0.368676}, {0.333786, 1.94969, -0.678102}, {2.28744, 0.67154, -0.200445}}

$\endgroup$

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.