SimplifyCrv makes curve more complicated?

Not sure if this is expected but I have a curve which when I try to explode it says
“Cannot explode single curve segments.” This is great.

Now, when I simplify this curve and try to explode it, I suddenly get 9 Curve segments.

Is this expected behaviour? This is causing issues in a plugin I’ve been working on and in this particular case I’d prefer it to stay 1 curve after SimplifyCrv.


210705 SimplifyCrv.3dm (38.2 KB)

That curve has a bunch of internal kinks… Not sure how it got that way, but turn on Curve Graph:

It ain’t smooth…

So SimplifyCrv splits it at the kinks. The segments correspond with the kinks you see in the Curve Graph.

You could rebuild the original to a single span within around 0.4 units, or…

Edit:
RemoveMultiKnot will also take the kinks out and reduce the point count to 15 from 34… CurveDeviation from original around 0.004. But not as smooth as a single span rebuild of course.

So from command help

SimplifyCrv | Rhino 3-D modeling

The SimplifyCrv command replaces each curve segment that has the geometry of a line or an arc with a true line or arc.

Note

  • SimplifyCrv also combines consecutive co-linear and co-circular segments.
  • NURBS curves are broken apart at knot.

_RebuildCrvNonUniform :mag:

Did your plug-in create the original curve? Is it an intersection of 2 surfaces, etc.? Please post the parent geometry.

@spb The plug-in didn’t create the original curve. It’s indeed an intersection of 2 surfaces which then got unrolled. Is this a common thing with intersecting surfaces?

Yes if the input curves are degree 2, or if the surfaces have multiknots.

@siemen

Even the intersection of uniform degree 3 surfaces can have fully multiple interior knots. Some of my scripts simplify curve output, some even the input, but this may (sometimes?) be addressing a symptom.

So it seems the surface-x-surface intersector is a big culprit in putting in too many knots.
Lets discuss in another thread