Hello EveryBody,

Hope you are all Fine.

I’ve been facing a problem in wich i have to place a family that cuts a slab.

I managed to do Half of the work. As you can see in the image below, i inserted a family that cuts the slab. It is cutting the right slab with the right Diameter.

However, when there is pipes whose distance to another is less than 6 centimeters i want to group then, and place a single retangular family to comprise all of the pipes in the area.

Yes this is possible.

- Add all families to a single list.
- Take any one circle, and remove it from the list and place it in a new list.
- Offset the circle by your 6cm offset.
- Do a bounding box intersection test with the rest of the list.
- For any true results add the circles to the new list, and remove them from single list. Repeat the offset and bounding box intersection test in steps 3 and 4.
- Repeat step 5 until no more circles are intersecting. The resulting list is your rectangular opening.
- Return to step 2 (which should be n+adjacent n less than when you started), and repeat steps 2-6 until no more circles are in the list.
- The if the list length for each n grouping is greater than 1 it needs a rectangular opening placed at the center point and scaled up. You could try the center point of a line by best fit through center points, or the centroid of the convex hull to find the insertion point.
- You can then do a bounding box or other method to find the length/width of your opening family.

Good luck

Try the Geometry.GroupByDistance node from spring nodes.

I used that node and it nearly solved my problem. it grouped the points that are distant by 6 cm, however, in a rather awkward manner.

Have a look

We can clearly see that the circle [0,0,0] is too far from [0,0,3…6]

It would create a really long shaft and that is not what i’m looking for.

any Suggestion?

I thought about doing that but it didn’t work… and it won’t work for a lot of pipes…

However i thought about doing something with statistics calculus… Something like creating an average point and measuring the distance of all circle center points to this average point. Than calculate the average of that distance, and group the ones with the highest standard deviation in another group…

@ramoon.bandeira Would this serve your purpose?

- Pair closest circles
- Filter out circles that are beyond the specified distance (0.5, in the example below)
- Create rectangular boundary around circle pair

groupCircles.dyn (42.8 KB)