I have several groups(branches) of Breps (red groups on the left), and I am trying to overlap all Breps inside one branch, like I was able to do for some of the Breps on the right (green)
The problem comes when there are “symmetrical” breps. That means that they are symmetrical in one or both directions based on their centroid. Like the ones below
I am not able to come up with any other idea how this could be done, and I would appreciate it if someone had a similar situation, or if there are some ideas on how it can be solved
Question:
I see you’re constructing specific planes based on edge directions - not sure that was necessary for groups of identical breps? In that case, you could find one plane per group, orient, and repeat (“duplicate”) the rest? Is there a specific requirement for the plane directions for both origin and target planes?
Meanwhile, a note: my ‘lazy’ approach used FitPlane as a shortcut. However the question remains regarding specific plane direction requirements, if any. For instance, related to that:
thanks for the help. Breps are in the groups(branches), but in the same bench, it can happen that they are not identical. For that reason, I need to orient each brep, and I can not duplicate them.
What is the same for each branch is that the general shape of the breps on that branch is the same, like the number of flat, curved surfaces, etc.
The problem is that, for example, 2 breps in the middle are a mirrored version of each other. I was able to find the planes in my gh definition for those that are not symmetrical, like those in the middle,but the problem are the ones that are “simpler” so they are symmetric in relation to “X” and “Y” axis going trough the center of the beep
What you are asking for (a check for geometric similarity) is alot.
Theoretically, you could brute force your way through every permutation of orientation between a source and target geometry, and compare them for least deviation to find the most similar alignment. Then, to test for similarity, you could boolean intersect the solids and check for an empty set.
However, that is a very heavy process; one that grows exponentially for every hole or corner added to the BREP and every extra construction piece you want to compare. And there is no guarentee that intersecting similar solids will create an empty set within rounding error.
I would consult the Grasshopper Developer forum to ask if anyone has created a script that tests for the geometric similarity in BREPs. It seems like a problem someone out there has already had the need to solve. Also search for a plug-in that might have this functionality.
as you said, I find also that “brute force” approach is not a solution, especially if there are hundreds of different parts.
I have spent some time searching for similar topics and plugins but I was not able to find any functional solution. For example script here works well but it still can not distinguish mirrored Breps:
It had surprised me that until now there is no some plugin free/or with subscription that tackles this topic, considering that work of many Rhino users is related to production ready modeling.
Nevertheless I was able to make some halfway solution where I am comparing distances between breps centroid and the breps faces. The only thing is that if in the model there are some mirrored breps, that script does not recognize as different parts. Insted it groups them in the same branch as original breps
For that reason I am trying to get the breps stacked on each other and make a second check in order to identify those mirrored ones