Find bounding box of arbitrary 3d graphics?
RegionBounds@RegionUnion[
BoundaryDiscretizeRegion[Cone[]],
BoundaryDiscretizeRegion[Cuboid[]]
]
{{-1., 1.}, {-1., 1.}, {-1., 1.}}
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.}} *)
MinMax /@ Transpose[RegionBounds /@ {Cone[], Cuboid[]}]
{{-1, 1}, {-1, 1}, {-1, 1}}