Home › Forums › Problems and solutions in GDL › Object design › Add adjustable curves to my fill
Tagged: BasicGeometry
- This topic has 7 replies, 3 voices, and was last updated 4 years, 7 months ago by Péter Baksa.
-
AuthorPosts
-
-
February 12, 2020 at 17:34 #18554James GoodeParticipant
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 = 0Thanks
-
February 13, 2020 at 09:32 #18556Péter BaksaKeymaster
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-
February 13, 2020 at 11:07 #18557James GoodeParticipant
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.
-
-
February 13, 2020 at 13:00 #18558James GoodeParticipant
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?
-
February 14, 2020 at 09:02 #18561Péter BaksaKeymaster
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-
February 17, 2020 at 13:17 #18568James GoodeParticipant
Do you have a working example of this in use?
That would be very useful!-
February 17, 2020 at 14:08 #18569Péter BaksaKeymaster
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
-
-
-
February 15, 2020 at 16:08 #18563James MurrayParticipant
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
-
-
AuthorPosts
- The forum ‘Object design’ is closed to new topics and replies.