Stack Breps on top of each other

Hi all,

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)

So far, I was able to do it for “non-symmetrical” breps. Like in the image below:

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

Thanks a lot for all help!

SortBreps.gh (1.6 MB)

Check if this helps:
SortBreps_b.gh (1.6 MB)

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?

1 Like

So you’re not really checking if the groups (branches) contain similar objects?

1 Like

I meant to ask the same thing. We’ll see what @vector.parametrics says.

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:

Does this brep need to be oriented vertically (standing)?

Hi,

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.

Hope this explains it better

1 Like

Orientation is not important as long as all breps of the same branch overlap each other

1 Like

Same goes for plane alignment? I ask given your attempt to construct planes using the edges from the breps.

Like this?
SortBreps_d.gh (1.7 MB)

1 Like

The planes have to align so that the breps overlap. But how planes are in 3D or 2D space is not important.

In my second picture, you see two breps oriented in two directions, and the goal is to get the picture on the right where they overlap completely.

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.

1 Like

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

1 Like

A visual check or a scripted check?

It’s a scripted check only for the mirrored objects