sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

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

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 3 Posters 361 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

      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

        help 😢

        1 Reply Last reply Reply Quote 0
        • Dan RathbunD Offline
          Dan Rathbun
          last edited by

          @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

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

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

              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

                @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
                • thomthomT Offline
                  thomthom
                  last edited by

                  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
                  • First post
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement