# Perforating a curved Surface

Hi, I have a curved stair with two guard rails that I want to perforate with circles ( img: 1 ). I am working in Rhino6 and I tried accomplishing this with Grasshopper. I have perforated panels before but on a flat and not curving surface. In the grasshopper definition, I am trying to map circles to points that are on the surface, but I don’t know how to have the circles go with the curved surface ( img: 2 ). I know my definition may not be the BEST one, i am not too skilled in Grasshopper. I also want to randomize the circle sizes. Thank you for any advice I attached images below.

Post geometry.

Don’t know if I get your problem right. But if I do, unroll your surface, distribute your circles the way you want them onto the 2D surface, and then just use the Map to Surface component.

Map to surface.gh (16.2 KB)

stair curved.3dm (443.0 KB)

if you mean the Rhino6 file, here it is

Something like this?

I don’t have your circle distribution. If this method works for you, just replace my circles with yours. You have to place them onto the unrolled surfaces.

If you have your points only in 3D, you can unroll them along with your surfaces and this will make the process a lot easier.

Map to surface_2.gh (17.7 KB)

this is what i am trying to do to the stair railings, essentially. So, your first definition you sent is a good start so far

1 Like

Sorry, I’ve messed up the second one
Here you go. But you get the idea anyway.

Map to surface_2.gh (17.8 KB)

It would be a good idea to cull circles that touch the edges or overlap?

steps_2021Jan29b.gh (18.1 KB)

P.S. So you want random radius circles that don’t touch the edges or overlap or go below the treads?

2 Likes

So, I would prefer for the circles to not touch the edges. And yes, I want a random circle radius that DONT touch the edges. Is there an option to toggle between the circles touching in your definition? I am wondering because I am not sure how I would like it yet, I want to test it out for myself first

No worries just tried your new definition and yes it works. I understand the idea thank you!

Cool way to skin a cat as always Joseph! I’ve played with it a bit.

steps_2021Jan29b.gh (24.3 KB)

Still need to cull overlapped circles…

steps_2021Jan29c.gh (23.1 KB)

2 Likes

Thanks Joseph, this looks great i will look into the definition and play around with it!

Detecting and culling overlapping circles is much harder. I was going to use Anemone loop code I wrote here for rectangles but that was easier because rectangles are planar and there was only one branch.

P.S. This is a very hasty refactor of that code from last September using two Anemone loops (one per branch/railing). It should probably use Anemone ‘Fast Loop’ but uses the slower ‘Classic’. There is a slider to adjust ‘minimal distance’ between circles but it has no effect on distance to surface edges.

steps_2021Jan29d.gh (45.5 KB)

P.S. I see one error:

1 Like

Would it be possible to know which circles are closest and what their radiuses are?
Then if the two radiuses together are larger than the distance, one must go.

1 Like

Cool!
I have a very simplistic trick here, just reduced the range for the overlapping circles in half.
just a messy idea.gh (28.6 KB)

You’ll have to implement your own algorithm, this was a hasty adaptation of older code.

The ‘minimal distance’ value is used to create an offset curve which is used for collision detection. It’s a loop because you have to handle one at a time since culling one circle affects others.

Well, does it work?

1 Like

So far yeah… Not an error. But yours is a lot more clever… I am just cheating here…
just a messy idea.gh (32.2 KB)

Update: Nope… I have to somehow control the range dynamically. After too many circles just reducing the range in half is not enough… Def you are on the right track with the loop.

1 Like

I didn’t think about it much today, just adapted old code. Being able to set a minimum distance between circles (rectangles at the time) was a priority but it should also apply to distance from edges.

2 Likes

Yep, I think it really boils down to the distance. At some point this is turning into an overkill, but it is hell of a fun