I am trying to move the points with MDSlider within the circle area, as if the circle area is the limit bound for moving the points. I can’t figure out how to do this in grasshopper. Anyone can help?
constrain point to boundary.gh (10.0 KB)
It appears that you are evaluating the underlying square surface of the trimmed surface making up your circle, which is why the points end up outside.
Would polar coordinates make sense for you? Point Polar - Grasshopper Vector - Component for Grasshopper | Grasshopper Docs
If you set one axis to d(the offset) and the other axis to XY(the angle in radians) you’ll be able to position the point only within the circle.
Your other option is to remap your XY values to polar coordinates using some math
Or you could even make a revolved surface, which would have a polar parameter space
in ultimate instance I think polar will delivery a similar result, but what I really wanted is the free move that mdslider make possible. But maybe it isn’t possible to use MD for this case, right?
hi @Leonardo_G_Pate this works to evaluate a circular surface on in square parameter space.
I know this doesn’t address your original question, but it will surely help.
To lock constrain the points after moving, you’ll need to modify the transformation. you could either just snap to the nearest point on the circle if the point is outside the circle, or you could remap the parameter space for each point so it slows down closer to the edge
square circle.gh (19.3 KB)
I think it achieve what I am chasing man! thanks!