Deform a curve

Hello everyone :slight_smile: i am trying to make the rectangle deform into the curve in red. I want to deform the rectangle at its corner points into a fillet, but that has more than one control point, so not just into a 3 point arc. I tried doing it through moving the corner points towards the centre, but i dont know how to dispatch or select more points adjacent to the corner points, so that the curve is smoother. Does anyone have an idea how to do this? Thanks

274_1 - Kopie.3dm (127.9 KB)

274_1.gh (16.4 KB)

Hi @Gloriana - is your end goal (deformed curve) supposed to be a smoother polyline or a spline?

I want the resulting curve to go through my control points, so a polyline :slight_smile:

Does this mean you’re ‘pulling’ it to the curve in red or is the red curve just an example of what your deformed polyline should be?

This is something else. Can you clarify your exact goal? :slight_smile:

I know this sounds very simple, maybe for smart people, not me :wink: if you do a true fillet on a polyline then that’s no longer a polyline.

Example where a polyline remains a polyline while formed through your points on the red curve:
274_1.gh (21.4 KB)

Note: no fillets here - fillet requires a radius, your result will be arcs, which you don’t want.

Thanks for your help! I just can’t use the red curve as a guide to deform the square because it is nonexistent at first, its the curve i am trying to create from the square.

It is curve fairing/cubic smoothing algorithm. Use smooth curves from Nautilus

Or c# if you want to avoid plug ins

smooth.gh (10.7 KB)

Yes exactly, not pulling but its an example of what it should be. So when you draw an arc, you only have 3 control points, start, end and middle point, but I would like to have more than this 3. And im sorry, I actually want to form a spline, because the curve has to go smoothly through the points

smooth.gh (23.2 KB)

Also you can always rebuild your arc to have more than 3 control points :distorted_face:

Do you mean something like this?
tween.gh (9.8 KB)

Doesn’t GH have a ‘smooth polyline’ component? I forgot to suggest that.

Good idea!

Honestly never used this component

smooth.gh (11.4 KB)

Thank you so much! i think this is pretty close to the solution, do you think there is a way of controlling the deformation of the curves individually? I am trying to recreate a lens shape

not tween because the red curve is non existent, is just my goal of how i want the square to deform. but thanks a lot anyway :):slightly_smiling_face:

I believe you’re talking about curve segments, or control points, as you’re ultimately deforming a single polyline into a smooth spline—or so I understand.

@dfytz1, a quick thought just for fun was using kangaroo to manipulate the vertices—if more length/rod goals were needed then it could employ a boundary collide or damping—left it pretty basic, though—you’re better at this:
DeformPolyline.gh (22.1 KB)

What is the point in using grasshopper if you want to control the vertices individually?

thank you this is great!! :slight_smile:

@René_Corella awesome its really helpful
small change required am only able to shrink the geometry i tried to expand it (make it bigger than the existing one its fails) can this also be fixed ?

just trying to find if there was a workflow that also worked in grasshopper :slight_smile:

If you need gumball in grasshopper you can use this gha

Hey @rajeev_pulari, yes - you can add a ‘length’ goal from kangaroo and increase the length factor. Also, if using the closed curve collision I left there, you can specify the deforming curve stays outside of the boundary—change the ‘In’ input. And yes you can use any of the control points as fixed or movable anchors with the various anchor components.