How create points on a surface?

Hi, I am trying to keep this recursion inside of a surface. When I run it it go outside of it. Do you know how give this boundary to my recursion?
thanks

point on surface.gh (15.3 KB)

Did you look ath these posts ?

yes, I saw that but I do not manage to make my points on a mesh.

One of your goal object is not doing what you want.
OnMesh
See pic.
By linking a surface to the “Plane” input of “OnPlane” component grasshopper is doing an implicit conversion from surface to plane. A plane have no boundaries, its infinite!
Points will be constraint only to Z0 of that plane.
If you hover the mouse cursor over “Plane” input the message box tells you that the surface is loaded as a plane: O(origin point) Z(normal vector).

Instead, use “OnMesh” component (that will do an implicit conversion from surface to mesh), and that will keep your points inside the boundaries. Point will actually adhere to the mesh.

I’ve not actually tested it, I don’t have your plugins… but this should fix your problem.

Thanks, I have already tried that but it seems that my code on mesh it doesn’t work. It gives me every time an error when I start that

I try to use your advised but it still does not work. When I run my script the growing exceed the meshGrowing line in a surface.gh (11.3 KB)

You are trying to make a recursive work “around” the kangaroo solver.
And in the solver, in the reset input in put you connected a list (true,false). It seems the solver is running twice every iteration.
I have no idea what’s going on, I’ve never seen doing that.
I don’t think this is the proper way to do that, not the best, anyway.
I tried a bit and I din’t manage to make it work, sorry.

yeah, because using on mesh it requires the use of the kangaroo solver right?. Is there a way not to use it with point on mesh?

The problem is not that.
I usually “Merge” together the goals object and then flatten the output and then link that output to kangaroo solver goals input.
You used “Entwine” instead, having a tree as output… and you have a list of “Reset” boolean (and one is True!!).
I don’t know if or HOW kangaroo solver can work with trees… i think you need to understand clearly what is going on first, then adding another goal shouldn’t be a problem.

I try to clean it and start from zero. Now How should I add the onmesh component?