how to do lateral port connection on 30 degree in python script.

how to do lateral port connection on 30 degree in python script.

rajendra.prajapat
Advisor Advisor
803 Views
3 Replies
Message 1 of 4

how to do lateral port connection on 30 degree in python script.

rajendra.prajapat
Advisor
Advisor

Hi all , i have created the below python script for lateral tee angle with 30 degree. i am not getting the lateral port connection on 30 degree, it is coming 45 degree. what i need to change in set point to make connection on 30 degree.Capture.PNG

 

def TEE30 (s, A=2.0, B=1.5, C=1.0, L1=3, L3=2, F=6, G=5, ID= "Duct Lateral", LengthUnit="in", **kw):
L = 2*C + F
L2 = (A+B)/2*1.141+G
Adeg=asRadiants(60.0)
E=L2*sin(Adeg)
H=cos(Adeg)
L4 = (L1 + C/2*H)*0.66
if A > L:
L = A
a1= CONE(s, R1= A/2.0, R2=B/2.0, H =L).rotateY(90.0)
a2 = CYLINDER(s, R= C/2.0, H=L2).rotateY(60.0).rotateX(180.0).translate((L4, 0.0, 0.0))
a3 = CYLINDER(s, R= A/2.0, H=L3).rotateY(90.0).translate((-L3, 0.0, 0.0))
a4 = CYLINDER(s, R= B/2.0, H=L3).rotateY(90.0).translate((L, 0.0, 0.0))
for p0 in [a2,a3,a4]:
a1.uniteWith(p0)
p0.erase()
s.setPoint((-L3, 0.0, 0.0), (-1.0, 0.0, 0.0), 0.0)
s.setPoint((L+L3, 0.0, 0.0), (1.0, 0.0, 0.0), 0.0)
s.setPoint((L4+E, 0.0, -H*L2), (1.0, 0.0, -1.0), 0.0)

 

 

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).
0 Likes
Accepted solutions (2)
804 Views
3 Replies
Replies (3)
Message 2 of 4

jabowabo
Mentor
Mentor
Accepted solution

Try this:

s.setPoint((L4+E, 0.0, -H*L2), (1.0, 0.0, -.57735), 0.0)

 

Edit: Got it wrong the 1st try

Message 3 of 4

rajendra.prajapat
Advisor
Advisor
Accepted solution

@jabowabo thank you. could you please tell me how you calcualte .57735 value?

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).
0 Likes
Message 4 of 4

jabowabo
Mentor
Mentor

C3F65CE7-8A6C-4A53-8AF0-8D05BB371FD9.png

0 Likes