Width, height and center of face?
-
Hi,
I'm trying to get the width, height and center of a rectangle face. Since the BoundingBox implements all those properties, I started with that. However, in my tests I sometimes need to switch
bounds.height
with
bounds.depth
, since it somehow the box is rotated weirdly (more like I haven't recognized a pattern yet).
Is there a better way than using the edges/vertices of that face to manually calculate those values?
-
In the old days there were two conventions for describing XYZ in 3d CAD.
Oddly thebounding-box
uses the older convention, which is not used elsewhere within SketchUp.
SketchUp uses the more obvious convention, that is, as if you were looking at the 3d object in the real world 'through' the screen as if it were a 'window-frame' - X=left-right/red, Y=in-out/green and Z=up-down/blue.
The other 3d CAD convention grew from 2d - it assumed you drew 'on the screen' as if looking down in plan - sobounds.width
[~screen-width] is equivalent to SketchUp's X-red, andbounds.height
[~screen-height] is equivalent to SketchUp's Y-green; the remainingbounds.depth
is SketchUp's Z-blue - originally assumed to project in/out of the plane of the screen - to add the 3d element to a 2d plan !A '2d' face's bounds has no 'depth' - only width and height [and center] etc
Make a note of these odd naming conventions and use them accordingly.
Advertisement