This question was asked in the forum 6 years ago, but never answered …
I would think that it would be necessary to write your own “zoom” type function.
It would need to ensure that all the corners of the model’s bounding box was visible. The visibility check would need to calculate the camera’s viewing frustum and test of the bounding corners are within it.
See:
Or … (SketchUp 2020.0, API 8.0 and higher) perhaps check that all top level instances and primitives in the model are visible, if not transform the camera’s eye point farther from the target and repeat the visibility check.
@tt_su , @ene_su Have any ideas or gists available for this ?
BTW, what is the purpose of the SUCameraGetViewTransformation() function ?
- Ie, the docs mention a “look at matrix” but not what this transformation matrix is.
There is no equivalent method in the Ruby API.
@cagdcg , You may add feature requests in the official SketchUp API tracker: