Curve.Simplify broken :(

I have a curve. I am calling simplify on it. The curve that is returned is the exact same regardless of tolerance. Why might this be? I tested simplify curve in grasshopper and got correct results? Anyone know what’s goin on here?

edge = edge.Simplify(CurveSimplifyOptions.Merge,RhinoDoc.ActiveDoc.ModelAbsoluteTolerance, RhinoDoc.ActiveDoc.ModelAngleToleranceRadians) 

I have also tried other Options, nothing works.

Here is the curve in question:
simplifyCurveBug.3dm (82.6 KB)

Hi @Nick_Drian,

This seems to pretty much what the SimplifyCrv command does.

test_simplifycrv.py (715 Bytes)

– Dale

what did you expect the command / method should do ?

Maybe python is wrapping a different function than c#? It definitely does not work for me in my c# code…

It should simplify the curve? What do you mean?

In my specific case, I have a polyline curve. It has many segments that meet at near tangent. It has many very small segments. I would like to reduce the point count such that the curve is still within some position and angle tolerance.

there is also
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.polyline/reducesegments

also available as rhino command:
_ ReducePolyline

EDIT:
this command reduces your initial curve from 1171 points to 78 points with a a 0.1mm tolerance

This function does not work for me because angle tolerance is also important. I’m doing an offset after and the results of the offset are highly dependent on the retention of convex corners. There is also merge parallel segments, but that doesn’t take into account position tolerance. Essentially, I need these two functions combined. Something like simplify curve.

If it is about Polylines only:
as far as I know, Reduce Polyline uses the Douglas-Peucker Algorithm which is simple to implement.
You can adapt that algorithm for your custom needs.

Hi @Nick_Drian,

Is there a Rhino command that does what you want?

– Dale