# 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 .divsub .cbolt6_001 import *#line:14
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 ="Coupling",TooltipShort ="MALE STUD FITTING",TooltipLong ="MALE STUD FITTING",LengthUnit ="mm",Ports ="2")#line:24
@group ("MainDimensions")#line:25
@param (OD =LENGTH ,TooltipShort ="Nominal Diameter",TooltipLong ="Nominal Diameter")#line:26
@param (C =LENGTH ,TooltipShort ="Thread Dia",TooltipLong ="Thread Dia")#line:27
def AX_P1_MALE_STUD_FITTING (O0O0O0O00O0OO0000 ,OD =16.5 ,C =0.25 ,**OOOOOOO0OOOOO0OO0 ):#line:32
	if C ==0.25 :#line:34
		O0OOO0O0O0O0OO00O =13.16 #line:35
	elif C ==0.5 :#line:36
		O0OOO0O0O0O0OO00O =21.0 #line:37
	elif C ==0.75 :#line:38
		O0OOO0O0O0O0OO00O =26.44 #line:39
	elif C ==1.0 :#line:40
		O0OOO0O0O0O0OO00O =33.25 #line:41
	elif C ==1.25 :#line:42
		O0OOO0O0O0O0OO00O =41.91 #line:43
	elif C ==1.5 :#line:44
		O0OOO0O0O0O0OO00O =47.80 #line:45
	elif C ==2.0 :#line:46
		O0OOO0O0O0O0OO00O =59.61 #line:47
	elif C ==2.5 :#line:48
		O0OOO0O0O0O0OO00O =75.18 #line:49
	if OD ==16.5 and C ==0.25 :#line:51
	    OOO0O000O0000OOOO =20 #line:52
	    OO000O0OO0OOO0O00 =9.5 #line:53
	    OOOO0OO0O0O0OO0OO =34 #line:54
	    OOO00OO0OO0OO000O =62.5 #line:55
	elif OD ==16.5 and C ==0.5 :#line:56
	    OOO0O000O0000OOOO =24 #line:57
	    OO000O0OO0OOO0O00 =12 #line:58
	    OOOO0OO0O0O0OO0OO =34 #line:59
	    OOO00OO0OO0OO000O =65 #line:60
	elif OD ==25 and C ==0.5 :#line:61
	    OOO0O000O0000OOOO =30 #line:62
	    OO000O0OO0OOO0O00 =15 #line:63
	    OOOO0OO0O0O0OO0OO =44.5 #line:64
	    OOO00OO0OO0OO000O =70 #line:65
	elif OD ==25 and C ==0.75 :#line:66
	    OOO0O000O0000OOOO =30 #line:67
	    OO000O0OO0OOO0O00 =16 #line:68
	    OOOO0OO0O0O0OO0OO =44.5 #line:69
	    OOO00OO0OO0OO000O =71 #line:70
	elif OD ==25 and C ==1.0 :#line:71
	    OOO0O000O0000OOOO =38 #line:72
	    OO000O0OO0OOO0O00 =16 #line:73
	    OOOO0OO0O0O0OO0OO =44.5 #line:74
	    OOO00OO0OO0OO000O =71 #line:75
	elif OD ==40 and C ==1.0 :#line:76
	    OOO0O000O0000OOOO =41 #line:77
	    OO000O0OO0OOO0O00 =16 #line:78
	    OOOO0OO0O0O0OO0OO =67 #line:79
	    OOO00OO0OO0OO000O =111 #line:80
	elif OD ==40 and C ==1.25 :#line:81
	    OOO0O000O0000OOOO =43 #line:82
	    OO000O0OO0OOO0O00 =19.5 #line:83
	    OOOO0OO0O0O0OO0OO =67 #line:84
	    OOO00OO0OO0OO000O =111 #line:85
	elif OD ==40 and C ==1.5 :#line:86
	    OOO0O000O0000OOOO =50 #line:87
	    OO000O0OO0OOO0O00 =24.5 #line:88
	    OOOO0OO0O0O0OO0OO =67 #line:89
	    OOO00OO0OO0OO000O =115 #line:90
	elif OD ==50 and C ==1.5 :#line:91
	    OOO0O000O0000OOOO =65 #line:92
	    OO000O0OO0OOO0O00 =22.9 #line:93
	    OOOO0OO0O0O0OO0OO =80 #line:94
	    OOO00OO0OO0OO000O =121 #line:95
	elif OD ==50 and C ==2.0 :#line:96
	    OOO0O000O0000OOOO =65 #line:97
	    OO000O0OO0OOO0O00 =27.2 #line:98
	    OOOO0OO0O0O0OO0OO =80 #line:99
	    OOO00OO0OO0OO000O =125 #line:100
	elif OD ==63 and C ==2.0 :#line:101
	    OOO0O000O0000OOOO =80 #line:102
	    OO000O0OO0OOO0O00 =27.2 #line:103
	    OOOO0OO0O0O0OO0OO =91 #line:104
	    OOO00OO0OO0OO000O =123 #line:105
	elif OD ==63 and C ==2.5 :#line:106
	    OOO0O000O0000OOOO =80 #line:107
	    OO000O0OO0OOO0O00 =30.5 #line:108
	    OOOO0OO0O0O0OO0OO =91 #line:109
	    OOO00OO0OO0OO000O =127 #line:110
	if 16.5 <=OD <=40 :#line:112
		O0OOOOO0000OOO00O =OO000O0OO0OOO0O00 /2.0 #line:113
	elif 50 <=OD <=63 :#line:114
		O0OOOOO0000OOO00O =OO000O0OO0OOO0O00 #line:115
	OO0OO0OO00OOO00OO =(OD /2.0 )+2.0 #line:118
	OO0O0O00OO0O00O00 =(OD /2.0 )*1.1 #line:119
	OO0OOO0O00OO00OO0 =OOO00OO0OO0OO000O -OO000O0OO0OOO0O00 -O0OOOOO0000OOO00O #line:120
	OO0O000O000OOO0OO =CONE (O0O0O0O00O0OO0000 ,R1 =OO0OO0OO00OOO00OO ,R2 =OOOO0OO0O0O0OO0OO /2.0 ,H =OO0OOO0O00OO00OO0 *0.20 ).rotateY (-90 ).translate ((OOO00OO0OO0OO000O ,0 ,0 ))#line:123
	OOO000O000000OOOO =CYLINDER (O0O0O0O00O0OO0000 ,R =OOOO0OO0O0O0OO0OO /2.0 ,H =OO0OOO0O00OO00OO0 *0.75 ).rotateY (-90 ).translate ((OOO00OO0OO0OO000O -OO0OOO0O00OO00OO0 *0.20 ,0 ,0 ))#line:124
	O0O00OOOO00O00OO0 =CONE (O0O0O0O00O0OO0000 ,R1 =OOOO0OO0O0O0OO0OO /2.0 ,R2 =OO0O0O00OO0O00O00 *1.1 ,H =OO0OOO0O00OO00OO0 *0.05 ).rotateY (-90 ).translate ((OOO00OO0OO0OO000O -OO0OOO0O00OO00OO0 *0.95 ,0 ,0 ))#line:125
	for OO00OOOO0OOO0O00O in [OOO000O000000OOOO ,O0O00OOOO00O00OO0 ]:#line:126
		OO0O000O000OOO0OO .uniteWith (OO00OOOO0OOO0O00O )#line:127
		OO00OOOO0OOO0O00O .erase ()#line:128
	OO0O000O000OOO0OO .rotateY (-90 )#line:129
	O0000000O0000000O =CBOLT6_001 (O0O0O0O00O0OO0000 ,D =O0OOO0O0O0O0OO00O ,L =OO000O0OO0OOO0O00 ,W =OOO0O000O0000OOOO ,H =O0OOOOO0000OOO00O ).rotateY (90 ).translate ((0 ,0 ,OO000O0OO0OOO0O00 ))#line:131
	OO0O000O000OOO0OO .uniteWith (O0000000O0000000O )#line:132
	O0000000O0000000O .erase ()#line:133
	OOOOOOO0O00O00000 =CYLINDER (O0O0O0O00O0OO0000 ,R =OD /2.0 ,H =OO0OOO0O00OO00OO0 *0.95 ).rotateY (180 ).translate ((0 ,0 ,OOO00OO0OO0OO000O ))#line:135
	O000O0OO0OO00OOO0 =CYLINDER (O0O0O0O00O0OO0000 ,R =(O0OOO0O0O0O0OO00O /2.0 )-3 ,H =OOO00OO0OO0OO000O )#line:136
	for OO00OOOO0OOO0O00O in [OOOOOOO0O00O00000 ,O000O0OO0OO00OOO0 ]:#line:137
		OO0O000O000OOO0OO .subtractFrom (OO00OOOO0OOO0O00O )#line:138
		OO00OOOO0OOO0O00O .erase ()#line:139
	O0O0O0O00O0OO0000 .setPoint ((0 ,0 ,OO000O0OO0OOO0O00 +O0OOOOO0000OOO00O +OO0OOO0O00OO00OO0 *0.30 ),(0 ,0 ,1 ))#line:161
	O0O0O0O00O0OO0000 .setPoint ((0 ,0 ,0 ),(0 ,0 ,-1 ))#line:162
