Comparing two sets of Breps

Hi all,

I have two sets of Breps which have exactly the same geometry (vertices positions), but the first set has some data (User Defined Dictionary values) I want to transfer to the second. I need a script or workflow which allows me to compare the two sets, and then copy the dictionary value from one to the other.

I know you can use DeBrep to get the Vertcies, and I could then compare these, but how do I then relate this back to the original Brep?

Still fairly new to all this so please assume I know almost nothing!

Thanks in advance!

Chris

This should be possible with Elefront

Thanks Martin, however, I want to do this without using proprietary components. I also can’t get Elefront to work- I’m Rhino 7.

Chris

I’m using Elefront in Rhino 7 so that should not be the problem.

You could probably scipt it somehow but I cannot help you with that.

I’m running the Elefront 6 in rhino 7, works fine (the Elefront 7 is more of a beta right now I think).

I understand the desire for less proprietary plugins, but that plugin is used in pretty much every big architecture companies that have strong automated workflows (bim/gh).

Of course that doesn’t make it mandatory at all, it’s up to you :slight_smile:

If you want to stay on vanilla grasshopper, you’ll need to do custom python/c# scripts for that I believe…

1 Like

If you want an alternative there is also the Human plugin. It has very similar features to Elefront, but I find it has some unique features and ways of working that I find more intuitive.

Just install it via PackageManager and you’re good to go.

1 Like

@Chris38 you can run both versions of elefront in R7 by following these instructions:

1 Like

Thanks Evan. I followed these instructions, but I can’t see anything in Grasshopper. Presumably I should have a load of new menus?

Thanks Antoine, I take your point. But if I am distributing this workflow to others, it creates a load of dependencies. But I’ll try Elefront for now. :slight_smile:

Ok had a play around and got it to appear! No idea what I did to make it happen.

Hi Martin,

I’ve had a play with Elefront but not sure how it helps me with my problem. I want to compare two sets of Breps and where there is a match (in their geometry and position), to pass over an attribute (User Dictionary Key and Value). This is probably all pretty easy for someone with experience with Grasshopper!

Chris

Please post an example file with some geometry…

Hi Martin,

See attached. There’s not much to show as I’m really not sure how to proceed. The geometry is 2 boxes that have been copied, with the copy placed on top of the original. This is to simulate having two sets of Breps with the same geometry (including location). My actual workflow will generate the second set of Breps by another route, but the outcome will be the same.
Match Breps.3dm (31.8 KB)

Match Breps.gh (8.1 KB)

Thanks!

Chris

If the vertices of the two items in the original set and copied set are identical, you do not need to compare all points. Instead you can simply find the closest point. Copy Attribute User Text from one set to an identical other set like this:

Match Breps.gh (26.5 KB)

Match Breps.3dm (58.2 KB)

2 Likes

@martinsiegrist , thanks so much- this is brilliant, and has massively helped my general learning as well as the specific problem. A few questions for you:

  1. The closest point is smart, but I guess it’s possible that two non-identical breps could have the same centroid?
  2. With the Modify Rhino Object Attributes component, how does this know to overwrite the previous key and value, rather than adding a new one?
  3. With my workflow it’s possible that the copied breps might be in a different order to the original. What would be a good way to reference to the new, perhaps with another user attribute? (which relates to 2)- this component overwrites rather than adds?

Thanks!

Chris

Instead of just using the centroid, you could also check if the volume is the same. I’m not sure how to check the vertices especially if they are maybe not in the exact same orientation.

When a bake name is used, previously baked objects with the same name are overwritten. All objects need a name so they can be referenced and sorted in the correct order.

1 Like

I think there is still an issue here, as some shapes can have both the same volume and the same centroid- a pipe, for example. I may need to explore some alternative approaches with Vertices. Thanks though- what I have now is working for 99% of cases.