Is there a command to select adjacent surfaces similar to SelChain that works with curves?
Hi Mike - are you asking about polysurface, mesh, or subD faces?
-Pascal
Good question…polysurface.
So, the idea would be to select a starting face(s) and propogate the face selection from there - any (joined) face, or tangent ones? Do you have an example file? I ask because I’ve messed with this in a script from time to time and it’s not fr off working, depending on the details.
-Pascal
Here’s an example file. I can run the Selchain command (Chain Continuity = Position), select one curve, and Rhino will select the rest of the curves making up the octagon even though they are not joined. I want to do the same thing with the surfaces that make up the octagon.
Temp4.3dm (90.7 KB)
Ah, so what you want is not adjacent faces in a polysurface but free surfaces and polysurfaces. This is probably doable but also possibly a bit of work UI wise to handle such things as branching, which is not something that typically occurs in a polysurface .
-Pascal
I guess that it will also require some tolerance settings, because often times adjacent surfaces are not perfectly matched to each other, leaving a tiny gap in-between.
3DS Max has selection tools called “Grow selection” and “Shrink selection”, which will add or remove the next selected objects with each click.
Yep, it gets complicated too because you need to know which faces to compare, to keep things fast. Within a brep, subobject face selection works OK, enough to be useful I think.
SelectTangentFaces.py (12.6 KB)
@Rhino_Bulgaria updated here again to not select single faces.
-Pascal
Is it possible to select one surface or polisurface, then run a script to select all adjacent surfaces and polisurfaces within a custom set tolerance? (like 0,5 mm)
I usually keep my models as separate surfaces until I finish the whole object, then join everything together. Such script could make the selection of adjacent surfaces a breeze.
Recently I also dealt with someone’s model made in Solidworks that was exploded into thousands of separate surfaces. It was extremely slow to sort out the surfaces and join them as separate components.
Hi Bobi - yes, that is the goal, the script above is step 1. I’ll see if I can muster enough brain cells.
-Pascal
Ah, OK. I thought that the script above only selects tangent surfaces. I will download and test it now.
Oops, looks like there is some issue with the script (at least on my PC). I get this error message:
---------------------------
Exception Occured
---------------------------
Message: Index was outside the bounds of the array.
Traceback:
line 183, in get_tangent_faces, "D:\PROGRAMI\Rhinoceros 7\Добавки\Select adjacent surfaces\SelectTangentFaces.py"
line 217, in SelectAdjacentTangentFaces, "D:\PROGRAMI\Rhinoceros 7\Добавки\Select adjacent surfaces\SelectTangentFaces.py"
line 363, in SelectTangentFaces, "D:\PROGRAMI\Rhinoceros 7\Добавки\Select adjacent surfaces\SelectTangentFaces.py"
line 370, in <module>, "D:\PROGRAMI\Rhinoceros 7\Добавки\Select adjacent surfaces\SelectTangentFaces.py"
---------------------------
OK
---------------------------
There is no error when I pick a flat surface. I like the Command line options, too. Great job on this, Pascal!
However, picking any curved surfaces brings the same error again. I tried it with these 3dm models:
Fillets are easy in Rhino.3dm (402.3 KB)
Funny results with Blend surface.3dm (596.5 KB)
I also noticed that it’s impossible to cancel the command by pressing the Esc key while using a surface as a sub-object part of a joined polysurface as a starting surface. Only Enter is accepted to end the command, otherwise it remains forever active. I tested it with this scene:
Male and female.rar (18.0 MB)
Hi Bobi - thanks - single, unbjoined surfaces should not be allowed - I was only catching this in the case of an extrusion object. I’ll update the script shortly.
Yeah, Esc should work, that is still broken.
-Pascal
Hi @pascal ! The updated script causes issues with my Rhino. Everytime I run it and pick a single surface Rhino freezes forever. The only way to get rid of it is to close Rhino via the Task manager.
Yep, OK,. sorry - running from the script editor, for some reason, does not have the problem; running as an external file does - as it should, there was a mistake in there. Fixed above. (let me know)
-Pascal
This time there is no crash. However, I’m unable to select adjacent surfaces that are not joined together. The script grows the selection of joined surfaces only. Is it possible to make an alternative version which will also select separate (not joined) adjacent surfaces?
P.S.: One good thing about this script is that it can be used to detect joined surfaces that don’t meet the criteria for the custom set AngleTolerance.
That’s right, that is what I said way above - this currently works as face selection within a polysurface.
-Pascal
Hi @Rhino_Bulgaria ,
There you go, It should do precisely as you asked. It gets a brep and allows you to select a tollerance, it will select all objects that are adjacent within that distance. If tollerance is set to 0, It will only select adjacent objects.
I think this does precisely what you asked. Let me know !
Utility.rhp (13 KB)
Hope this helps,
Farouk
Hi @farouk.serragedine ! I just tried to use your plug-in, but for some reason it’s missing from the list of plug-ins in my Rhino 7. Also, it should use some command, but I can’t figure out which is it. Any suggestions?
EDIT: I just installed it the other way, from the “Install” button. Dragging the rhp file didn’t worked before.
It adds two commands:
AdjFaces
ShortestPathSafe
EDIT 2: I tried it with the following 3d model and for some reason I can’t select all adjacent surfaces, despite that the “Edge continuity” tool reports zero gap between the surfaces. Even if I use a value of 1 for the tolerance, only a few surfaces are selected, while others remain unselected. Is there some trick that I miss? Only if I set tolerance to 100, then all adjacent surfaces are selected. Is that value a percentage or file tolerance in units? (I use millimeters)
Test select adjacent surfaces.3dm (475.2 KB)
For example, when I pick the large horizontal surface in the middle of the model and set a value of 5, the plug-in selects the following faces. Note that it also selects two of the vertical surfaces that are not connected to the other selected surfaces.
The plug-in looks promising, I think it’s just a matter of fine tuning to figure out why it does that.
P.S.: What the ShortestPathSafe
command do? I ran it several times, but can’t figure out how to proceed once the Command prompt asks me to pick a Start for something.
Oooh, that almost sounds like a way to select all faces between a start face and an end face (ie, when you want to select fillets for example). Can it do that?