sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    BoundingBox.depth. Accurate?

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 2 Posters 144 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jolranJ Offline
      jolran
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        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.

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          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.

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • jolranJ Offline
            jolran
            last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement