GDL
About building parametric objects with GDL.

Cylinder and Elbow Intersection

Anonymous
Not applicable
Hello All,

I'm using cylinders and elbows to make a bath tub faucet. Is there a way to eliminate the line between the intersection of the cylinder and elbow, the line appears in 3d, plan and elevation.

Or is there a better tool that I should be using to make this j shape?

I’ve attached a couple images and the code. Thank you!
!ROUND
HOTSPOT 0,0,0

MATERIAL Material_color

!PLATE
ROTX 90
CYLIND .5", W/2

!BRACKET
ADDZ .5"
CYLIND 2", .625"
ADDZ 2"
CYLIND 4", 3/8"

!CONNECTION
ADDZ 4"
ROTZ 270
ELBOW 1.5", 90, 3/8"
ADDZ 1.5"
ADDX 1.5"
ROTY 90
CYLIND 1", .5”
13 REPLIES 13
Barry Kelly
Moderator
Cylinders and elbows don't give you the masking controls to allow you to turn off the end lines.

You can 'Group' them and they will merge, or I tend to use PRISM_ for the straight parts and REVOLVE for the curves.
With these you have mask values to control the visibility of the lines.

For example...

PRISM_ 7, 0.100,
				0.011,       0.0,      11+64, 
				0,       0.0,    900, 
				   0,          180,   4011+64, 
			   -0.011,       0.0,      11+64, 
				0,       0.0,    900, 
				   0,          180,   4011+64, 
				0.011,       0.0,     -1
ROTz 90
ADD 0, -0.098,0.100

REVOLVE 7, 169, 1*0+2*0+4*0+16*0+32*0+64*0,
				0.011,       0.098,      1, 
				0,       0.098,  900, 
				   0,          180,   4011+64, 
			   -0.011,       0.098,    1, 
				0,       0.098,  900, 
				   0,          180,   4011+64, 
				0.011,       0.098,   1


Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Joachim Suehlo
Advisor
Barry: You can 'Group' them and they will merge
How does this work with GROUP commands?

Another way to get it work is TUBE, which I always use for this kind of tubed objects.
Joachim Suehlo . AC12-27 . MAC OSX 13.5 . WIN11
GDL object creation: b-prisma.de
A_ Smith
Expert
Joachim wrote:
How does this work with GROUP commands?
W=0.1
group "object"
!ROUND
HOTSPOT 0,0,0

MATERIAL 20

!PLATE
ROTX 90
CYLIND .5", W/2

!BRACKET
ADDZ .5"
CYLIND 2", .625"
ADDZ 2"
CYLIND 4", 3/8"

!CONNECTION
ADDZ 4"
ROTZ 270
ELBOW 1.5", 90, 3/8"
ADDZ 1.5"
ADDX 1.5"
ROTY 90
CYLIND 1", 0.5"
endgroup

placegroup "object"
AC 22, 24 | Win 10
Joachim Suehlo
Advisor
A. Smith
Thank you, but in AC 22 on MAC OS with this code the line is still visible,
Joachim Suehlo . AC12-27 . MAC OSX 13.5 . WIN11
GDL object creation: b-prisma.de
vdentello
Advocate
You'd probably be able to solve that by using Tube.

It'll be segmented though.

That´s from a squared tap i've coded.

Yet, i usually embrace the division line in elevation.
TUBE 4, 11, 1+2+16+32,
        0.01, -0.01, 900,
        -0.01, -0.01, 0,
        -0.01, +0.01, 0,
        0.01, +0.01, 0,
        -1, 0, 0, 0,
        0, 0, 0, 0,
        0, 0, 0, 0,
        0.135, 0, 0, 0,
        0.135+0.0575*sin(15), 0.06-0.06*cos(15), 0, 0,
        0.135+0.0575*sin(30), 0.06-0.06*cos(30), 0, 0,
        0.135+0.0575*sin(45), 0.06-0.06*cos(45), 0, 0,
        0.135+0.0575*sin(60), 0.06-0.06*cos(60), 0, 0,
        0.135+0.0575*sin(75), 0.06-0.06*cos(75), 0, 0,
        0.135+0.0575, 0.06, 0, 0,
		0.135+0.0575, 0.06, 0, 0
Archicad User Since 2013
GDL Developer
Experimenting with API
from Brazil
A_ Smith
Expert
Joachim wrote:
A. Smith
Thank you, but in AC 22 on MAC OS with this code the line is still visible,

Win10 AC22 in 3D view I see no lines, in 2D plane they remain. If 2D is critical... well, in that case, it's only status codes with prism_ or other similar shapes

edit: can you test plz do lines remain if add group itself.
something like this

tap_obj=addgroup ("object", "object")
placegroup tap_obj
AC 22, 24 | Win 10
Joachim Suehlo
Advisor
I made some door handles with TUBE some years ago, you can check the script:
https://www.b-prisma.de/downloads/glutz/
A. Smith
No, Addgroup I checked, it does not hide the lines.
Joachim Suehlo . AC12-27 . MAC OSX 13.5 . WIN11
GDL object creation: b-prisma.de
Anonymous
Not applicable
I tried out both methods that Barry had suggested. (Thank you Barry!)

The line was still visible for me when using the group command between the CYLIND and ELBOW.

The PRISM_ and REVOLVE worked perfectly for everything except the front elevation view. Now there is no line where the spout meets the wall bracket. I tried to solve it with changing the status code but it seems that both ends of the PRISM_ are either visible or hidden. Is there a status code i'm missing to just make the back line visible and leave the front line off?
200:
!ROUND
HOTSPOT 0,0,0

MATERIAL Material_color

!PLATE
ROTX 90
CYLIND .5", W/2

!BRACKET
ADDZ .5"
CYLIND 2", .625"

!SPOUT
ADDZ 2"
ROTZ 270
PRISM_ 7, 4",
				 3/8",    0.0,    11+64, 
				    0,    0.0,    900, 
				    0,    180,    4011+64, 
			    -3/8",    0.0,    11+64, 
				    0,    0.0,    900, 
				    0,    180,    4011+64, 
				 3/8",    0.0,    -1
ROTz 90
ADD 0, -1.5",4"
REVOLVE 7, 90, 1*0+2*0+4*0+16*0+32*1+64*0,
				3/8",   1.5",   1, 
				0,       1.5",  900, 
				0,       180,   4011+64, 
			   -3/8",   1.5",   1, 
				0,       1.5",  900, 
				0,       180,   4011+64, 
				3/8",   1.5",   1
ADDZ 1.5"
ROTX 90
CYLIND 1", .5"

END
Barry Kelly
Moderator
Joachim wrote:
Barry: You can 'Group' them and they will merge
How does this work with GROUP commands?

Sorry I was wrong about the grouping will merge the lines.
I could have sworn I had done that before, but it seems not.

I do know that if you add a group to itself and place the result, it will show all of the intersecting lines where elements pass through each other.
For example - view the code below in 3D and you will see the cylinders overlap.
Un-comment the line for ... PLACEGROUP result ... and you will now see the intersecting lines of the cylinders.
group "object"
!ROUND
HOTSPOT 0,0,0

MATERIAL 20

!PLATE
ROTX 90
CYLIND .5", W/2

!BRACKET
CYLIND 2", .625"
endgroup

placegroup "object"                  !!!comment out this line

result = ADDGROUP ("object","object")
!placegroup result                     !!!uncomment this line

Joachim wrote:
Another way to get it work is TUBE, which I always use for this kind of tubed objects.
Tubes are good, you just have to work out the point coordinates for the path.
The curvature of the path can not be altered with RESOL command so you need to determine the smoothness of the curve by the number of points in the path.


Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

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!