Closed Curve as boundary for random points on a plane

I can create (sort of) a set of random points on a plane in GH. I can use that to create a set of randomly placed spheres on that plane. What i have not been able to do is to put a closed curve as a boundary around a subset of those components. What components/programming would be suggested to accomplish this?

the goal is to create a random set of multi-sized spherical divots on a flat object the shape of the closed curve.

Thanks for any guidance…
Carl H

Convex Hull will create a boundary around a set of points.

I think this is what you’re talking about (?)
by divots you mean grooves? (8.3 KB)

Thank YOU…that looks to be exactly what i am attempting. AND your point generator is 1/10 the complexity of mine. Even after taking the GH class i am slow. Thanks again for the help.

when I read your text again, I thought this one is what you want:
(in order to only select a few from a set of preexisting points) anyway, whichever suits you best!
cheers. (9.6 KB)

There is no class like this forum right here! Keep watching the posts and asking questions!
people are very helpful and you learn A LOT!!!


Your first solution is closest. Below is a screenshot of what it looks like now. My final goal is to cover the inside of the curve with spheres to the line but not beyond. To accomplish that I am thinking of 2 boundary curves with only very small spheres outside the inner sphere. the goal is to cast a hammered look into a flat pendant of silver……without needed to hammer every piece by hand. :frowning:

I also thought of replicating the program you shared a couple of times for smaller spheres to cover the entire surface………no open spaces.

Thanks for taking your time for the help……

Carl Hill

Foul! I clicked your link without looking, thinking it was a code file, not a link to your web site! Spare us the promotional material please, and post your own GH model?

This is an extension of what @anikolo did:

Interesting to see different uses of Rhino!

Help is plenty on this forum, and opinions differ! :wink:

// Rolf

1 Like

I apologize for the business card on the forum. I replied to Aris on my email not realizing the automatic connection to the forum. Auto-linkages are great…as long as one understands what happens when you ‘reply.’ I also didn’t realize my website would connect to the forum as a link with email replies! ‘Neophyte-ism’ at it’s best.

Joseph…what you demonstrated is what i am doing. The GH file i had was huge and it did not work. That is why i posted my goal without a file. Clearly you and Aris understood my challenge - so at least i wrote the post well. To get to this point I went through 6 hours of GH training videos with Andres to get some idea of where to start. I am still at a loss as to how to move from the visuals in my head and programing on the canvas. You and Aris have provided a ton of instruction. Thanks so much for the help.

I am assuming that by replying on the GH website my web URL will not be connected. At least it does not look like it will…

No problem. I found it interesting. :wink:

// Rolf

1 Like

I really have no idea what that means or how it happened accidentally? You can still edit that reply and remove the link to your web site and the image of your business card.

When you post a screen shot of code/geometry like you did, it’s reasonable to assume you have a file and could post something more useful than an image. It really saves so much time and makes it easier to offer help. I didn’t post my code file because you didn’t post yours. See what I mean?

I added very little to @anikolo’s code and my screen image is clear enough to reproduce it, isn’t it? I extruded the Boundary surface down ("-x" expression on Extr ‘D’ input) to create a solid, moved the spheres up (‘Z’ vector) by a fraction of their respective radii (‘height’ slider), and then subtracted them (SDiff) from the extrusion solid. Simple.

As to how to handle spheres that cross the boundary edges, you can ignore that detail as I did, or you can cull spheres that cross the edges before doing the SDiff, or you can reduce the radii to not exceed the distance to the nearest edge using Crv CP (Curve Closest Point).

Honestly Joseph, i think you are overestimating the significance of your opinion.

We can all make mistakes (me included), and we can loose temper for some reason that really matters to the individual and… but attacking people all the time is not a good sign.

This forum is becoming a hostile place nearly everytime a certain individual is posting. New comers gets it right up their faces although they cannot reasonably know exactly where you draw a line for… Phew.

This is not how this forum would be without those constant bitter attitudes.

Should I say this? Probably not. But I did say this anyway.

// Rolf


To begin, I appreciate everyone’s comments…at least so far.
RIL, thank you for your balance.
Joseph, I really am thankful for the help. However, as a neophyte on GH and Rhino - although i have taken the Rhino 1 and 2 classes online twice each and GH once with Andreas and have been using Rhino and RhinoCAM for a few years now - i am still slow. Last year, at 65 I confirmed i have Asperger’s. I figured it out only a couple of years prior. Not a fun realization this late in life, but so much of my past makes sense now. I only share that to enlighten others that we may not understand where the other person is when we help. I will have to examine your GH file very closely to understand it. GH is quite a language and takes a lot of practice. Clearly, you speak it very well.

Regarding the spheres coming to the edge of the boundary curve, once i fill the boundary i can simply trim using the curve, in Rhino or GH…These inputs have interceded after hours of struggle. Thanks again!!!

Nothing needs to be trimmed. The spheres are subtracted from the extruded solid, leaving only the divots. It doesn’t matter if they cross the edge or not - unless you want to handle edges differently. Most of my code comes from @anikolo’s earlier post, so start with that (his first reply).

@RIL, everyone has an opinion… Commercial self promotion on forums is widely considered to be spam. Not posting a GH file or geometry with the initial question on a thread is widely considered to be rude, with rare exceptions. It ignores the forum standard practice as recommended in How to ask effective questions and makes it more difficult to offer help, practically and “socially”.

What happened is he actually responded to the email discourse sends you as an email. So this means his email signature (which is his website) went through with the response as well. Discourse let’s you post response via email. Unlike most services which have a "do not respond to this email "

Hi Joseph,
I’m comparatively a new member but the way I see it, he did it only once and he even apologised. I don’t think it’s worth grilling him. Let’s keep the positive vibes strong! :peace_symbol: :heart_decoration:


Thank you for explaining that. Now the accidental link and business card make more sense. Confusing, though, that screen images of a GH model got mixed up with the signature? And alarming that if I replied to those emails, my phone number would appear in my forum post?! This is the first time I’ve ever seen an email signature on this forum.

The issue of not posting a GH model and/or geometry is still a legitimate gripe. Most of the time I spent extending @anikolo’s model was creating the boundary curve similar to the shape in @CRHill’s screen image, which could have been avoided had he posted his own. I converted a vector map of Italy’s border instead.

Attachments in the eMail are attached at the bottom of the posts here in Discourse.

They are rather frequent on the regular Rhino for Windows category.

It is confusing for many users, both those that send and those that read. Most of the time, the sender is not aware that he/she is answering to an entire group and not just an individual.

Thanks to all who have helped. Joseph, i took your suggestions and slowly worked through your image attempting to understand each component. My first program had 4 component sets with random number generators to put points inside my curve that i was then attempting to cull out only those inside. I was lost.

Here is my latest. My problem now is that i can’t Boolean Add in Rhino. BOTH files will be attached - when i find that option on the conversation. Anybody out there with Boolean experience in Rhino that can help?