Consolidate Duplicate Sheets

I have a nesting program that puts parts in sheets of material, it works pretty well, but it outputs duplicate sheets.

I am trying to combine these together with a count. like this:

Nested Triangles.3dm (530.9 KB)

I tried using Cull Duplicates, but apparently the duplicates need to be in the same position, or they are not considered duplicates

Remove Duplicate Sheets.gh (15.4 KB)

Anyone have any ideas on how to accomplish this comparison? I would like to compare the sheets as a whole, instead of just the individual parts. The sheets will always be the same size and in the same position.

Hello,

Here is one way of doing it but relying on a bit of luck.

It appears all your sheets are really identical, with all shapes ordered the same way. So, a “characteristic” point that could be used to represent the entire group is the middle of a polyline going through all centers of those shapes.
All the rectangles appear also to be the same which means everything can be moved to a reference rectangle centered around the origin, then it’s just a matter of creating a set from those points.

Then creating the copies with the number display. If you need to bake those back to Rhino I’d recommend Elefront.

Remove Duplicate Sheets.gh (33.4 KB)

Here is a better version that compares all the corners of the shapes.

Each vertex is associated a unique index. Then joining all indexes in a single string, it’s just a matter of comparing those strings with Create Set. Same result but slightly safer approach.

Remove Duplicate Sheets_stringcompare.gh (34.6 KB)

@magicteddy that is awesome!
I’m trying to figure out how it works.

how do the rectangles get in here?
Screenshot 2023-03-02 081343

Edit, I figured out a way to get the rectangles in there, I added some filters by layer:

I do need to bake the results back, I do have Elefront, is there a way to bake it and retain the colors and layers of the originals somehow?

I used SelColor in Rhino to select the rectangles.

Yes you can use Get Rhino Attributes to get the original layers and colors (though the layer appears to be Default for all shapes) and Define Object Attributes to set the output layer and/or color back in Bake Objects.

Remove Duplicate Sheets_stringcompare.gh (45.2 KB)

1 Like

Thanks! I’ll give that a try, I will be having different layer names as well. I think I might try getting Grasshopper to colorize each unique shape instead of coloring them myself. It looks like I could feed my modified color into ‘Define Object Attributes’ if I wanted to.

What I really want nested in this configuration is a much more complex block that is going to contain the perimeter geometry, as well as some drill holes, engraving marks, 3D Tilt lines, etc… the nesting program can’t nest my blocks, or anything other than the outline of the part.

I see Elefront has some block components. I was able to get my original blocks in and separate out the outline curve, so I think I can match up my original curves with the copies by maybe comparing their area and/or perimeter length, but the question is, is there some way that I can make copies of the original blocks in the new positions and rotate them to the correct orientation? That way I will end up with my blocks nested, and all the features within the blocks will be in the correct orientation. Is this possible with Grasshopper or will I need a script to run in Rhino to do this? I would normally do _Orient in Rhino do this. If Grasshopper had something similar I think I could use the start point and end point of the first segment of the Polyline to get the orientation correct, or something like that.

I guess I can’t internalize data when using bocks, or filtering on Layer, so here’s the Rhino file and the Grasshopper file:
Remove Duplicate Sheets_stringcompare_Blocks.gh (46.4 KB)
Nested Triangles with Blocks.3dm (652.2 KB)

Here is a solution using the color as the way to map the block back to the contour you used for nesting. Maybe your nesting procedure keeps some attributes ? Or returns a list of map indices from the source geometry you could use to directly get the correct block.

Then Orient using the first segment works.
You could simplify this process if all your blocks had their first segment aligned with X axis, and the origin at 0, thus you would use XY plane as the source.

Remove Duplicate Sheets_stringcompare_Blocks.gh (46.9 KB)

1 Like

Thank you very much! That works great!

I’m pretty sure it only keeps the color, the layer seems to always be whatever the default layer is. But matching by color is fine, there are lots of colors to choose from. I haven’t fully developed the blocks yet, so I can assign the perimeter curve a unique color. I could also build the blocks aligned with the X and the origin at 0.

Thanks for your help! it’s very much appreciated!