# 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
from varmain .capsub .cpc_pl import *#line:13
if not os .path .dirname (os .path .abspath (__file__ ))in sys .path :#line:19
			   sys .path .append (os .path .dirname (os .path .abspath (__file__ )))#line:20
from AX_BOXF import *#line:23
@activate (Group ="Reducer",TooltipShort ="PLUG-IN REDUCER",TooltipLong ="PLUG-IN REDUCER",LengthUnit ="mm",Ports ="2")#line:26
@group ("MainDimensions")#line:27
@param (OD1 =LENGTH ,TooltipShort ="Nominal Diameter",TooltipLong ="Nominal Diameter")#line:28
@param (OD2 =LENGTH ,TooltipShort ="Nominal Diameter",TooltipLong ="Nominal Diameter")#line:29
def AX_P1_PLUG_IN_REDUCER (O00000O00OO0O00O0 ,OD1 =25 ,OD2 =16.5 ,**OOOO000OO0O0OOOO0 ):#line:34
	if OD1 ==25 and OD2 ==16.5 :#line:36
	    O00OOOO0OOO000OO0 =34.0 #line:37
	    O000OO00OO0OOO0O0 =51.0 #line:38
	    O0000O0OO00O0OO0O =77.0 #line:39
	elif OD1 ==40 and OD2 ==25 :#line:40
	    O00OOOO0OOO000OO0 =44.5 #line:41
	    O000OO00OO0OOO0O0 =71.0 #line:42
	    O0000O0OO00O0OO0O =100.5 #line:43
	elif OD1 ==50 and OD2 ==25 :#line:45
	    O00OOOO0OOO000OO0 =45.0 #line:46
	    O0000O0OO00O0OO0O =97.0 #line:47
	elif OD1 ==50 and OD2 ==40 :#line:48
	    O00OOOO0OOO000OO0 =67.0 #line:49
	    O0000O0OO00O0OO0O =116.0 #line:50
	elif OD1 ==63 and OD2 ==40 :#line:51
	    O00OOOO0OOO000OO0 =67.0 #line:52
	    O0000O0OO00O0OO0O =120.0 #line:53
	elif OD1 ==63 and OD2 ==50 :#line:54
	    O00OOOO0OOO000OO0 =80.0 #line:55
	    O0000O0OO00O0OO0O =125.0 #line:56
	elif OD1 ==76 and OD2 ==50 :#line:58
	    O0000O0OO00O0OO0O =220.0 #line:59
	elif OD1 ==76 and OD2 ==63 :#line:60
	    O0000O0OO00O0OO0O =230.0 #line:61
	elif OD1 ==100 and OD2 ==50 :#line:62
	    O0000O0OO00O0OO0O =343.0 #line:63
	elif OD1 ==100 and OD2 ==63 :#line:64
	    O0000O0OO00O0OO0O =250.0 #line:65
	elif OD1 ==100 and OD2 ==76 :#line:66
	    O0000O0OO00O0OO0O =192.5 #line:67
	elif OD1 ==168 and OD2 ==76 :#line:68
	    O0000O0OO00O0OO0O =210.0 #line:69
	elif OD1 ==168 and OD2 ==100 :#line:70
	    O0000O0OO00O0OO0O =210.0 #line:71
	if 25 <=OD1 <=40 :#line:74
		OO0O0O0OO00O00O0O =(OD2 /2.0 )+2.0 #line:76
		O00O0O00O00O00000 =(OD1 /2.0 )*1.1 #line:77
		OOO0OO00OO0OOO00O =(O0000O0OO00O0OO0O -O000OO00OO0OOO0O0 )*1.2 #line:78
		OOOOOO0000OOOO0O0 =CONE (O00000O00OO0O00O0 ,R1 =OO0O0O0OO00O00O0O ,R2 =O00OOOO0OOO000OO0 /2.0 ,H =OOO0OO00OO0OOO00O *0.20 ).rotateY (-90 ).translate ((O0000O0OO00O0OO0O ,0 ,0 ))#line:81
		O0O000O0O0O0O0000 =CYLINDER (O00000O00OO0O00O0 ,R =O00OOOO0OOO000OO0 /2.0 ,H =OOO0OO00OO0OOO00O *0.70 ).rotateY (-90 ).translate ((O0000O0OO00O0OO0O -OOO0OO00OO0OOO00O *0.20 ,0 ,0 ))#line:82
		OOOO0OOOOO0OO00OO =CONE (O00000O00OO0O00O0 ,R1 =O00OOOO0OOO000OO0 /2.0 ,R2 =O00O0O00O00O00000 ,H =OOO0OO00OO0OOO00O *0.10 ).rotateY (-90 ).translate ((O0000O0OO00O0OO0O -OOO0OO00OO0OOO00O *0.90 ,0 ,0 ))#line:83
		for OO0O000000OO0O0OO in [O0O000O0O0O0O0000 ,OOOO0OOOOO0OO00OO ]:#line:84
			OOOOOO0000OOOO0O0 .uniteWith (OO0O000000OO0O0OO )#line:85
			OO0O000000OO0O0OO .erase ()#line:86
		O0OOO0OOO000O000O =CYLINDER (O00000O00OO0O00O0 ,R =OD1 /2.0 ,H =O000OO00OO0OOO0O0 ).rotateY (90 )#line:87
		OOOOOO0000OOOO0O0 .uniteWith (O0OOO0OOO000O000O )#line:88
		O0OOO0OOO000O000O .erase ()#line:89
		O0OOOOOO00OO0OO00 =CYLINDER (O00000O00OO0O00O0 ,R =(OD2 /2.0 ),H =O0000O0OO00O0OO0O ).rotateY (90 )#line:90
		OOOOOO0000OOOO0O0 .subtractFrom (O0OOOOOO00OO0OO00 )#line:91
		O0OOOOOO00OO0OO00 .erase ()#line:92
		O00000O00OO0O00O0 .setPoint ((0 ,0 ,0 ),(-1 ,0 ,0 ))#line:97
		O00000O00OO0O00O0 .setPoint ((O000OO00OO0OOO0O0 ,0 ,0 ),(1 ,0 ,0 ))#line:98
	elif 50 <=OD1 <=63 :#line:101
		OO0O0O0OO00O00O0O =(OD2 /2.0 )+2.0 #line:102
		O00O0O00O00O00000 =(OD2 /2.0 )*1.1 #line:103
		OOO0OO00OO0OOO00O =O0000O0OO00O0OO0O *0.70 #line:104
		OO0O0O0OOO00OO0OO =O0000O0OO00O0OO0O -OOO0OO00OO0OOO00O #line:105
		OOOOOO0000OOOO0O0 =CONE (O00000O00OO0O00O0 ,R1 =OO0O0O0OO00O00O0O ,R2 =O00OOOO0OOO000OO0 /2.0 ,H =OOO0OO00OO0OOO00O *0.20 ).rotateY (-90 ).translate ((O0000O0OO00O0OO0O ,0 ,0 ))#line:108
		O0O000O0O0O0O0000 =CYLINDER (O00000O00OO0O00O0 ,R =O00OOOO0OOO000OO0 /2.0 ,H =OOO0OO00OO0OOO00O *0.70 ).rotateY (-90 ).translate ((O0000O0OO00O0OO0O -OOO0OO00OO0OOO00O *0.20 ,0 ,0 ))#line:109
		OOOO0OOOOO0OO00OO =CONE (O00000O00OO0O00O0 ,R1 =O00OOOO0OOO000OO0 /2.0 ,R2 =O00O0O00O00O00000 ,H =OOO0OO00OO0OOO00O *0.10 ).rotateY (-90 ).translate ((O0000O0OO00O0OO0O -OOO0OO00OO0OOO00O *0.90 ,0 ,0 ))#line:110
		for OO0O000000OO0O0OO in [O0O000O0O0O0O0000 ,OOOO0OOOOO0OO00OO ]:#line:111
			OOOOOO0000OOOO0O0 .uniteWith (OO0O000000OO0O0OO )#line:112
			OO0O000000OO0O0OO .erase ()#line:113
		O0OOO0OOO000O000O =CYLINDER (O00000O00OO0O00O0 ,R =(OD1 /2.0 )-4 ,H =OO0O0O0OOO00OO0OO *1.5 ).rotateY (90 )#line:115
		OOO00O0OO0000O0OO =CYLINDER (O00000O00OO0O00O0 ,R =OD1 /2.0 ,H =OO0O0O0OOO00OO0OO *0.50 ).rotateY (90 )#line:116
		O0O000O00OO0OO0O0 =CPC (O00000O00OO0O00O0 ,D =OD1 ,L =OO0O0O0OOO00OO0OO *0.40 ,L1 =10 ,DISP =0 ,OF =-1.0 ).translate ((OO0O0O0OOO00OO0OO *0.50 ,0 ,0 ))#line:117
		for OO0O000000OO0O0OO in [O0OOO0OOO000O000O ,OOO00O0OO0000O0OO ,O0O000O00OO0OO0O0 ]:#line:118
		    OOOOOO0000OOOO0O0 .uniteWith (OO0O000000OO0O0OO )#line:119
		    OO0O000000OO0O0OO .erase ()#line:120
		O0O00O0O0OO00OO00 =CYLINDER (O00000O00OO0O00O0 ,R =OD2 /2.0 ,H =O0000O0OO00O0OO0O ).rotateY (90 )#line:121
		OOOOOO0000OOOO0O0 .subtractFrom (O0O00O0O0OO00OO00 )#line:122
		O0O00O0O0OO00OO00 .erase ()#line:123
		O00000O00OO0O00O0 .setPoint ((0 ,0 ,0 ),(-1 ,0 ,0 ))#line:130
		O00000O00OO0O00O0 .setPoint ((O0000O0OO00O0OO0O *.60 ,0 ,0 ),(1 ,0 ,0 ))#line:131
	elif 76 <=OD1 <=168 :#line:133
		O00OOO00O0OO00O0O =34.90 #line:135
		OOO000OO0O0O000OO =CYLINDER (O00000O00OO0O00O0 ,R =OD1 /2.0 ,H =O0000O0OO00O0OO0O *0.50 ).rotateY (90 )#line:137
		OO0OO00O000O00OOO =CONE (O00000O00OO0O00O0 ,R1 =OD1 /2.0 ,R2 =OD2 /2.0 ,H =O0000O0OO00O0OO0O *0.05 ).rotateY (90 ).translate ((O0000O0OO00O0OO0O *0.50 ,0 ,0 ))#line:138
		O0OOO0OOO000O000O =CYLINDER (O00000O00OO0O00O0 ,R =OD2 /2.0 ,H =O0000O0OO00O0OO0O ).rotateY (90 )#line:139
		OOOOOO0O0O0O0O0O0 =TORUS (O00000O00OO0O00O0 ,R1 =(OD2 /2.0 )-2.0 ,R2 =4.0 ).rotateY (90 ).translate ((O0000O0OO00O0OO0O -O00OOO00O0OO00O0O ,0 ,0 ))#line:141
		O00OO000OO0O00000 =TORUS (O00000O00OO0O00O0 ,R1 =(OD1 /2.0 )-2.0 ,R2 =4.0 ).rotateY (90 ).translate ((O00OOO00O0OO00O0O ,0 ,0 ))#line:142
		for OO0O000000OO0O0OO in [OO0OO00O000O00OOO ,O0OOO0OOO000O000O ,OOOOOO0O0O0O0O0O0 ,O00OO000OO0O00000 ]:#line:144
		    OOO000OO0O0O000OO .uniteWith (OO0O000000OO0O0OO )#line:145
		    OO0O000000OO0O0OO .erase ()#line:146
		O0O000OO0OOO0O0OO =CYLINDER (O00000O00OO0O00O0 ,R =(OD1 /2.0 )-2 ,H =O0000O0OO00O0OO0O /2.0 ).rotateY (90 )#line:148
		OOO00000OO00O0OOO =CYLINDER (O00000O00OO0O00O0 ,R =(OD2 /2.0 )-2 ,H =O0000O0OO00O0OO0O /2.0 ).rotateY (-90 ).translate ((O0000O0OO00O0OO0O ,0 ,0 ))#line:149
		for OO0O000000OO0O0OO in [O0O000OO0OOO0O0OO ,OOO00000OO00O0OOO ]:#line:151
		    OOO000OO0O0O000OO .subtractFrom (OO0O000000OO0O0OO )#line:152
		    OO0O000000OO0O0OO .erase ()#line:153
		O00000O00OO0O00O0 .setPoint ((0 ,0 ,0 ),(-1 ,0 ,0 ))#line:166
		O00000O00OO0O00O0 .setPoint ((O0000O0OO00O0OO0O ,0 ,0 ),(1 ,0 ,0 ))#line:167
