A face using X,Y,Z coordinates is in 3D model space not 2D screen space.
If you are drawing to screen space inside a tool, and need to account for display scaling on High DPI monitors, then have a look at:
and / or this:
There really isn’t a set “default zoom factor” per se. Although we could think of zoom to model extents as being a standard zoom factor of
But you might need to know what the zoom setting is compared to a zoom extents when your tool begins. I’m not sure how to achieve this as this factor would change if the user changes the camera position (ie, by orbiting etc.)
You might just have to use an internal var in your tool and assume 1.0 when the tool begins.
Or use a standard like …
@scale = Sketchup.active_model.active_view.pixels_to_model(1,ORIGIN)
… or …
@scale = Sketchup.active_model.active_view.pixels_to_model(
You might need to temporarily attach a
ViewObserver when your tool is activated to know whenever the view changes. (Be sure to detach it when your tool is deactivated.)