Clearance plugin?
-
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
-
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.
-
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
-
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
-
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
-
Adam, can you show me a picture of what you mean for the first case?
-
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.
-
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
-
@unknownuser said:
Adam, can you show me a picture of what you mean for the first case?
Todd, 2 objects next to each other:
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!
Advertisement