Explode a polyline by angle?

Is there a way to explode a polyline only at points sharper than a certain angle? In other words, explode a polyline, but leave the segments joined when the angle is more open than 120* (or some other amount I determine). So the polyline would become unjoined at every joint that was sharp, and stay joined where the change in degree was shallow. Hope that’s clear enough…

Hi Heath- I dug this up- SplitAtAngle - unzip, then drag and drop for SplitAtAngle as an alias. See if that is what you need- it’s old and probably not well tested… =)



Almost perfect!

I knew a script like this was posted at some point, but as we all know, the old newsgroup is virtually impossible to search. Glad for this change.

One problem: this works on one polyline at a time. I need to do hundreds… doing them all at once would be a massive bonus.

OK, hang on a bit.

1 Like

You rock. I expect it on my desk when I get back from lunch. :wink:

Heath, I replaced the file on my Google drive- see if poking the original link gets you a new version… just curious. I’ll make another link in case: Here

1 Like

Here’s one from my library, I just quickly modded an existing similar function.

1 Like

Thanks to you both! Works like a charm. I had a ton of lines that I received that had segments that should have been arcs but were lots of little polylines. Exploding out just the hard angles, I was able to rebuild as 3 points, degree 2, just the sections that were lots of little polylines (leaving them joined) and got it all cleaned up. Saved me a ton of work. :smile:

Oh, then you might have actually wanted this one, which is the original script I modified, or this one, which is similar…

1 Like

Even more super-super awesomeness. Thanks!

@pascal, @Helvetosaur,

i’ve relinked this thread from another thread, however all the scripts posted here seem to either cause a dropbox error (Mitch) or show a CRC when extracting the zip file (Pascal). Please re-upload if possible.


1 Like

There are a lot of good scripts posted here which get buried over time with the other posts. A general repository (a huge library) would be very welcomed, I think. Or at least tell us where do you keep them all :slight_smile:

1 Like

would be a nice idea!

Hi Clement, thanks, I see that file is bogus - I do not see an original that I can get to here, but I’ll check on the office machine on Monday.


1 Like


Hi @pascal and @Helvetosaur

I have been looking all around the internet for a script that breaks a polyline when there is a specific angle between the line segments. This seems to be the only topic I could find about. But unfortunately all the downloads on this topic are not valid anymore… Any chance you have the script still laying around somewhere?

Thanks, Rick

Here is a Python script that splits curves at kink angles sharper than user input (0° = tangent). Let me know how it works and if any corrections need to be made. It should work on all kinds of polycurves, not just polylines. You can choose more than one curve to process at a time.

SplitCrvAtKinkAngle.py (3.3 KB)