Zoom Extents to match trace image

Is there a way to ask an OpenNURBS view to zoom to extents to match the assigned ON_3dmViewTraceImage ?

Similar to the code here:

But purely using the OpenNURBS library? (eg. replicating what the RhinoDollyExtents call does in that example) and ideally a way to also account for the ON_3dmViewTraceImage assigned to the view?

Hi @jhargrave,

I’ve attached an openNURBS version of the RhinoDollyExtents C++ SDK function.

opennurbs_dollyextents.cpp (3.1 KB)

The function requires a bounding box in camera coordinates.

ON_Xform w2c;
ON_Viewport zoomed_vp;
if (ON_DollyExtents(current_vp, bbox, zoomed_vp))

Hope this helps.

– Dale

Thanks for taking the time to create that Dale. It was extremely helpful.

1 Like