2
$\begingroup$

How can I discretize a Graphics3D object that makes use of Scale and Rotate? When I try DiscretizeGraphics I get an EmptyRegion; the documentation warns of this, at least for Scale, under Possible Issues.

Graphics3D[Rotate[Scale[Ball[], {1, .7, .4}], 0.6, {0, 1, 2/3}]] // DiscretizeGraphics
EmptyRegion[3]

I cannot use Scale and Rotate after discretizing.

Rotate[Scale[DiscretizeRegion@Ball[], {1, .7, .4}], 0.6, {0, 1, 2/3}]  (* fail *)

GeometricTransformation also fails.

GeometricTransformation[DiscretizeRegion @ Ball[], ScalingTransform[{1, .7, .4}]]

I am using version 10.1.

$\endgroup$
  • 1
    $\begingroup$ I think your last line is not correct. It should be like this: DiscretizeRegion@ TransformedRegion[Ball[], ScalingTransform[{1, .7, .4}]]. GeometricTransformation is meant to be applied to graphics primitives. The equivalent for (mesh) regions would be TransformedRegion. $\endgroup$ – Szabolcs Mar 19 '19 at 12:17
  • $\begingroup$ (As for the first one, I'd consider it a bug.) $\endgroup$ – Szabolcs Mar 19 '19 at 12:17
  • $\begingroup$ @Szabolcs Ah, TransformedRegion !! That's what I was forgetting. LOL. Thanks for working faster than my own brain. :D $\endgroup$ – Mr.Wizard Mar 19 '19 at 12:18
  • $\begingroup$ I didn't test in 10.1 though! $\endgroup$ – Szabolcs Mar 19 '19 at 12:18
2
$\begingroup$

Thanks to Szabolcs for jogging my failing memory; I couldn't remember TransformedRegion.

Fold[TransformedRegion, Ball[],
 {ScalingTransform[{1, .7, .4}], RotationTransform[0.6, {0, 1, 2/3}]}
]

% // DiscretizeRegion
Ellipsoid[{0., 0., 0.}, {{0.764563, 0.119337, -0.334044}, {0.119337, 
   0.537886, -0.0984315}, {-0.334044, -0.0984315, 0.347551}}]

enter image description here

|improve this answer|||||
$\endgroup$
  • 1
    $\begingroup$ You can also use Composition on transformation functions to obtain a single transformation. $\endgroup$ – Szabolcs Mar 19 '19 at 13:27

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.