We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2024-02-18 06:37 AM - last edited on 2024-09-24 10:22 AM by Doreena Deng
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)
Thanks in advance!
Jarrod
2024-02-18 07:44 PM
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).
2024-02-18 11:20 PM
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.
2024-02-19 03:20 AM - edited 2024-02-19 03:22 AM
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:
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.
2024-02-19 06:35 AM - last edited on 2024-02-19 08:10 PM by Laszlo Nagy
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
2024-02-19 07:26 AM
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.
2024-02-19 08:06 AM
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),
2024-02-21 01:33 PM
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.
2024-02-21 10:38 PM
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!
2024-02-21 10:43 PM
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!