We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.

Curved Sweep End Angle Not Exactly 90 degrees To Sweep Start Angle

Jarrod Phillips
Enthusiast

Hi All,

 

As the title suggests, I am trying to sweep a circular profile along an arc path, however the sweep end angle is not exactly 90 degrees to the sweep start angle (see image below). I also know that the tube command does something similar, I wanted to know if there is a way to get this to finish at exactly 90 degrees, similar to the way the elbow command does. See code example below:

 

!Variables
spoutRadius = 0.016
spoutArcRadius = 0.300

!Sweep
sweep 2, 7, 0, 1.1, 1+2+4+8+0+0+0,
0, 0, 901,
spoutRadius, 360, 4001,
0, 0, 0,
spoutArcRadius+spoutArcRadius*cos(165), 0, spoutArcRadius*sin(165),
spoutArcRadius+spoutArcRadius*cos(150), 0, spoutArcRadius*sin(150),
spoutArcRadius+spoutArcRadius*cos(135), 0, spoutArcRadius*sin(135),
spoutArcRadius+spoutArcRadius*cos(120), 0, spoutArcRadius*sin(120),
spoutArcRadius+spoutArcRadius*cos(105), 0, spoutArcRadius*sin(105),
spoutArcRadius+spoutArcRadius*cos(90), 0, spoutArcRadius*sin(90)

 

Sweep End Angle Not 90 Degrees.png

 

Thanks in advance!

 

Jarrod

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27
9 REPLIES 9
Laszlo Nagy
Community Admin
Community Admin

I have not worked with this GDL command for a long time, but you may have to change the angle value of the last line from 90 to 75 because your desired value (90) is the bisector angle of you last two values (105 and 75).

Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27

Hi @Laszlo Nagy  ,

 

Thanks for your response, this worked, however the divisions of the elbow are no longer equal (see image below). The preference would be to have equal divisions in the sweep similar to an elbow.

 

JarrodPhillips_0-1708294804887.png

 

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27
Laszlo Nagy
Community Admin
Community Admin

I have checked the GDL Reference Guide:

https://help.graphisoft.com/AC/27/INT/GDL.pdf

It says:

 

 

The cross-section at point (xi, yi, zi) is perpendicular to the space curve segment between points (xi-1, yi-1, zi-1) and (xi, yi, zi).

 

 

where

 

 

xi, yi, zi: coordinates of the path curve nodes.

 

 

This is how the cross sections are calculated per my understanding:

 

Sweep.png

So, at each point of the space curve, Archicad will take that point of the space curve, plus the previous point of the space curve, draw a segment between them, and the cross- section will be perpendicular to that segment and will be generated at the end of the segment.

This I think is counterintuitive to what one may think because I for one supposed that the cross section is generated at the midpoint of each segment, not the endpoint. Because of this, I am not sure I can recommend you a way of achieving this using the SWEEP command because if at 90 degrees, you now want to generate a very short horizontal segment, then the result may be that the SWEEP will become self-intersecting.

 

So, based on these, I would suggest that you try to use the TUBE command to achieve this. With the TUBE command, the cross section is generated at the midpoint of each segment, plus, if we say that the indexes of the path nodes are from Node 1 to Node m, then you also need to define a Node 0 and a Node m+1 of the path, using which you will be able to control the direction of the first and last segment and will be able to achieve your desired geometry, I think.

For detailed info on the TUBE command, check the GDL Reference Guide.

Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27

Tube solves the problem.

 

TUBE
TUBE n, m, mask,
u1, w1, s1,
...
un, wn, sn,
x1, y1, z1, angle1,
...
xm, ym, zm, anglem

 

same rules as sweep, but your pipe start on x2,y2,z2 and finish on x(m-1), y(m-1), z(m-1),

 

this calculates the next point of the circle and the tangents for your tap spout...

 

!Variables
spoutRadius = 0.016
spoutArcRadius = 0.300

!tube
TUBE 2, 9, 1+2+4+8+0+0+0,
0, 0, 901,
spoutRadius, 360, 4001,
spoutArcRadius+spoutArcRadius*cos(195), 0, spoutArcRadius*sin(195), 0,!!!!start vector, not visable
spoutArcRadius+spoutArcRadius*cos(180), 0, spoutArcRadius*sin(180), 0,
spoutArcRadius+spoutArcRadius*cos(165), 0, spoutArcRadius*sin(165), 0,
spoutArcRadius+spoutArcRadius*cos(150), 0, spoutArcRadius*sin(150), 0,
spoutArcRadius+spoutArcRadius*cos(135), 0, spoutArcRadius*sin(135), 0,
spoutArcRadius+spoutArcRadius*cos(120), 0, spoutArcRadius*sin(120), 0,
spoutArcRadius+spoutArcRadius*cos(105), 0, spoutArcRadius*sin(105), 0,
spoutArcRadius+spoutArcRadius*cos(90), 0, spoutArcRadius*sin(90), 0,
spoutArcRadius+spoutArcRadius*cos(75), 0, spoutArcRadius*sin(75), 0!!!!End vector,  not visable

 

 

AllanP_0-1708321405246.png

 

I have been using ArchiCAD continually since ArchiCAD 4.5, 4.5.5, 5, 5.1, 6, 6.5, 7, 8, 8.1, 9, 10, 11, 12, 13, 15, 18, 21, 22, 25, now testing 27
Member of Architalk since 2003, but missed the migration to Graphisoft.
(where have all my original posts gone?)

But a TUBE does not scale each segment smaller or larger as can be done in a SWEEP.

 

There is TUBEA, but I still don't think that is the same.

 

Might just need to extend the SWEEP and then cut the end with a cutting plane.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Pertti Paasky
Expert

Start with 180 degrees, and the first leg should be half of the others. This is a matter of geometry.

spoutArcRadius+spoutArcRadius*cos(180), 0, spoutArcRadius*sin(180),
- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.
Laszlo Nagy
Community Admin
Community Admin

I just realized that the very old "ELBOW" command in GDL could also be used for this. It may be the simplest of them all.

Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27

Thanks Barry, I have done this in the past, it unfortunately seems like the best workaround. Was hoping there would be a better way to achieve this but there doesn’t seem to be.

 

Cheers!

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27

Hi @Laszlo Nagy ,

 

Thanks for your assistance in breaking down the GDL reference guide, I really appreciate it. Barry is correct, I am looking for an elbow that scales at both ends. It’s a shame that GDL doesn’t behave consistently across different commands, this makes it difficult to achieve the desired geometry.

 

The elbow command is great, however doesn’t allow any control over how contours are displayed, so I usually always opt for the tube command.

 

Cheers!

BIM Manager | Graduate of Architecture
Fulton Trotter Architects - Sydney, Australia
Archicad 15 - 27

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!