Use ZoomAsync to center multiple geometries in the viewer and at all viewing angles

Is there a method through the API to handle this? Is it possible to specify multiple geometries for ZoomAsync?

Currently, my workaround is to define a hidden geometry specifically for ZoomAsync. In doing this, I discovered that ZoomAsync does a poor job centering cubes, lines, planes… at certain viewing angles. To accomplish the title of this post, I create a sphere in the center of the concerned geometries, fine-tune its size, and then hide it via ToggleGeometry.

The zoomAsync() takes an array of paths so you just need to include them in the call:[yourPaths])

Could you provide us with an example where the function doesn’t zoom properly on cubes, planes and lines?

Thanks Pavol. I thought I had tried passing an array to zoomAsync() but I must have missed something.

Regarding the poor centering:

I just played around with this and I don’t believe it’s related to the geometry type. Yes, I can potentially get minutely better positioning from a sphere but, it’s likely because I’m designing the sphere specifically to address the positioning issues.

The behavior is consistent with all geometries and it seems related to the vertical centering in relation to the viewing angle. The images attached show zoomAsync applied to the same geometries (leg components and wood panel pieces). The grey borders are the top and bottom of the canvas element. The only potential clue I can find that relates to the issue is that the centering is better when the canvas element has a portrait orientation.


Thanks for your feedback Winston, we will have a closer look.