• Login
sketchucation logo sketchucation
  • Login
๐Ÿ”Œ Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

Get the coordinates of the corners of the "blue box"

Scheduled Pinned Locked Moved Developers' Forum
7 Posts 3 Posters 304 Views 3 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.
  • D Offline
    dacastror
    last edited by 29 Jun 2012, 23:09

    Hello, I would like to know how I can get the coordinates of the 8 corners of the "blue box" of a group or component that has been rotated and scaled

    https://sites.google.com/site/dacastror/archivos/extremos box 2.jpg

    I tried to bounds.corner or local_bounds.corner but do not work properly for what I need, I have been looking and I could not find the appropriateness

    .

    1 Reply Last reply Reply Quote 0
    • D Offline
      dacastror
      last edited by 30 Jun 2012, 21:37

      help ๐Ÿ˜ข

      1 Reply Last reply Reply Quote 0
      • D Offline
        Dan Rathbun
        last edited by 30 Jun 2012, 23:51

        @dacastror said:

        help ๐Ÿ˜ข

        http://forums.sketchucation.com/viewtopic.php?f=180&t=46183&p=413432

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • D Offline
          dacastror
          last edited by 1 Jul 2012, 00:36

          I know you helped me very much, sorry for asking much just I want to learn

          1 Reply Last reply Reply Quote 0
          • T Offline
            thomthom
            last edited by 1 Jul 2012, 20:42

            Check out the source of this plugin that draws edges of the boundingbox: http://forums.sketchucation.com/viewtopic.php?t=29377#p256536

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

            1 Reply Last reply Reply Quote 0
            • D Offline
              dacastror
              last edited by 2 Jul 2012, 17:50

              @thomthom said:

              Check out the source of this plugin that draws edges of the boundingbox: http://forums.sketchucation.com/viewtopic.php?t=29377#p256536

              Thom thank you very much.
              I know I need this in lines 66 to 68 of your code:

              definition = self.get_definition(entity) bb = definition.bounds pts = self.bound_points(bb).map { |pt| pt.transform( entity.transformation )

              is a shame that is not yet ready to understand these lines clearly, however I will be very useful, very grateful

              (sorry for my bad English)

              1 Reply Last reply Reply Quote 0
              • T Offline
                thomthom
                last edited by 2 Jul 2012, 18:33

                Get's the ComponentDefinition of the ComponentInstance or Group
                definition = self.get_definition(entity)

                Get's the bounds of the definition - note that if you get the bounds of the instance it will be a Boundingbox aligned to the model axis - not the instance axis. Which is why you need to get the definition bounds.
                bb = definition.bounds

                Now transform the points of the definition boundingbox with the transformation of the instance.
                pts = self.bound_points(bb).map { |pt| pt.transform( entity.transformation )

                In other words, get the boundingbox of the definition and apply the instance transformation to the coordinates of that boundingbox.

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

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

                Advertisement