Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

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 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

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-25 . MAC OSX 10.15 . WIN10

A_ Smith
Enthusiast
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

A. Smith
Thank you, but in AC 22 on MAC OS with this code the line is still visible,
Joachim Suehlo . AC12-25 . MAC OSX 10.15 . WIN10

vdentello
Contributor
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
Enthusiast
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

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-25 . MAC OSX 10.15 . WIN10

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 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Barry Kelly
Moderator
potterandrew wrote:
The line was still visible for me when using the group command between the CYLIND and ELBOW.

Seems I was wrong about that - sorry.

potterandrew wrote:
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?

Unfortunately that seems to be a problem with the masking works.
The lines at the front of the spout are masked as you want but as they are exactly the same size as the rear of the spout, the front blocks the rear lines.

A trick is to add a very slightly bigger prism, cylinder, plane or just lines/circle on the flat surface behind.
Here I have added an extra prism the same as the spout, made it slightly larger and very short.
You could make it even shorter and not as wide but there will be a limit before it gets hidden again.

!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

!!!!new extra prism added for spout line.*******************************
PRISM_ 7, 0.00001,
				 3/8"+0.0001,    0.0,    15+64, 
				    0,    0.0,    900, 
				    0,    180,    4015+64, 
			    -3/8"-0.0001,    0.0,    11+64, 
				    0,    0.0,    900, 
				    0,    180,    4015+64, 
				 3/8"+0.0001,    0.0,    -1
!!!!new extra prism added for spout line.*******************************

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.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Hi All,

The best way to build this element and have all perfect representation is to use REVOVLE and TUBE.
These two elements will give you control over edge visibility and most important will show the contours in elevation.

The curved elements also also respond to a resol command to reduce polygon count.
Also the comments on the tube being segmented and not responding to resol can be resolved if you script using PUT and GET statements and a for n = 0 to nAngle step nAngle/(ceil(nAngle/(360/resol)))

try this:

	!!-------------set variable, but these should be parameters
	dSpout = .160
	radSpout = .025
	curveSpout = .070

	put 0, .060/2, 0
	put .012, .060/2, 0
	put .012, radSpout/2 +.005, 0
	put .060, radSpout/2 +.005, 0
	revolve nsp/3, 360, 1+2+4+8+16+32,
		get(nsp)


	!!-------------------tube profile
	cntNSP_1 = 0
	put 0, 0, 901: 			cntNSP_1 = cntNSP_1 +1
	put radSpout/2, 360, 4001: 	cntNSP_1 = cntNSP_1 +1
	!!-------------------tube path
	cntNSP_2 = 0
	put .059, 0, 0, 0: cntNSP_2 = cntNSP_2 +1
	put .060, 0, 0, 0: cntNSP_2 = cntNSP_2 +1
	for n = 0 to 90 step 90/(ceil(90/(360/gs_resol)))
		put dSpout +curveSpout*sin(n), 0, -curveSpout +curveSpout*cos(n), 0: cntNSP_2 = cntNSP_2 +1
	next n
	put dSpout +curveSpout*sin(91), 0, -curveSpout +curveSpout*cos(91), 0: cntNSP_2 = cntNSP_2 +1
	tube cntNSP_1, cntNSP_2, 1+2+16+32,
		get(nsp)

	!!--------------------nossle
	add dSpout +curveSpout, 0, -curveSpout
	roty 90
		put .000, radSpout/2 +.003, 0
		put .030, radSpout/2 +.003, 0
		revolve nsp/3, 360, 1+2+4+8+16+32,
			get(nsp)
	del 2
Creator of Cadswift's parametric GDL libraries
Creator of Infinite Openings and Component Catalogues
Push the envelope & watch it bend
website: https://cadswift.com.au/
YouTube: https://www.youtube.com/user/CADSwift/playlists

Barry wrote:
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.
You weren't wrong. it can be done using the ADDGROUP{2} command which enables you to smooth the lines. it works really well especially when carving out a toilet geometry which curves in multiple directions.
Creator of Cadswift's parametric GDL libraries
Creator of Infinite Openings and Component Catalogues
Push the envelope & watch it bend
website: https://cadswift.com.au/
YouTube: https://www.youtube.com/user/CADSwift/playlists

Just about everything I code is done using tubes. They are by far my favorite
FREE Soffit & Fascia for Rail Tool - https://bit.ly/BIMRithmSoffitandFascia
FREE wall Accessory framing and coverings - bit.ly/BIMRithmWallAccessories
FREE Truss object - https://bit.ly/BIMRithmTrussV1
FREE Custom Tube Object - https://bit.ly/BIMRithmPolyTube
AC 24, Twinmotion current, Windows 11, Msi 10UG with rtx 3070, wacom intuos pro m, Wacom Cintiq Pro 16, razer Tartarus pro.

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!