# 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:17
			   sys .path .append (os .path .dirname (os .path .abspath (__file__ )))#line:18
from AX_BOXF import *#line:21
from AX_NUTS import *#line:22
@activate (Group ="ValveBody",TooltipShort ="Valve",TooltipLong ="Valve",LengthUnit ="mm",Ports ="2")#line:25
@group ("MainDimensions")#line:26
@param (DN =LENGTH ,TooltipShort ="Nominal Diameter",TooltipLong ="Nominal Diameter")#line:27
def AX_P1_MINI_BALLVALVE (O00OOO000OOOOO00O ,DN =15 ,AA =0 ,**O0OO0OOOO0O00O00O ):#line:32
	OO0OO00O0O000O0OO =21.0 #line:34
	DN =15.0 #line:35
	OO0O0O00O00O00OO0 =25.0 #line:36
	OO000O0OOOO0O0O00 =31.0 #line:37
	O0OO000000000O0OO =46.0 #line:38
	O0OOOO0OO000O0OOO =20.5 #line:39
	OOOOOO000OO00OOOO =OO0O0O00O00O00OO0 #line:42
	OOOO0O0O0000OO0OO =OOOOOO000OO00OOOO /math .sqrt (3 )#line:44
	OO0OO0OOOO0O00O0O =2 *OOOO0O0O0000OO0OO #line:46
	OO0OO00OOOOO00OO0 =AX_NUTS (O00OOO000OOOOO00O ,D =OO0OO0OOOO0O00O0O ,O =0.0 ,T =O0OO000000000O0OO *0.75 ,F =6.0 ,FI =0.0 ).translate ((O0OO000000000O0OO /2 ,0 ,0 )).rotateX (90 )#line:48
	O00O000OO0OOOO000 =CBOLT6_001 (O00OOO000OOOOO00O ,D =OO0OO00O0O000O0OO ,L =O0OO000000000O0OO /2.0 ,W =OO0OO00O0O000O0OO ,H =0.0 ).rotateY (180 )#line:49
	OO0OO00OOOOO00OO0 .uniteWith (O00O000OO0OOOO000 )#line:50
	O00O000OO0OOOO000 .erase ()#line:51
	O00OO000O0O000OOO =AX_BOXF (O00OOO000OOOOO00O ,W =O0OOOO0OO000O0OOO ,L =12.0 ,H =OO000O0OOOO0O0O00 ,R =0.0 ,T =0 ).translate ((O0OOOO0OO000O0OOO /2.0 ,0 ,0 ))#line:53
	O0OO0OOOO0O000O00 =AX_BOXF (O00OOO000OOOOO00O ,W =(O0OO000000000O0OO *0.75 )-O0OOOO0OO000O0OOO -5.0 ,L =12.0 ,H =OO000O0OOOO0O0O00 ,R =0.0 ,T =0 ).translate ((-((O0OO000000000O0OO *0.75 )-O0OOOO0OO000O0OOO -5.0 )/2.0 ,0 ,0 ))#line:54
	O000OO00OO000000O =CYLINDER (O00OOO000OOOOO00O ,R =13 /2.0 ,H =OO000O0OOOO0O0O00 )#line:55
	for OO0O0OOOO000OOO00 in [O0OO0OOOO0O000O00 ,O000OO00OO000000O ]:#line:56
		O00OO000O0O000OOO .uniteWith (OO0O0OOOO000OOO00 )#line:57
		OO0O0OOOO000OOO00 .erase ()#line:58
	O0OO0OO0OOOOOO00O =O0OOOO0OO000O0OOO *2.0 #line:60
	OO0OO00OO00OO0O00 =OO000O0OOOO0O0O00 #line:61
	O0O0OOO0O0O0O000O =AX_BOXF (O00OOO000OOOOO00O ,W =O0OO0OO0OOOOOO00O ,L =16.0 ,H =OO0OO00OO00OO0O00 ,R =0.0 ,T =0 ).translate ((-O0OO0OO0OOOOOO00O /2.0 ,0 ,0 )).rotateY (-20 ).translate ((O0OOOO0OO000O0OOO ,0 ,OO000O0OOOO0O0O00 ))#line:63
	O0OOO0O00OO0O0OOO =AX_BOXF (O00OOO000OOOOO00O ,W =O0OO0OO0OOOOOO00O ,L =16.0 ,H =OO0OO00OO00OO0O00 ,R =0.0 ,T =0 ).translate ((-O0OO0OO0OOOOOO00O /2.0 ,0 ,0 )).rotateY (-50 ).translate ((O0OOOO0OO000O0OOO -26 ,0 ,OO000O0OOOO0O0O00 -9.3 ))#line:64
	O0000000O0OO0OO0O =AX_BOXF (O00OOO000OOOOO00O ,W =O0OO0OO0OOOOOO00O ,L =16.0 ,H =OO000O0OOOO0O0O00 ,R =0.0 ,T =0 ).rotateX (180 ).translate ((0 ,0 ,OO0O0O00O00O00OO0 /2.0 ))#line:65
	for OO0O0OOOO000OOO00 in [O0O0OOO0O0O0O000O ,O0OOO0O00OO0O0OOO ,O0000000O0OO0OO0O ]:#line:66
		O00OO000O0O000OOO .subtractFrom (OO0O0OOOO000OOO00 )#line:67
		OO0O0OOOO000OOO00 .erase ()#line:68
	if AA %180 ==90 :#line:71
		O00OO000O0O000OOO .rotateZ (AA )#line:72
		O00OO000O0O000OOO .setColor (251 )#line:73
	O00OO000O0O000OOO .setColor (251 )#line:77
	OO000O00000O000OO =CYLINDER (O00OOO000OOOOO00O ,R =OO0OO00O0O000O0OO /2.0 ,H =O0OOOO0OO000O0OOO /2.0 ).rotateY (-90 ).translate ((O0OO000000000O0OO /2.0 ,0 ,0 ))#line:78
	OO0OO00OOOOO00OO0 .subtractFrom (OO000O00000O000OO )#line:79
	OO000O00000O000OO .erase ()#line:80
	O0O0000OO0O000OOO =CYLINDER (O00OOO000OOOOO00O ,R =OO0OO00O0O000O0OO /2.5 ,H =O0OO000000000O0OO ).rotateY (-90 ).translate ((O0OO000000000O0OO /2.0 ,0 ,0 ))#line:81
	OO0OO00OOOOO00OO0 .subtractFrom (O0O0000OO0O000OOO )#line:82
	O0O0000OO0O000OOO .erase ()#line:83
	O00OOO000OOOOO00O .setPoint ((O0OO000000000O0OO /2.0 -O0OOOO0OO000O0OOO /2.0 ,0 ,0 ),(1 ,0 ,0 ))#line:89
	O00OOO000OOOOO00O .setPoint ((-O0OO000000000O0OO /2.0 +O0OO000000000O0OO *0.25 ,0 ,0 ),(-1 ,0 ,0 ))#line:90
