Find similar geometries

Hi,
I’m panelizing a wall facade with triangular shapes and would like to know which ones are identical. By identical I mean they should have the same edges lengths. The “sort duplicate values” component only works if I sort by using the overall lengths and not if I use the individual lengths of each edge.
Thank you in advance if you have any suggestion.

My first approach would be to:

  1. Get the boundary curve of each panel (should be a triangle)
  2. Explode it into loose line segments (there should be three of them)
  3. Measure the length of each segment.
  4. Round this length to a number of decimals that is just within your tolerance for ‘identical’.
  5. Sort the edge lengths per panel from shortest to longest. (Since it’s triangles, the ordering won’t matter, if you’re dealing with more than three edges, or if the order of edges is relevant, then sorting will destroy relevant data.)
  6. Create a textual description of your sorted lengths. For example using the Format component with a formatting pattern of {0} : {1} : {2}. Note, you can perform the rounding here too, if your measurements are in metres and your accuracy is set to 1mm, then the pattern would look like {0:0.000} : {1:0.000} : {2:0.000}.
  7. You can now compare the descriptors with each other using Set components or Text Sort, and find identical ones.

I think this is a good start but I’d be worried that simply rounding your values and trying to find duplicates is going to have some weird tolerance issues.

I nice hack since triangle have only 3 edge lengths would be to put the sorted length values as x, y, z coordinates of a point or vector object and run one of the many components to deal with duplicate points.

I’m curious to see how others deal with this as it’s a fairly common problem.

1 Like

Clever.

Thanks guys for your responses. It seems that Louis suggestion would work great. I thought about it myself but then my problem was how to convert that list of lists into 3 dimensional points. I tried the “construct point” component but it creates a point from each single edge length

You have extract your lists of edge lengths into separate values. Each list probably contains three numbers, one for each edge length. You should use List Item to extract the first, second and third items out of this list (that’s index 0, 1, and 2). You can then feed these three distinct values into the x, y, and z inputs of construct point.

Use the handy Numbers to Point component.


Nums2Pt.gh (5.6 KB)

Thank you very much for your suggestion: this solves the issue that I was having. I think in order to run the optimization that I am trying to do, I will have to include the rounding that David suggested in his first post but I don’t fully understand it. I also created another subject line that specifically addresses the optimization with galapagos, so if you would like to take a look that would be much appreciated. I have attached here a screenshot of the script that sorts the unique points.

FYI, you don’t need 3 list items. You can output all 3 from 1 list item by clicking the little plus signs on the list items output side. You could also use numbers to points instead as I show above.

Numbers to point works as well

Thank you very much to everybody who replied to this discussion. Please if you are versed in galapagos you can join the following discussion where I’m trying to optimize panels sizes using galapagos: