## Add adjustable curves to my fill

Home Forums Problems and solutions in GDL Object design Add adjustable curves to my fill

Tagged:

• Author
Posts
• #18554

Hello,

I’m trying to create a fill object that I can adjust the points of the fill to wherever I want them. I also want to be able to adjust the curved sides.

Is it possible to achieve this with my script? I’d like to use a length hotspot to adjust the curve. Any help would be appreciated.

``````poly2_b{5}      13,      3,      0,      3,      19,      19,
0,            0,            1,            0,            0,            1,            0,

posx1,            posy1,      1,
mposx1,          mposy1,    900,
0,         -180,   4001,

posx2,          posy2,      1,
mposx2,          mposy2,    900,
0,         -180,   4001,

posx3,          posy3,      1,
mposx3,          mposy3,    900,
0,         -180,   4001,

posx4, 			 posy4,      1,
mposx4, 			 mposy4,    900,
0,         -180,   4001,

posx1,            posy1,      1``````

FYI Master Script

``````mposx1 = ((posx1+posx2)/2)
mposx2 = ((posx2+posx3)/2)
mposx3 = ((posx3+posx4)/2)
mposx4 = ((posx4+posx1)/2)
parameters mposx1=mposx1, mposx2=mposx2, mposx3=mposx3, mposx4=mposx4

mposy1 = ((posy1+posy2)/2)
mposy2 = ((posy2+posy3)/2)
mposy3 = ((posy3+posy4)/2)
mposy4 = ((posy4+posy1)/2)
parameters mposy1=mposy1, mposy2=mposy2, mposy3=mposy3, mposy4=mposy4``````

And the pos values are as follows –
posx1 = 0
posx2 = 0
posx3 = 200
posx4 = 200
posy1 = 0
posy2 = 200
posy3 = 200
posy4 = 0

Thanks

• #18556

Hello,

all the points you want to adjust have to be parameters. Simply code them as editable hotspots.

Péter Baksa
Library Platform, Software Engineer
GRAPHISOFT SE

• #18557

I know that but I don’t actually know how to implement the adjustable curves into my fill with adjustable parameters – at present changing the ‘-180’ values which are the curves don’t do what I want them to do.

• #18558

The method I want to use to be able to adjust the curve is have a centre point half way between the 2 points and then set the distance from the centre point to the arc – Is this possible to do in a fill and if so, how can I do it?

• #18561

There is no direct way of doing it with a status code, you have to calculate the angle and the centerpoint of the arc, or the tangent of the arc.
The BasicGeometry macro in the library can do the centerpoint calculation.

Péter Baksa
Library Platform, Software Engineer
GRAPHISOFT SE

• #18568

Do you have a working example of this in use?
That would be very useful!

• #18569

There is an example object that can be downloaded at the top of the linked page.

Péter Baksa
Library Platform, Software Engineer
GRAPHISOFT SE

• #18563

A status code for 3-point arc would greatly appreciated. E.g.:

``````archHgt = 1'

0, 0, 15,
A, 0, 15,
A, B - archHgt, 5179,
A/2, B, 5279,
0, B - archHgt, 5315,
0, 0, -1``````

James M