Code covered by the BSD License  

Highlights from
Fast and Robust Self-Intersections

5.0

5.0 | 6 ratings Rate this file 17 Downloads (last 30 days) File Size: 3.36 KB File ID: #13351
image thumbnail

Fast and Robust Self-Intersections

by

 

11 Dec 2006 (Updated )

Computes the self-intersections of a curve.

| Watch this File

File Information
Description

This function computes the locations where a curve self-intersects in a fast and robust way. The curve can be broken with NaNs or have vertical segments. Segments of the curve involved in each of the self-interesections are also provided.

Example of use:
N=201;
th=linspace(-3*pi,4*pi,N);
R=1;
x=R*cos(th)+linspace(0,6,N);
y=R*sin(th)+linspace(0,1,N);
t0=clock;
[x0,y0,segments]=selfintersect(x,y)
etime(clock,t0)
plot(x,y,'b',x0,y0,'.r');
axis ('equal'); grid

Acknowledgements

Fast And Robust Curve Intersections inspired this file.

This file inspired Fgt Fold Geometry Toolbox.

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
19 Feb 2014 Muyun

Mr. Canos,

It's an awesome program. But could you explain in what way is the following block of code useful, and why does it appear twice?

remove = isnan(sum(dxy1(i,:) + dxy2(j,:),2));
i(remove) = [];
j(remove) = [];

Thank you.

07 Jan 2014 Ilya

it would be helpful to show how to get the (all) values of "t", at which the intersections occur.

Namely, two values of the parameter "t" correspond to each self-intersection.

06 Jan 2014 Ilya

it would be helpful to show how to get the (all) values of "t", at which the intersections occur.

06 Aug 2013 David Bazalar  
08 Jul 2010 Evgeny Pr  
14 May 2009 Robert Beardmore

It certainly is very good and saved me a lot of bother!!

24 Jan 2008 Joseph Marks

This is really great !!!

And I just needed it, too !!!

THANKS VERY MUCH !!!

Sincerely,
Joseph

Contact us