View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Fast and Robust Self-Intersections

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

Fast and Robust Self-Intersections



11 Dec 2006 (Updated )

Computes the self-intersections of a curve.

| Watch this File

File Information

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:
axis ('equal'); grid


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 (10)
04 Jan 2017 Hauke Gravenkamp

Very helpful tool!
There appear to be exceptions where it does not work properly though, or at least it happens to find additional points which are not intersections.
I tried it with the "usapolygon" as provided by matlab:

load usapolygon
hold all

For this example, x0,y0 contains points that are obviously no intersections.

Comment only
13 Apr 2016 nasrin

nasrin (view profile)

13 Nov 2015 Thayjes Srivas

Hi, I have a questions. Is it possible to use this to reorder a polygon such that all the self intersections are removed but the same points are conserved?

Comment only
19 Feb 2014 Muyun

Muyun (view profile)

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

Ilya (view profile)

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

Ilya (view profile)

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

Evgeny Pr (view profile)

14 May 2009 Robert Beardmore

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

Comment only
24 Jan 2008 Joseph Marks

This is really great !!!

And I just needed it, too !!!



Contact us