• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

BOX SELECTION - ruby request

Scheduled Pinned Locked Moved Developers' Forum
30 Posts 5 Posters 831 Views 5 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.
  • C Offline
    Chris Fullmer
    last edited by 29 Apr 2009, 06:53

    Thinking about this, bounding boxes always work on the x,y,z axis, right? So it won't work because the bounding box of a cube that is drawn off axis, will not actually match its faces.

    Chris

    Lately you've been tan, suspicious for the winter.
    All my Plugins I've written

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 29 Apr 2009, 07:12

      Make a virtual one out of the vertices?

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

      1 Reply Last reply Reply Quote 0
      • C Offline
        Chris Fullmer
        last edited by 29 Apr 2009, 08:10

        Nah, because if you add your 8 vertices to it, it will still align itself to the global axes, and not to the vertices. This is from the API

        @unknownuser said:

        Bounding boxes are three-dimensional boxes (eight corners), aligned with the global axes, that surround entities within your model
        .

        Hmm, but thinking about it, components bounding boxes rotate with them. So is there a way to rotate a bounding box, or at least use a rotated component's bounding box for the selection testing? That might be promising.

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • C Offline
          Chris Fullmer
          last edited by 29 Apr 2009, 08:15

          Nope, I just tested it. A rotated compenent appears to have a rotated bounding box, but that is just a visual thing. When you get the component.bounds, it is not rotated, it is still aligned to the world axes.

          EDIT: Which just means that using .bounds won't work for this 3d selection box idea, but it should still be possible.

          Chris

          Lately you've been tan, suspicious for the winter.
          All my Plugins I've written

          1 Reply Last reply Reply Quote 0
          • T Offline
            thomthom
            last edited by 29 Apr 2009, 08:18

            Isn't there a local_bounds method?

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

            1 Reply Last reply Reply Quote 0
            • C Offline
              Chris Fullmer
              last edited by 29 Apr 2009, 08:21

              Not that I'm seeing in the API. That would sure be handy though!

              Lately you've been tan, suspicious for the winter.
              All my Plugins I've written

              1 Reply Last reply Reply Quote 0
              • T Offline
                thomthom
                last edited by 29 Apr 2009, 08:48

                I remember it being mentioned in the initial SU API Blog of the SU7 announcement. Though not what it was related to.

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

                1 Reply Last reply Reply Quote 0
                • C Offline
                  Chris Fullmer
                  last edited by 29 Apr 2009, 08:53

                  sure enough:

                  Measure your groups regardless of their transform
                  untransformed_bb = my_group.local_bounds

                  That should be interesting to play with. I've gotta get some sleep though.

                  Lately you've been tan, suspicious for the winter.
                  All my Plugins I've written

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    thomthom
                    last edited by 29 Apr 2009, 09:04

                    Only for groups it turns out. From the Docs:

                    @unknownuser said:

                    The local_bounds method returns the BoundingBox object that defines the size of the group in an untransformed state. Useful for determining the original width, height, and depth of a group regardless of its current position or scale. For components, you can get a similar result by checking my_instance.definition.bounds.

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

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      TIG Moderator
                      last edited by 29 Apr 2009, 10:42

                      ... So, make a temporary group of the instance and get the local_bounds if that, then explode it back as it was...

                      TIG

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

                      Advertisement