Wish: SimplifyCrv with tolerance

Hi guys, I often need to simplify curves projected onto scanned meshes and thus those projected curves consists of many points.

SimplifyCrv can do a good job here, but I often wish for a tolerance setting for the tool. Can you please add that? If curve points are closer to each other than the tolerance then merge, if they deviate less than the tolerance from a straight line then delete etc.

Cheers!

1 Like

I guess maybe you’re looking for the polyline ReduceSegments() method in RhinoCommon. There is also a GH component that does this.

There are also DeleteShortSegments() and MergeColinearSegments() that might be useful.

1 Like

Close, but I wasn’t really looking for a scripting solution, I was actually wishing for SimplifyCrv to have a tolerance setting :slight_smile:

SimplifyCrv uses the file tolerance setting. But AFAIK, tolerance or no, it doesn’t do what you asked for above - except perhaps merge collinear segments and tangent arcs with same radius.

I know, that’s why I wish for it… :wink:

Can you post an example with before and after.

Here’s a before curve.
Note how the smaller curves aren’t simplified much compared to the larger ones.
Not even if I set the file tolerance to 1 mete.SimplifyCrv.3dm (37.9 KB)
(The entire smallest curve is 0.2 meter wide)

I expect simplifyCrv to respect angles larger than a given degree and then the filetolerance regarding distance between points / deviation from original curve.

Cheers

Currently SimplifyCrv does this:

The tolerances used are the file absolute and angle tolerances, as far as the options goes, I guess it would be All in this case.

What @Holo would like (if I understand correctly) is to add the following options which would be applied if the curve is determined to be a polyline:



In this case, it would probably be wise to add these as command-line options to SimplifyCrv, so people could choose to not use them.

1 Like

SPOT ON!

  • the ability to rebuild curves/curvesegments too based on the tolerance setting, not only polylines :slight_smile:
    (And note: a tolerance setting is important, so we don’t have to fiddle with the file tolerance)

So you’re asking for FitCrv to be included as well… Getting to be a bit of a monster command there.

Well… the command is called SimplifyCRV isn’t it?
Being able to simplify a curve shouldn’t be more complex for a user than reducing a mesh IMO :wink:

I put a couple simplifyCrv bugs on the list

  1. RH-60981 Add Tolerance option to SimplifyCrv command

  2. RH-60982 Improve Line merging in SimplifyCrv

Adding FitCrv and /or Rebuild into SimplifyCrv is a major reimagining of curve editing. I’d prefer to improve SimplifyCrv and see if that works first.

There are a number of other bugs along the lines of dealing with polylines as input.