7
$\begingroup$

What's the best workaround for this limitation:

RegionBounds[
 BoundaryDiscretizeGraphics[Graphics3D[{Cone[], Cuboid[]}]]]

enter image description here

$\endgroup$
  • 1
    $\begingroup$ Tz. Who downvotes this? @M.R. What about RegionBounds@RegionUnion[ BoundaryDiscretizeRegion[Cone[]], BoundaryDiscretizeRegion[Cuboid[]] ]? $\endgroup$ – Henrik Schumacher Jan 14 at 15:50
  • $\begingroup$ The very last item in the DiscretizeRegion docs says "DiscretizeGraphics for Graphics3D with multiple volume primitives is not supported", unfortunately. Hence the need for a workaround I suppose :) $\endgroup$ – Carl Lange Jan 14 at 15:56
  • 1
    $\begingroup$ @HenrikSchumacher I expect the downvote was due to the question originally not having copy-pasteable code :) $\endgroup$ – Carl Lange Jan 14 at 15:57
  • $\begingroup$ @HenrikSchumacher I did. Because of the very low quality question for a long term user. No copyable code, not a word about what qualifies as expected output etc. $\endgroup$ – Kuba Jan 14 at 15:58
  • $\begingroup$ Possible duplicate: mathematica.stackexchange.com/questions/18034/… $\endgroup$ – Michael E2 Jan 14 at 16:33
6
$\begingroup$
Charting`get3DPlotRange[
 Show[Graphics3D[{Cone[], Cuboid[]}], PlotRangePadding -> None]]
(*  {{-1., 1.}, {-1., 1.}, {-1., 1.}}  *)

See How to get the real PlotRange using AbsoluteOptions?

If "arbitrary 3d graphics" includes of objects of heterogeneous dimensions, then get3DPlotRange still works:

Charting`get3DPlotRange[
 Show[Graphics3D[{Cone[], Cuboid[], Point[{0, 0, -3}], 
    Line[{{1, 0, 0}, {-2, 0, 0}}]}], PlotRangePadding -> None]]
(*  {{-2., 1.}, {-1., 1.}, {-3., 1.}}  *)
$\endgroup$
7
$\begingroup$
RegionBounds@RegionUnion[ 
  BoundaryDiscretizeRegion[Cone[]], 
  BoundaryDiscretizeRegion[Cuboid[]]
  ]

{{-1., 1.}, {-1., 1.}, {-1., 1.}}

$\endgroup$
4
$\begingroup$
MinMax /@ Transpose[RegionBounds /@ {Cone[], Cuboid[]}]

{{-1, 1}, {-1, 1}, {-1, 1}}

$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.