# 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: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
from AX_NUTS import *#line:24
@activate (Group ="Support",TooltipShort ="Fixing clip",TooltipLong ="Fixing clip",LengthUnit ="mm",Ports ="2")#line:27
@group ("MainDimensions")#line:28
@param (OD =LENGTH ,TooltipShort ="Nominal Diameter",TooltipLong ="Nominal Diameter")#line:29
@param (DISTANCE =LENGTH ,TooltipShort ="Length",TooltipLong ="Length")#line:30
def AX_P1_FIXING_CLIP (O0O0O0OOO0OO00000 ,OD =16.5 ,DISTANCE =300 ,**O00OO00O000O00000 ):#line:35
	if OD ==16.5 :#line:37
		OO0000O0O000000O0 =8.0 #line:38
		O0OO000OOO0000OO0 =46.0 #line:39
		O0OO0000OO0O0O0OO =61.0 #line:40
		OOOOO0OOOO00O0O00 =30.0 #line:41
		OO0OO0000O00O0O00 =33.0 #line:42
	elif OD ==25.0 :#line:43
		OO0000O0O000000O0 =8.0 #line:44
		O0OO000OOO0000OO0 =46.0 #line:45
		O0OO0000OO0O0O0OO =67.0 #line:46
		OOOOO0OOOO00O0O00 =30.0 #line:47
		OO0OO0000O00O0O00 =38.0 #line:48
	elif OD ==40.0 :#line:49
		OO0000O0O000000O0 =8.0 #line:50
		O0OO000OOO0000OO0 =46.0 #line:51
		O0OO0000OO0O0O0OO =74.0 #line:52
		OOOOO0OOOO00O0O00 =30.0 #line:53
		OO0OO0000O00O0O00 =50.0 #line:54
	elif OD ==50.0 :#line:56
		OO0000O0O000000O0 =10.0 #line:57
		O0OO000OOO0000OO0 =90.0 #line:58
		O0OO0000OO0O0O0OO =122.0 #line:59
		OOOOO0OOOO00O0O00 =30.0 #line:60
		OO0OO0000O00O0O00 =61.0 #line:61
	elif OD ==63.0 :#line:62
		OO0000O0O000000O0 =10.0 #line:63
		O0OO000OOO0000OO0 =90.0 #line:64
		O0OO0000OO0O0O0OO =127.5 #line:65
		OOOOO0OOOO00O0O00 =30.0 #line:66
		OO0OO0000O00O0O00 =73.5 #line:67
	elif 76.0 <=OD <=168.0 :#line:69
		O0OO000O0OOOOO0OO =8.0 #line:70
		OOOO0OO00OO0OOOO0 =10.0 #line:71
		OOOOO0OOOO00O0O00 =30.0 #line:72
	if 16.5 <=OD <=63.0 :#line:74
		OO0000OOOOO0O0000 =CYLINDER (O0O0O0OOO0OO00000 ,R1 =OO0OO0000O00O0O00 /2.0 ,R2 =(O0OO0000OO0O0O0OO /2.0 )*1.8 ,H =OOOOO0OOOO00O0O00 ).rotateX (-90 ).translate ((0 ,-OOOOO0OOOO00O0O00 /2.0 ,0 ))#line:75
		OOOO0O00OO0O0O00O =CYLINDER (O0O0O0OOO0OO00000 ,R1 =(OO0OO0000O00O0O00 /2.0 )-1 ,R2 =((O0OO0000OO0O0O0OO /2.0 )*1.8 )-1 ,H =OOOOO0OOOO00O0O00 ).rotateX (-90 ).translate ((0 ,-OOOOO0OOOO00O0O00 /2.0 ,0 ))#line:76
		OO0000OOOOO0O0000 .subtractFrom (OOOO0O00OO0O0O00O )#line:77
		OOOO0O00OO0O0O00O .erase ()#line:78
		OO0O0OOOOO00OO00O =CYLINDER (O0O0O0OOO0OO00000 ,R1 =OO0OO0000O00O0O00 /2.0 ,R2 =(O0OO0000OO0O0O0OO /2.0 )*1.8 ,H =OO0000O0O000000O0 ).rotateX (-90 ).translate ((0 ,-OO0000O0O000000O0 /2.0 ,0 ))#line:79
		OO0000OOOOO0O0000 .uniteWith (OO0O0OOOOO00OO00O )#line:80
		OO0O0OOOOO00OO00O .erase ()#line:81
		OOO000O0OOO000O0O =CYLINDER (O0O0O0OOO0OO00000 ,R =(OD /2.0 )+1 ,H =OOOOO0OOOO00O0O00 ).rotateX (-90 ).translate ((0 ,-OOOOO0OOOO00O0O00 /2.0 ,0 ))#line:82
		OO0000OOOOO0O0000 .uniteWith (OOO000O0OOO000O0O )#line:83
		OOO000O0OOO000O0O .erase ()#line:84
		O0O0O00O0O00OO0O0 =AX_BOXF (O0O0O0OOO0OO00000 ,W =OO0OO0000O00O0O00 ,L =OOOOO0OOOO00O0O00 ,H =O0OO000OOO0000OO0 ,R =0.0 ,T =0 ).translate ((0 ,0 ,O0OO000OOO0000OO0 -5 ))#line:87
		OO0000O000O0OOO00 =AX_BOXF (O0O0O0OOO0OO00000 ,W =OO0OO0000O00O0O00 ,L =OOOOO0OOOO00O0O00 ,H =O0OO000OOO0000OO0 ,R =0.0 ,T =0 ).rotateX (180 ).translate ((0 ,0 ,-(O0OO0000OO0O0O0OO -O0OO000OOO0000OO0 )+5 ))#line:88
		for OO0OO0O000OO0OOO0 in [O0O0O00O0O00OO0O0 ,OO0000O000O0OOO00 ]:#line:89
			OO0000OOOOO0O0000 .uniteWith (OO0OO0O000OO0OOO0 )#line:90
			OO0OO0O000OO0OOO0 .erase ()#line:91
		O00O000OO0OO00OOO =AX_BOXF (O0O0O0OOO0OO00000 ,W =OO0OO0000O00O0O00 ,L =OOOOO0OOOO00O0O00 ,H =O0OO000OOO0000OO0 ,R =0.0 ,T =0 ).translate ((0 ,0 ,O0OO000OOO0000OO0 ))#line:94
		OOO000OOOO0O0O0OO =AX_BOXF (O0O0O0OOO0OO00000 ,W =OO0OO0000O00O0O00 ,L =OOOOO0OOOO00O0O00 ,H =O0OO000OOO0000OO0 ,R =0.0 ,T =0 ).rotateX (180 ).translate ((0 ,0 ,-(O0OO0000OO0O0O0OO -O0OO000OOO0000OO0 )))#line:95
		for OO0OO0O000OO0OOO0 in [O00O000OO0OO00OOO ,OOO000OOOO0O0O0OO ]:#line:96
			OO0000OOOOO0O0000 .subtractFrom (OO0OO0O000OO0OOO0 )#line:97
			OO0OO0O000OO0OOO0 .erase ()#line:98
		O00O00OOO0OOOO000 =O0OO000OOO0000OO0 *0.25 #line:100
		O000OOOO00O00O00O =OO0OO0000O00O0O00 #line:101
		O00O0OO0O00O000OO =O0OO000OOO0000OO0 *0.60 #line:102
		O000O0O0OO00O0O00 =AX_BOXF (O0O0O0OOO0OO00000 ,W =O000OOOO00O00O00O ,L =O00O00OOO0OOOO000 ,H =OOOOO0OOOO00O0O00 ,R =4.0 ,T =4 ).rotateX (-90 ).translate ((O000OOOO00O00O00O /2.0 ,0 ,0 )).rotateY (-15 ).translate (((OO0OO0000O00O0O00 /2.0 )*0.30 ,-OOOOO0OOOO00O0O00 /2.0 ,O00O0OO0O00O000OO ))#line:104
		OO0000OOOOO0O0000 .uniteWith (O000O0O0OO00O0O00 )#line:105
		O000O0O0OO00O0O00 .erase ()#line:106
		OOO000OO000OO0000 =AX_BOXF (O0O0O0OOO0OO00000 ,W =O000OOOO00O00O00O -2 ,L =O00O00OOO0OOOO000 -2 ,H =OOOOO0OOOO00O0O00 ,R =4.0 ,T =4 ).rotateX (-90 ).translate ((O000OOOO00O00O00O /2.0 ,0 ,0 )).rotateY (-15 ).translate (((OO0OO0000O00O0O00 /2.0 )*0.30 ,-OOOOO0OOOO00O0O00 /2.0 ,O00O0OO0O00O000OO ))#line:107
		OO0000OOOOO0O0000 .subtractFrom (OOO000OO000OO0000 )#line:108
		OOO000OO000OO0000 .erase ()#line:109
		OOOOOOO0OO0OO0OOO =CYLINDER (O0O0O0OOO0OO00000 ,R1 =(OO0OO0000O00O0O00 /2.0 )*4 ,R2 =((O0OO0000OO0O0O0OO /2.0 )*1.8 )*4 ,H =OOOOO0OOOO00O0O00 ,O =OO0OO0000O00O0O00 /2.0 ).rotateX (-90 ).translate ((0 ,-OOOOO0OOOO00O0O00 /2.0 ,0 ))#line:111
		OO0000OOOOO0O0000 .subtractFrom (OOOOOOO0OO0OO0OOO )#line:112
		OOOOOOO0OO0OO0OOO .erase ()#line:113
		OO0000O000O000O00 =DISTANCE #line:116
		OO0000O000OOO00OO =CYLINDER (O0O0O0OOO0OO00000 ,R =OO0000O0O000000O0 /2.0 ,H =OO0000O000O000O00 )#line:117
		OOO00O00O000O0O00 =CYLINDER (O0O0O0OOO0OO00000 ,R =(OO0000O0O000000O0 /2.0 )+2 ,H =O0OO000OOO0000OO0 )#line:118
		for OO0OO0O000OO0OOO0 in [OO0000O000OOO00OO ,OOO00O00O000O0O00 ]:#line:119
			OO0000OOOOO0O0000 .uniteWith (OO0OO0O000OO0OOO0 )#line:120
			OO0OO0O000OO0OOO0 .erase ()#line:121
		O00000OOO000OO00O =CYLINDER (O0O0O0OOO0OO00000 ,R =OD /2.0 ,H =OOOOO0OOOO00O0O00 ).rotateX (-90 ).translate ((0 ,-OOOOO0OOOO00O0O00 /2.0 ,0 ))#line:123
		OO0000OOOOO0O0000 .subtractFrom (O00000OOO000OO00O )#line:124
		O00000OOO000OO00O .erase ()#line:125
		O0O0O0OOO0OO00000 .setPoint ((0 ,0 ,0 ),(0 ,-1 ,0 ))#line:134
		O0O0O0OOO0OO00000 .setPoint ((0 ,0 ,0 ),(0 ,1 ,0 ))#line:135
		O0O0O0OOO0OO00000 .setPoint ((0 ,0 ,OO0000O000O000O00 ),(0 ,0 ,-1 ))#line:136
	elif 76.0 <=OD <=168.0 :#line:138
		O00OO000000O000OO =OOOOO0OOOO00O0O00 *0.30 #line:139
		O0O00O00OO0000O00 =(OD +2.0 )/2.0 #line:140
		OO0000O0O00OO0000 =(OD +8.0 )/2.0 #line:141
		O0O000OOO0OO0OOO0 =CYLINDER (O0O0O0OOO0OO00000 ,R =O0O00O00OO0000O00 ,H =OOOOO0OOOO00O0O00 ).rotateX (-90 ).translate ((0 ,-OOOOO0OOOO00O0O00 /2.0 ,0 ))#line:142
		O0OO0OO0000O00OO0 =CYLINDER (O0O0O0OOO0OO00000 ,R =OO0000O0O00OO0000 ,H =O00OO000000O000OO ).rotateX (90 ).translate ((0 ,OOOOO0OOOO00O0O00 /2.0 ,0 ))#line:143
		OO0OO0O0000OO00O0 =CYLINDER (O0O0O0OOO0OO00000 ,R =OO0000O0O00OO0000 ,H =O00OO000000O000OO ).rotateX (-90 ).translate ((0 ,-OOOOO0OOOO00O0O00 /2.0 ,0 ))#line:144
		OOO0OO00OOOOO00O0 =AX_BOXF (O0O0O0OOO0OO00000 ,W =OO0000O0O00OO0000 *2.0 +(OOOO0OO00OO0OOOO0 *4.0 ),L =OOOOO0OOOO00O0O00 *0.60 ,H =3.0 ,R =(OOOOO0OOOO00O0O00 *0.40 )/4.0 ,T =4 ).translate ((0 ,0 ,-3 /2.0 ))#line:145
		O0O0O00OO00000000 =CBOLT6_001 (O0O0O0OOO0OO00000 ,D =O0OO000O0OOOOO0OO ,L =OD *0.20 ,W =0.0 ,H =0.0 ).rotateY (-90 ).translate ((-OO0000O0O00OO0000 -OOOO0OO00OO0OOOO0 ,0 ,-1.5 ))#line:146
		O0OOOOOO0000000O0 =CBOLT6_001 (O0O0O0OOO0OO00000 ,D =O0OO000O0OOOOO0OO ,L =OD *0.20 ,W =0.0 ,H =0.0 ).rotateY (-90 ).translate ((OO0000O0O00OO0000 +OOOO0OO00OO0OOOO0 ,0 ,-1.5 ))#line:147
		OOOOO000OOOOO00O0 =AX_NUTS (O0O0O0OOO0OO00000 ,D =OOOOO0OOOO00O0O00 *0.40 ,O =O0OO000O0OOOOO0OO ,T =OO0000O0O00OO0000 +OD *0.10 ,F =6.0 ,FI =.0 ).rotateY (90 )#line:148
		O0O00O0OO0O0O0OOO =CYLINDER (O0O0O0OOO0OO00000 ,R =OD /2.0 ,H =OOOOO0OOOO00O0O00 ).rotateX (-90 ).translate ((0 ,-OOOOO0OOOO00O0O00 /2.0 ,0 ))#line:150
		for OO0OO0O000OO0OOO0 in [O0OO0OO0000O00OO0 ,OO0OO0O0000OO00O0 ,OOO0OO00OOOOO00O0 ,O0O0O00OO00000000 ,O0OOOOOO0000000O0 ,OOOOO000OOOOO00O0 ]:#line:152
		    O0O000OOO0OO0OOO0 .uniteWith (OO0OO0O000OO0OOO0 )#line:153
		    OO0OO0O000OO0OOO0 .erase ()#line:154
		OO0000O000O000O00 =DISTANCE #line:157
		OO0000O000OOO00OO =CYLINDER (O0O0O0OOO0OO00000 ,R =O0OO000O0OOOOO0OO /2.0 ,H =OO0000O000O000O00 )#line:158
		O0O000OOO0OO0OOO0 .uniteWith (OO0000O000OOO00OO )#line:159
		OO0000O000OOO00OO .erase ()#line:160
		O0O000OOO0OO0OOO0 .subtractFrom (O0O00O0OO0O0O0OOO )#line:163
		O0O00O0OO0O0O0OOO .erase ()#line:164
		O0O0O0OOO0OO00000 .setPoint ((0 ,0 ,0 ),(0 ,1 ,0 ))#line:166
		O0O0O0OOO0OO00000 .setPoint ((0 ,0 ,OO0000O0O00OO0000 +OD *0.05 ),(0 ,0 ,1 ))#line:167
