BoundingBox.depth. Accurate?
-
The API says The depth is returned in the currently set units (inches, by default).
The same goes for width and heigth(which is not necessary Z axis).So question is how does Sketchup handle the digits internaly in this case? 0,001?
I mean if I set a variable bbox=group.boundsand@x_length=bbox.depth. Is it a consistent method of mesurement?Or is Units precision set in the Model prefs dictating the return value.
-
SketchUp's units internally is in inches and at an precision of 1/1000 ( 0.001 ).
The internal unit is converted to user units only in the UI - based on the user's settings. When you have a Length object and invoke its.to_s
method it will output the length in the current model's unit setting and user locale. -
When dealing with user units, make the Length class do the work for it. And make sure you know if your objects are Floats or Lengths.
-
Ah, thanks.
Doing some tiling with thoose mesurements. Should be ok then..
@unknownuser said:
The internal unit is converted to user units only in the UI
That's why I got back different results in the ruby console when changing the Model precision.
Maybe that goes for some other mesurement as well, havent just thought about it until now.@unknownuser said:
When dealing with user units, make the Length class do the work for it. And make sure you know if your objects are Floats or Lengths.
I'll try to stick to that.
Advertisement