sketchucation logo sketchucation
    • Login
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [plugin request] Smallest bbox for 3d geometry.

    Scheduled Pinned Locked Moved Developers' Forum
    10 Posts 7 Posters 547 Views 7 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.
    • dereiD Offline
      derei
      last edited by

      Is there any plugin that matches the smallest boundingbox for a 3d object? (not necessary a solid, but any kind of geometry that have dimension on xyz coords.)
      Let's say that I have a pillow and from some reason its axes are strange oriented. If I could orient its boundingbox in the most efficient way, then I could use better the rotation handlers that appear on bbox (with move tool).
      I can remember that I saw something similar, but for 2d faces. Or I'm confusing something here?


      bbox_notok.png


      bbox_ok.png

      DESIGNER AND ARTIST [DEREI.UK](http://derei.uk/l)

      1 Reply Last reply Reply Quote 0
      • srxS Offline
        srx
        last edited by

        I know that with Fredo scale you can edit that way. So he probably can extract this code from plugin.

        www.saurus.rs

        1 Reply Last reply Reply Quote 0
        • dereiD Offline
          derei
          last edited by

          @srx said:

          I know that with Fredo scale you can edit that way. So he probably can extract this code from plugin.

          In fact, Fredo tools don't fully orient bbox. See the image:


          bbox_rot.png

          DESIGNER AND ARTIST [DEREI.UK](http://derei.uk/l)

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

            @unknownuser said:

            @srx said:

            I know that with Fredo scale you can edit that way. So he probably can extract this code from plugin.

            In fact, Fredo tools don't fully orient bbox. See the image:

            That's because he project the vertices to a plane parallel to the ground plane and make a 2D orientation.

            I have no idea how one would calculate this.

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

            1 Reply Last reply Reply Quote 0
            • GaieusG Offline
              Gaieus
              last edited by

              Why not just reset the component axes (at least in this particular case it would not be hard).

              Normally one would create a component aligned to the axes (as it is much easier to model that way anyway) so the bounding box would be better aligned.

              Gai...

              1 Reply Last reply Reply Quote 0
              • dereiD Offline
                derei
                last edited by

                @gaieus said:

                Why not just reset the component axes (at least in this particular case it would not be hard).

                The example with the pillow is just an example. Maybe not the best one, but was the first one that came in my mind.

                DESIGNER AND ARTIST [DEREI.UK](http://derei.uk/l)

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jim
                  last edited by

                  @unknownuser said:

                  I can remember that I saw something similar, but for 2d faces. Or I'm confusing something here?

                  This? http://forums.sketchucation.com/viewtopic.php?f=180&t=13715

                  There are times when being able to set a Group/Compo to its smallest BB would be useful.

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • fredo6F Offline
                    fredo6
                    last edited by

                    @unknownuser said:

                    Is there any plugin that matches the smallest boundingbox for a 3d object? (not necessary a solid, but any kind of geometry that have dimension on xyz coords.)?

                    The solution in 3D is very time-consuming in the general case, but there is a fast solution in 2D if you give a projection plane.
                    This is what FredoScale does. The inital plane is the horizontal plane, but you can freely choose another plane by clicking on a face in the model.

                    The algorithm implies to project all vertices on the plane, determine the convex hull of all projected points, and then build the bounding boxes parallel to each of the segments of the convex hull. Then you select the one with the smallest area. Note that you may have several if the object is symmetrical (like a circle, a regular polygon, etc...).

                    Fredo

                    1 Reply Last reply Reply Quote 0
                    • dereiD Offline
                      derei
                      last edited by

                      @unknownuser said:

                      The solution in 3D is very time-consuming in the general case

                      Fredo

                      But couldn't be automated this process? There is a plugin that calculates center of gravity, if I remember right. So, from that center, I guess it can be found the closest and the farthest point in selected geometry. I don't know how much can this help, but as I'm thinking now, my intuition says that can help. But, I also know that programming is not about intuition, but about autism ๐Ÿ’š (yeah, like to those people, you must tell to the computer exactly each step).
                      On the other hand, as such plugin would process only one selection at one time, a relative long time process maybe could be reasonable. Anyway, maybe an algorithm which calculates optimal bbox for a 3d shape would be the hardest part ๐Ÿ˜„. I'm not good at math... so here a math expert would be welcomed ๐Ÿ˜†

                      DESIGNER AND ARTIST [DEREI.UK](http://derei.uk/l)

                      1 Reply Last reply Reply Quote 0
                      • honoluludesktopH Offline
                        honoluludesktop
                        last edited by

                        dereeei, My intuition just knows that you are not trying to tell a talented programmer how to program:-)

                        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