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$
4
  • 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$ Commented Mar 19, 2019 at 12:17
  • $\begingroup$ (As for the first one, I'd consider it a bug.) $\endgroup$ Commented Mar 19, 2019 at 12:17
  • $\begingroup$ @Szabolcs Ah, TransformedRegion !! That's what I was forgetting. LOL. Thanks for working faster than my own brain. :D $\endgroup$ Commented Mar 19, 2019 at 12:18
  • $\begingroup$ I didn't test in 10.1 though! $\endgroup$ Commented Mar 19, 2019 at 12:18

1 Answer 1

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

$\endgroup$
1
  • 1
    $\begingroup$ You can also use Composition on transformation functions to obtain a single transformation. $\endgroup$ Commented Mar 19, 2019 at 13:27

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.