Having hard time creating uniform Brep

I have this definition making a series of roof rafters. I want to analyze each rafter using brep explode. However qwhen I select a side, I get different results. How would I make each rafter have the same properties so when I select a side, they are all uniform. Attached is screen shot showing problem and grasshopper definition. Thanks!

060925_BREP Irregularity.gh (48.9 KB)


I think you might have to use some logic to select the edge index that you need instead of trying to make sure that the index you want is always the same.

For example, if you take the midpoint of each edge and then the distance from that midpoint to a curve running around the top of all the Breps, you can then sort by distance and sort the edge indices synchronously to get the index of the edge closest top the curve.

There might be some better logic that always gets the index of the edge you need.

You know I’m trying different sorting techniques. Struggling to make something work.

They seem to be consistent when I number the midpoints


Which edge are you trying to get?

I get different values for the different sides. See screenshot.


I’m trying to get bottom edge

This post has an example of getting the top edge of surfaces by sorting Z values of their midpoints.

1 Like

In summary, what you’re seeing is normal behavior.

Similar to what Martyn suggests, if your goal is to select the same edge from each surface with an index value, you must sort the four edges of each surface around their plane first (this requires that their planes are also previously aligned consistently):


060925_BREP Irregularity_1.gh (43.9 KB)

If you don’t want to sort edges around aligned planes, then you still have to sort the edge points, as Joseph suggests, so you are able to pick the lowest one.

1 Like

Thanks so much that is very helpful. Now I have another conundrum. When I reparametrize the curves, the points move differently. How can I make these curves all the same. See Screenshot. I added the definition as well.


Brep Irregularity_2.gh (43.6 KB)

1 Like

This is also “normal” behavior (this answer is getting old, I know, lol). It’s not uncommon for brep edges to point in different directions. There are multiple ways to go about this.

Nonetheless, because these edges are all essentially lines, we can do some simple stuff. One option is to find one endpoint (for example, the endpoint closest to the Rhino origin) and then the other endpoint so that the first one becomes point A and the second one becomes point B and you construct a new line for each edge. Another option, since each line is also a vector, is to compare each one against the Rhino X direction, then flip/reverse the ones pointing ‘negative’.

Check the options here:
Brep Irregularity_2b.gh (54.4 KB)

1 Like