# By Axelerator AB All rights reserved
# Author Marcus Isaksson
from varmain .primitiv import *#line:5
from varmain .custom import *#line:6
from varmain .var_basic import *#line:7
from varmain .dummy_var import *#line:8
from aqa .math import *#line:9
import math #line:10
import sys ,os #line:11
if not os .path .dirname (os .path .abspath (__file__ ))in sys .path :#line:17
			   sys .path .append (os .path .dirname (os .path .abspath (__file__ )))#line:18
from AX_BOXF import *#line:21
@activate (Group ="Elbow",TooltipShort ="Elbow 90",TooltipLong ="Fittings Union Elbow 90",LengthUnit ="mm",Ports ="2")#line:24
@group ("MainDimensions")#line:25
@param (DN =LENGTH ,TooltipShort ="Nominal Diameter",TooltipLong ="Nominal Diameter")#line:26
def AX_P1_ELBOW_90 (O0O0O0O0O00OOOOOO ,DN =16.5 ,**O00O0OO0O000OOOOO ):#line:31
	if DN ==16.5 :#line:33
		O0OOOO0O000O0000O =16.5 #line:34
		O0O000O00O0OO0OOO =34.0 #line:35
		O00O0OOOO00OO0O00 =58.0 #line:36
		OOO0OOOOO0OOOOOOO =31.0 #line:37
	elif DN ==25 :#line:38
		O0OOOO0O000O0000O =25.0 #line:39
		O0O000O00O0OO0OOO =44.5 #line:40
		O00O0OOOO00OO0O00 =69.5 #line:41
		OOO0OOOOO0OOOOOOO =40.0 #line:42
	elif DN ==40 :#line:43
		O0OOOO0O000O0000O =40.0 #line:44
		O0O000O00O0OO0OOO =67.0 #line:45
		O00O0OOOO00OO0O00 =103.0 #line:46
		OOO0OOOOO0OOOOOOO =62.0 #line:47
	elif DN ==50 :#line:48
		O0OOOO0O000O0000O =50.0 #line:49
		O0O000O00O0OO0OOO =80.0 #line:50
		O00O0OOOO00OO0O00 =116.0 #line:51
		OOO0OOOOO0OOOOOOO =56.0 #line:52
	elif DN ==63 :#line:53
		O0OOOO0O000O0000O =63.0 #line:54
		O0O000O00O0OO0OOO =91.0 #line:55
		O00O0OOOO00OO0O00 =124.0 #line:56
		OOO0OOOOO0OOOOOOO =61.0 #line:57
	elif DN ==76 :#line:59
		O0OOOO0O000O0000O =76.0 #line:60
		O00O0OOOO00OO0O00 =227.0 #line:61
		OOO0OOOOO0OOOOOOO =189.0 #line:62
		O0OOOOO00O0000OO0 =154.10 #line:63
	elif DN ==100 :#line:64
		O0OOOO0O000O0000O =100.0 #line:65
		O00O0OOOO00OO0O00 =278.0 #line:66
		OOO0OOOOO0OOOOOOO =227.0 #line:67
		O0OOOOO00O0000OO0 =193.10 #line:68
	elif DN ==168 :#line:69
		O0OOOO0O000O0000O =168.0 #line:70
		O00O0OOOO00OO0O00 =269.0 #line:71
		OOO0OOOOO0OOOOOOO =185.0 #line:72
		O0OOOOO00O0000OO0 =149.0 #line:73
	if DN <76 :#line:76
		O000OOO0OO000OO00 =(O0OOOO0O000O0000O /2.0 )+2.0 #line:78
		OO0O00O00OO00OO0O =(O00O0OOOO00OO0O00 -O0O000O00O0OO0OOO /2.0 )*0.95 #line:79
		O0O0O0O00000O0OOO =(O0OOOO0O000O0000O /2.0 )*1.1 #line:80
		OO0O0O000O0OOO00O =ARC3D (O0O0O0O0O00OOOOOO ,D =O0O0O0O00000O0OOO ,R =O00O0OOOO00OO0O00 -OO0O00O00OO00OO0O ,A =90 )#line:82
		OO00OOOO0O000OO00 =CONE (O0O0O0O0O00OOOOOO ,R1 =O000OOO0OO000OO00 ,R2 =O0O000O00O0OO0OOO /2.0 ,H =OO0O00O00OO00OO0O *0.30 ).rotateY (-90 ).translate ((O00O0OOOO00OO0O00 ,0 ,0 ))#line:84
		OO00OOOO00OOO000O =CYLINDER (O0O0O0O0O00OOOOOO ,R =O0O000O00O0OO0OOO /2.0 ,H =OO0O00O00OO00OO0O *0.60 ).rotateY (-90 ).translate ((O00O0OOOO00OO0O00 -OO0O00O00OO00OO0O *0.30 ,0 ,0 ))#line:85
		OO0O0000O0OOO0O00 =CONE (O0O0O0O0O00OOOOOO ,R1 =O0O000O00O0OO0OOO /2.0 ,R2 =O0O0O0O00000O0OOO ,H =OO0O00O00OO00OO0O *0.10 ).rotateY (-90 ).translate ((O00O0OOOO00OO0O00 -OO0O00O00OO00OO0O *0.90 ,0 ,0 ))#line:86
		OOO000OOO0O0O0OOO =CONE (O0O0O0O0O00OOOOOO ,R1 =O000OOO0OO000OO00 ,R2 =O0O000O00O0OO0OOO /2.0 ,H =OO0O00O00OO00OO0O *0.30 ).rotateX (90 ).translate ((0 ,O00O0OOOO00OO0O00 ,0 ))#line:88
		OO00OOOO00OOO000O =CYLINDER (O0O0O0O0O00OOOOOO ,R =O0O000O00O0OO0OOO /2.0 ,H =OO0O00O00OO00OO0O *0.60 ).rotateX (90 ).translate ((0 ,O00O0OOOO00OO0O00 -OO0O00O00OO00OO0O *0.30 ,0 ))#line:89
		OO0O0000O0OOO0O00 =CONE (O0O0O0O0O00OOOOOO ,R1 =O0O000O00O0OO0OOO /2.0 ,R2 =O0O0O0O00000O0OOO ,H =OO0O00O00OO00OO0O *0.10 ).rotateX (90 ).translate ((0 ,O00O0OOOO00OO0O00 -OO0O00O00OO00OO0O *0.90 ,0 ))#line:90
		for O0O0000O00OOO00OO in [OO00OOOO0O000OO00 ,OO00OOOO00OOO000O ,OO0O0000O0OOO0O00 ,OOO000OOO0O0O0OOO ,OO00OOOO00OOO000O ,OO0O0000O0OOO0O00 ]:#line:92
		    OO0O0O000O0OOO00O .uniteWith (O0O0000O00OOO00OO )#line:93
		    O0O0000O00OOO00OO .erase ()#line:94
		O0000000O00O0O0OO =CYLINDER (O0O0O0O0O00OOOOOO ,R =O0OOOO0O000O0000O /2.0 ,H =O00O0OOOO00OO0O00 -OOO0OOOOO0OOOOOOO ).rotateY (90 ).translate ((OOO0OOOOO0OOOOOOO ,0 ,0 ))#line:96
		O0OOOO0O0O00O0000 =CYLINDER (O0O0O0O0O00OOOOOO ,R =O0OOOO0O000O0000O /2.0 ,H =O00O0OOOO00OO0O00 -OOO0OOOOO0OOOOOOO ).rotateX (-90 ).translate ((0 ,OOO0OOOOO0OOOOOOO ,0 ))#line:97
		for O0O0000O00OOO00OO in [O0000000O00O0O0OO ,O0OOOO0O0O00O0000 ]:#line:98
		    OO0O0O000O0OOO00O .subtractFrom (O0O0000O00OOO00OO )#line:99
		    O0O0000O00OOO00OO .erase ()#line:100
		O0O0O0O0O00OOOOOO .setPoint ((OOO0OOOOO0OOOOOOO ,0 ,0 ),(1 ,0 ,0 ))#line:104
		O0O0O0O0O00OOOOOO .setPoint ((0 ,OOO0OOOOO0OOOOOOO ,0 ),(0 ,1 ,0 ))#line:105
	elif DN >=76 :#line:107
		OO0OO0OOOOOOOOOOO =O0OOOO0O000O0000O /2.0 +1.0 #line:109
		OO00O00O000OO00O0 =OOO0OOOOO0OOOOOOO -34.90 #line:110
		OO0O0O000O0OOO00O =ARC3D (O0O0O0O0O00OOOOOO ,D =O0OOOO0O000O0000O /2.0 ,R =OOO0OOOOO0OOOOOOO /2.0 ,A =90 )#line:112
		O000OO0OO00OOO0O0 =CYLINDER (O0O0O0O0O00OOOOOO ,R =OO0OO0OOOOOOOOOOO ,H =OOO0OOOOO0OOOOOOO /2.0 ).rotateY (90 ).translate ((OOO0OOOOO0OOOOOOO /2.0 ,0 ,0 ))#line:114
		OO0OO000OOOO000O0 =CYLINDER (O0O0O0O0O00OOOOOO ,R =OO0OO0OOOOOOOOOOO ,H =OOO0OOOOO0OOOOOOO /2.0 ).rotateX (-90 ).translate ((0 ,OOO0OOOOO0OOOOOOO /2.0 ,0 ))#line:115
		O0OOO0O0000OO00O0 =TORUS (O0O0O0O0O00OOOOOO ,R1 =OO0OO0OOOOOOOOOOO -3.0 ,R2 =4.0 ).rotateY (90 ).translate ((OO00O00O000OO00O0 ,0 ,0 ))#line:117
		O0OOO0O0O0OOOO00O =TORUS (O0O0O0O0O00OOOOOO ,R1 =OO0OO0OOOOOOOOOOO -3.0 ,R2 =4.0 ).rotateX (-90 ).translate ((0 ,OO00O00O000OO00O0 ,0 ))#line:118
		for O0O0000O00OOO00OO in [O000OO0OO00OOO0O0 ,OO0OO000OOOO000O0 ,O0OOO0O0000OO00O0 ,O0OOO0O0O0OOOO00O ]:#line:120
		    OO0O0O000O0OOO00O .uniteWith (O0O0000O00OOO00OO )#line:121
		    O0O0000O00OOO00OO .erase ()#line:122
		O0OO0O0OOO000O0OO =CYLINDER (O0O0O0O0O00OOOOOO ,R =O0OOOO0O000O0000O /2.0 ,H =OOO0OOOOO0OOOOOOO /2.0 ).rotateY (90 ).translate ((OOO0OOOOO0OOOOOOO /2.0 ,0 ,0 ))#line:124
		O0000OO0O000O0OOO =CYLINDER (O0O0O0O0O00OOOOOO ,R =O0OOOO0O000O0000O /2.0 ,H =OOO0OOOOO0OOOOOOO /2.0 ).rotateX (-90 ).translate ((0 ,OOO0OOOOO0OOOOOOO /2.0 ,0 ))#line:125
		for O0O0000O00OOO00OO in [O0OO0O0OOO000O0OO ,O0000OO0O000O0OOO ]:#line:127
		    OO0O0O000O0OOO00O .subtractFrom (O0O0000O00OOO00OO )#line:128
		    O0O0000O00OOO00OO .erase ()#line:129
		O0O0O0O0O00OOOOOO .setPoint ((OOO0OOOOO0OOOOOOO ,0 ,0 ),(1 ,0 ,0 ))#line:131
		O0O0O0O0O00OOOOOO .setPoint ((0 ,OOO0OOOOO0OOOOOOO ,0 ),(0 ,1 ,0 ))#line:132
