Break the curve

Hi All, Greetings!
I have many different curves, one of which is shared below. I want to break that curve into pieces (i want to break curve when there is sudden change or near to sudden change in the curve) . I tried explode command (Just to see if it works, before trying on python) but didnot work. I request if someone can help me to achieve this using rhinopython

Input:

Output expected (To break curves nearby red lines):

CAD file:
a1.stp (4.4 KB)

Thank you in advance :slight_smile:

Try the “Split” command with the “Point” command line option.

Hi Siemen,
Thanks for the reply.

The constraint is that i cannot have manual intervention. It should all be done automatically.
I can create point grid on the curve but rest all should happen without manual intervention.

maybe with the divide command but I don’t know the sintax

Hi Diego,
Thanks for the reply.

Divide command divides the curve equally. I wanted to break the curves where there is sudden or near to sudden change in the curve.

What’s the logic for splitting it in those places marked in red but not in other similar places like I marked below in blue?

Hi Siemen,
As there were sharp change near by those blue lines (i.e, before and after), so i did not choose it. But i am still okay, if those gets identified.

It seems to me that any decision on cut location needs to be based on the local curvature. Perhaps by sampling the curvature as a function of the curve parameter at sufficient density for your task you could then find local maxima and split there. I haven’t checked, but perhaps RhinoCommon has functions that will help you do that.

or near to sudden change in the curve
or you can also use grasshopper for example

1 Like

Hi @sumuk,

Here is some sample code that splits a curve at discontinuities. It’s in C#, but you should be able to convert to Python.

– Dale