cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
GDL
About building parametric objects with GDL.

TUBE suddenly mirrors its profile

Durval
Enthusiast

 

I was creating a door casing essentially made by a TUBE command which can read custom complex profiles from the project, then I faced this weird problem whose reason I still could not figure out.

So I created this simple object for testing purposes.

Notice the TUBE's profile seems to get inverted – as if the X coordinates of its profile are mirrored – if a subtle change in its path is applied. It happens when 'Y deviation in A/2' goes above a certain value, corresponding to an angle of aproximately 9º-10º with horizon.

I attached a short video showing the phenomenon when changing ' Y deviation' dinamically by an editable hotspot. Also attached an image of the parameters and the object (AC26).

 

Why is this happening and how can I avoid it?

This is the 3D script:

TUBE 5, 7, 1+2+16+32,
0, 0, 1,
X1, 0, 1,
X1, Y2, 1,
0, Y1, 1,
0, 0, 1,

0, 0, -1, ang,
0, 0, 0, ang,
0, 0, ZZYZX, ang,
A/2, ydev, ZZYZX, ang,
A, 0, ZZYZX, ang,
A, 0, 0, ang,
A, 0, -1, ang

 

And this is the 2D script:

PROJECT2 3, 270, 1

unID = 0
HOTSPOT2 A/2, 0, unID, ydev, 1 !--- base
unID = unID + 1
HOTSPOT2 A/2, ydev, unID, ydev, 2 !--- move
unID = unID + 1
HOTSPOT2 A/2, -1, unID, ydev, 3 !--- ref.

HOTSPOT2 0, 0
HOTSPOT2 A, 0



Screenshot 2025-03-24 at 13.35.15.png



 

--- www.dtabach.com.br ---

AC 27 BR – MacBook Pro Apple M2 16GB RAM Mac OS Sonoma
9 REPLIES 9

I use tubes a lot. And ultimately I have just ended up coding the tube a different direction when this happens.  I spent some time trying to figure it out but was never able to solve it other than changing the direction the tube is being drawn.

Hopefully someone else has some better experience as I am also curious.

Durval
Enthusiast

Changing the direction of the tube path doesn't change the issue.
The 'Y deviation' in my real object has to be parametric, so that the user can set it. So, I need either to avoid this inversion from happening or to understand when it happens, so that I can add a routine to the code that would 'uninvert' it.

 

--- www.dtabach.com.br ---

AC 27 BR – MacBook Pro Apple M2 16GB RAM Mac OS Sonoma

I resort to writing separate tubes.

Maybe the angle nets to go negative at some point during the tube?

Pertti Paasky
Expert

Tube is weird.

One thing You can do is to change coordinates of the path. (z->y ).

then rotate the tube back  to right position.

- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.

Yes, that was a good guess, Pertti Paasky. Using Y instead of Z axis (then ROTX to put it back to the intended position) did eliminate the invertion of the polyline. But it added new torsions along the path, that are hard to understand (thus, to avoid).

Screenshot 2025-03-26 at 16.10.42.png

--- www.dtabach.com.br ---

AC 27 BR – MacBook Pro Apple M2 16GB RAM Mac OS Sonoma
Lingwisyer
Guru

I use seperate extrusions instead of a single tube as then it allows you to control the connection at each corner as you may not always want your casing or frame to just fillet.

AC22-28 AUS 3110Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win11 | R5 2600 | 16GB | GTX1660

This ends up being the best method especially with curves in tubes

Jochen Suehlo
Moderator

JochenSuehlo_0-1743082243445.png

I discovered these days, that TUBEa is in some cases much better then TUBE.
TUBE on top, TUBEa below.

Jochen Suehlo . AC12-28 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
runxel
Hero

Tubes are in some ways extremely limited, as we can see.

There comes an old GDL forum thread into mind.

To quote: "As you can read in the documentation, the W axis of a cross-section at each particular node of TUBE is tied to the Z axis."

Meaning: Tubes whose path does not stay in the XY-plane will deform and have issues to some degree. That's why rotating it later helps – in some cases.

In others, like here, only splitting the parts up will consistently help.

Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»

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!