Boost logo

Geometry :

Subject: Re: [geometry] Segment to Segment Distance
From: Arash Partow (arash_at_[hidden])
Date: 2012-05-25 07:53:23


On 20/05/2012 3:44 AM, Dan Chianucci wrote:
> Hey guys,
>
> I'm trying to find the minimum distance between two segments, however this feature doesn't seem to be supported
>

How about this:

http://code.google.com/p/wykobi/source/browse/trunk/wykobi_nd.inl#108

You can change the following line:

http://code.google.com/p/wykobi/source/browse/trunk/wykobi_nd.inl#195

to

distance((segment1[0] + (sc * u)) + (segment2[0] + (tc * v))));

It's based on 'point of closest approach' method.


Geometry list run by mateusz at loskot.net