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

    Clearance plugin?

    Scheduled Pinned Locked Moved Developers' Forum
    9 Posts 5 Posters 1.0k 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.
    • M Offline
      midlana42
      last edited by

      I'd like to find a plugin that gives the closest distance between two selected elements. I've searched but not found anything.

      Thanks!

      Kurt

      1 Reply Last reply Reply Quote 0
      • M Offline
        midlana42
        last edited by

        Maybe I need to rephrase the question. Is there a plugin that displays the shortest distance between two elements? For example, a 1" radius circle is clicked, along with a line that passes 3" from the center of the circle, showing that the clearence (miminum distance between the elements) is 2". Once 3D is thrown into the mix it can be difficult to acertain clearances between objects.

        1 Reply Last reply Reply Quote 0
        • Chris FullmerC Offline
          Chris Fullmer
          last edited by

          I'm pretty sure there is no such script avaialble, though Todd might have written one previously for a client. Maybe the qustion should be asked in the ruby forum where all the ruby gurus hang out and perhaps someone could tackle the problem for you. Good luck!

          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
            todd burch
            last edited by

            I'm pretty sure there isn't one, but one could be written. I go through this particular logic with CloseOpens.

            If the particular use-case was to select two groups (or 2 comps, or a group and a comp), the script would be pretty straight forward.

            Note that for your example, where you wanted a tangent line to an arc, the closest distance between the two entities might not be a line that could be drawn to touch both entities (Since SketchUp's arcs are not really arcs).

            Todd

            1 Reply Last reply Reply Quote 0
            • AdamBA Offline
              AdamB
              last edited by

              Hey Todd,

              For 2 arbitrary (non-convex) polytopes that's one mother of a problem to solve. Love to hear your simple solution. πŸ˜•

              Now if its convex, then a line between the 2 hulls and project onto the line and you're done.

              Adam

              Developer of LightUp Click for website

              1 Reply Last reply Reply Quote 0
              • T Offline
                todd burch
                last edited by

                Adam, can you show me a picture of what you mean for the first case?

                1 Reply Last reply Reply Quote 0
                • D Offline
                  david.
                  last edited by

                  I haven't done any detailed analysis of this, but, I think a brute force method would give a reasonably simple and reasonably approximate result. The computational complexity might likely be on the order of the product of the number of the edges contained between any 2 entities. I'm curious about more specifics regarding the use case, as Todd asked.

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    midlana42
                    last edited by

                    I've not (yet) written a Ruby script, but thinking the problem through I don't see an elegant solution. Well, if Ruby can take the derivative of an equation to find the zero slope points, looking for minimum distances, that would be the most elegant. Short of that it's probably down to a more knuckle-dragging method of cycling through every segment vs. the opposite element. Another way is a binary search, where you try going half way down one segment, check the distance, then try going half way in each other direction and see if the resulting distance is shorter. That actually can work pretty fast, ten interation can get you down to 0.001" accuracy. Just some ideas from a non-Ruby guy πŸ˜‰

                    BTW, my example was just that, but typical of what I'd use it for. I'm building a tube-frame chassis for a sports car (http://www.midlana.com) and knowing how close one tube is to another, or a wheel, or a tank, or whatever, is important. Obviously I can figure it out the hard way with the measuring tool, eyeballing it and gradually closing in on the minimum value, but a plugin would be a huge timesaver. Thanks for the comments, guys.

                    Kurt

                    1 Reply Last reply Reply Quote 0
                    • AdamBA Offline
                      AdamB
                      last edited by

                      @unknownuser said:

                      Adam, can you show me a picture of what you mean for the first case?

                      Todd, 2 objects next to each other:

                      SketchUpScreenSnapz005.png

                      Whats the smallest clearance? ie You can't do this by examining vertices.

                      Typically you'd use GJK to crawl around the surface. But I seem to remember GJK is just for convex hulls - one of the many many reasons physics packages only deal with collections of convex hulls. (its an interesting subject - imagine a tumbling object through space with a protruding part and the incredibly complex path the tip of that protrusion traces.)

                      Adam

                      EDIT:
                      I realized I claimed earlier that convex shapes would be simple.. I meant that with simple interval arithmetic you can find a separating plane etc. Nothing is ever simple..the devil is always in the details!

                      Developer of LightUp Click for website

                      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