Search in similar elements


#1

Hello, in Rhino it is possible to allocate somehow all elements strongly similar for what I will specify? I specify an object and the option finds in the document all similar to it (for example).


(Pascal Golay) #2

Hi Modeler3d - yes and no - that is, you can select by object type (SelCrv, SelSrf etc), by layer, by color, by exact duplicate (SelDup) but not by ‘about the same’ What sort of attributes do you have in mind - same size? Same volume?

-Pascal


#3

Hi Pascal, the size at objects completely identical…


(Pascal Golay) #4

Hi Modeler - then… what is size? Volume (closed objects), or bounding box volume… bounding box diagonal. It’s tricky - Rhino is dumb, you need to tell it everything - with the right criteria and rules, it is probably possible to select what you need using a script, but the rules must be clear enough…

-Pascal


#5

The size identical is as 2, 3, 4, etc. of spheres with an identical radius.


(Pascal Golay) #6

But - you see the problem, right? Spheres are easy enough - but what about more complex objects? Boxes can be the same volume but very different dimensions… see what I mean? Does it qualify if the dimensions are the same but the corners are filleted? etc etc.

-Pascal


#7

#8

If you have closed volumes, you might try the following script I wrote for someone once… I suppose I could attempt a modification which might work on open objects. Not much time these days unfortunately…

FindSimilarVolumes.py (3.8 KB)

–Mitch


#9

Hi Helvetosaur, how to open him in Rhino?


#10

The easiest way for now to run it occasionally is to save it to a specific folder you know how to find (and leave it there) and then either:

From inside Rhino use _RunPythonScript and browse to the script and “Open” to run it, or

Open the Python script editor using _EditPythonScript, hit the Open button and browse to the script and open it in the editor, then run it with the green arrow button.

There are more permanent ways of setting this up under a toolbar button or alias, but try the script out first and see if it works for you.

–Mitch


#11

I have understood.

The script finds identical spheres, but with finding of identical geometry of a problem at him…


(Pascal Golay) #12

Hi Modeler3d - it is probably possible to locate similar geometry if you know ahead of time what the similarities are - for your example, the code could start by looking for identical surface area, then look at the structure of the objects that match and narrow down the search, but it it could get complicated very quickly. I’d think it is possible to make a usable tool for this that might work most of the time, but it does not currently exist.

-Pascal


#13

Hi Pascal, clear, but nothing I went a little some other way…

All thanks!:wink:


#14

The question is - what are your criteria for “identical” ? It should find exact copies of closed objects - ones you made with the Copy command - in theory at least, because all it is looking for is an identical volume, identical surface area, the same number of edges and total length of the edges. If you have modified the copies in any way, it is likely they won’t get found. If you have two identical objects you think should get found but don’t, please post them and I will look.

–Mitch


#15

Untitled.3dm (113.8 KB)


#16

Yes, well, as I said, the posted script only works with closed objects currently - your objects are open… I’ll see if I have time to fiddle with it some, no guarantees.

Try this one:

FindBrepMeshCopies.py (5.0 KB)

–Mitch