SelDup or End Snap Bug?

I’m starting to regret getting RH7 a little now.

Can someone please explain why SelDup is not picking up all instances. Either it is way too accurate that it’s not (I’ve read this thread - How Accurate SelDup is? - #12 by Helvetosaur) or end snap is not 100% accurate. Either way this is very concerning as these are two very important and widely used commands.

SelDup.3dm (57.8 KB)

Any reply will be much appreciated.
H

Hi -

For SelDup to find a duplicate, the objects need to be the same. In your example, the start points of the curves are different in the one case, but not the other:
image

-wim

Thanks for your reply Wim - appreciated. However, I’m struggling to see how that requirement for SelDup is useful. It seems counterproductive. And there is no way to change the start point of a closed polyline in native Rhino, is there? Imagine a messy file comes into your inbox and you need to clean it up before proceeding - which happens a lot in the real world - are we expected to redraw from scratch? I hope this is improved. H

The answer is that it’s not always useful, it’s just practical to compute. Calculating whether geometry is congruent but slightly off, or merely overlapping, for n! cases is not really feasible. Throwing everything into a hash table or something and looking for clashes, however, is.

If the curves are closed, CurveBoolean command is useful - it can make new curves on top of the old, overlapping curves.

@jsb.walker but it can be so very useful. The developers at McNeel are a smart bunch - they gave us Rhino after all. The most junior of them could probably stick in the option to not select start points before I blink twice.

SelDup

H

@andrew.nowicki thanks for the tip. I really do love this forum. For every RH problem I come across, I get an additional tip/trick for use in the future. For the task at hand I need control over where the start points of the polylines are. I was using SelDup just to check the redrawn curves were identical to the old ones. H

I genuinely cannot think of a case where that would be useful, outside of whatever you’re attempting to do here. When I think about useful features for selecting duplicate geometry, I think about overlaps between different curve types, finding partial overlaps with the option to split curves at the end points of the overlap, and finding near overlaps where geometry appears to be overlapping but is slightly deformed or translated. These are not easy problems to solve.

The frequency I encounter perfectly overlapping geometry with different start and end points is negligible to the point I don’t remember it ever happening. You’d have to deliberately redraw the exact same geometry from a different start point. But most duplicate lines are the result of an errant copy and paste that you didn’t notice.

I’m just struggling to understand why you think that the way the seldup command currently works is counterproductive. It selects exactly duplicate geometry. It sucks that there is no magic unbadify command that you can use to fix poorly drawn CAD files with a bunch of randomly overlapping geometry, but I don’t think that any CAD software offers that feature.

Otherwise, I can share two of the techniques I use to clean up overlapping lines:

The first is to select the offending part of the file and use the intersect command to find where everything intersects. Then split all the curves at the intersection points. Running seldup on this set will find most partially intersecting lines. The main issue with this, is that it can be a nightmare to rejoin everything at the end.

The second is to just use the make2d command. If you don’t care about perfect accuracy, make2d will only keep a single set of any overlapping lines.

@jsb.walker are you seriously suggesting badly drawn CAD with overlapping curves aren’t a frequent occurrence. Not sure which field you are in but in architecture it happens - file conversions, differing tolerances, and just plain bad drawings… I’m happy for you if you are fortunate to have control over all the files you work on - many of us don’t.

I use Rhino so can’t comment on others. But if they are also unable to select duplicates in a controlled way, so what? Rhino is better than the rest, no? You must admit, having the option as suggested is useful. R7 has a SelDup tool. Is it that difficult to tweak it? And if done, then only Rhino will have a “magic unbadify command”.

Thanks for sharing your techniques. I do appreciate the time you took to write them. In this situation, I’m unable to identify the offending lines and I’ve never been a fan of Make2D for the same reason you pointed out - inaccuracy.

Not to worry, it seems a redraw is required.

H

Oh no, I deal with badly drawn CAD files all the time. I’m just saying that the specific circumstance of having an identical curve overlapping perfectly with another one and having only different start points is not a common issue, nor is it the one I’d care about them solving. Seldup does what it says on the tin, which is select exactly duplicate geometry.

I would like McNeel to implement something similar in functionality to the OVERKILL command that AutoCAD has. Which partially solves the larger problems with overlapping lines that I brought up earlier. But if they could do OVERKILL much better than ACAD does it, that would be a miracle.

Since you read the thread, I assume you downloaded the tool I posted there as well. It does select your ‘near-dup’ curves, no problem. SelNearDupCrvs.py (5.0 KB)

End snap is accurate - point snaps in Rhino are accurate to the smallest tolerance Rhino can manage, somewhere around 1e-12.

Not sure that is a very good approach, as you have seen, as geometrically, if the start point or direction is different, they are not “identical”.

That would be the CrvSeam command.

My assumption, and only an assumption, is SelDup looks for objects with exactly identical control points, etc, and does not compare shape or work to a tolerance. It does not compare shape, unlike the tool Hevetosaur provided.

Yep, along with some other criteria I assume such as degree, knot vector, etc. A few special cases have been added that will select with SelDup, notably reversed direction for curves and flipped normals for surfaces and polysurfaces.

Excellent!!!

I wanted to select same geometry with differing start pts.