How Accurate SelDup is?

Hi all,

Can someone explain why the SelDup command doesn’t find the identical overlapping curves?
overlapping_inaccurate_seldup.3dm (86.0 KB)

The unit settings that i use are shown below

image

SelDup only finds 100% identical geometry. In your case, the Y-coordinate of each pair of lines is slightly different - by something completely sub microscopic…

Unfortunately, I think the check for the same coordinates goes out to 1e-12 (12 digits past the decimal place) and you are the same only out to 10. I agree this is annoying.

If you use SetPt and set the Y’s to 0, then SelDup works.

So I guess the answer to your question in the title “How Accurate SelDup is?”
is “Too accurate…”

1 Like

Hi @g.synetos
Here are some additional info’s that may help to understand how it works under the hood…


John Brock
McNeel

May '14

SelDup is about as good as it gets for automatic tools. The command was created because so many DWG/DXF files have extraneous perfect duplicates. If a curve has it’s direction reversed or anything else so it isn’t a perfect duplicate, then SelDup won’t find it.

Regards
Rodolfo Santos

Blockquote

Holy crap… Impracticable accurate…
So I guess, there is no workaround such as script with SelDup with tolerance functionality?

John BrockMcNeel

May '14

Sorry, scripting is beyond my pay grade.
I have no idea how you would go about comparing similar curves within some control parameters.

A good question …

Regards
Rodolfo Santos.

The question is too theoretical but a rough approximation could be the following.
If 2 objects are interesecting and the length of intersection is for example 99.9% of the length of these objects these can be assumed as overalpping objects.

You could try this one…
SelNearDupCrvs.py (4.9 KB)

1 Like

Yes that worked!!
Thanks alot!!

i also stumble into such problems occasionally. would be helpful if this command would have some sort of tolerance setting. messing with the document tolerances did not help, i would have thought that should do?

Nope, SelDup does not look at the document tolerances.

is that a logical conclusion or how would you know that?

No, that’s just from practical experience with the command as well as what’s been said here about it since 20 years or so.

As far as I know it’s all based on this core function, which as you can see from the API reference does not have a tolerance argument.

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_GeometryBase_GeometryEquals.htm

In general with these functions, if there is no tolerance argument they use either the built-in “zero tolerance”

https://developer.rhino3d.com/api/RhinoCommon/html/F_Rhino_RhinoMath_ZeroTolerance.htm

or something similar like “square root epsilon”.

https://developer.rhino3d.com/api/RhinoCommon/html/F_Rhino_RhinoMath_SqrtEpsilon.htm

1 Like