FitCrv Tolerance Issue

Hi all

Hoping for some help with an issue that’s plagued me for years. I often need to edit contours, and many GIS files that I receive have 1 degree curves. To create something more pleasing, my workflow is as follows:

Rebuild (to a very high number, degree 3)
FitCrv (messing with tolerance to achieve something reasonable)

However, almost invariably, fitcrv creates a few points that are way, way outside tolerance (going right beyond the extents of the project.

Can anyone advise me on why this happens and how to fix it? I understand one answer is a tighter tolerance, but there’s a point when it stops making sense.

See screenshot attached please.

Hi Nico - if you can post a file with one or two of the original curves, or send to to my attention, and with a link back here in your comments, I’ll take a look.


Hi Pascal

I’m attaching a file with the original contour, my rebuilt contour, and then the fitcrv.
I think I’ve already figured out one part of the issue, which is when I take the curves out individually into a separate file and perform the Fit there, it works fine. Strange.


Contours.3dm (121.3 KB)

This might be another problem - a point on your curve is

Point in world coordinates = 3127393618.565,-2419352838.152,0.000

That’s way out there and I would look into working in meters for objects this size at least.

I ran into fixing contour line data all the time in my former job, so I wrote a fix tool. (7.0 KB)

You can play with the options notably the fitting tolerance and smoothing. It can output polylines or splines as you wish. I had written a nice tutorial in both English and French but it seems to have been left on the school network, I can’t find it here… so I only see the one in French which is up on the school website. I will try to get the English one back this week… I think the point count reduction percentage is incorrect though, been meaning to look into that.

Here is the result with the tolerance set at 100 (your curve is HUGE in mm), and output set to splines.

CombCrvFix.3dm (133.4 KB)

Thanks for this, it’s definitely a unit issue. The plugin looks good, but can’t quite figure out what all the options do - thanks for sending it!

I forgot to post the tutorial file… Here it is.
Fixing and smoothing contour curves_EN.pdf (1.4 MB)

Thank you, this is really amazing.

Bringing this back to life just to mention a strange error in the script - it appears I can’t set the tolerance to less than 1, even if the manual suggests it, any ideas what might cause this?


Is your file absolute tolerance set to 1.0? The script is designed to not accept a value for the fitting tolerance that is less than the file absolute tolerance.

Genius, that was the issue. Thank you!