# 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
from AX_HANDLEVERS import *#line:22
@activate (Group ="ValveBody",TooltipShort ="LOCKABLE DOUBLE BALL VALVE",TooltipLong ="LOCKABLE DOUBLE BALL VALVE",LengthUnit ="mm",Ports ="2")#line:25
@group ("MainDimensions")#line:26
@param (OD =LENGTH ,TooltipShort ="Nominal Diameter",TooltipLong ="Nominal Diameter")#line:27
@param (AA =LENGTH ,TooltipShort ="Rotation Angle",TooltipLong ="Rotation Angle")#line:28
def AX_P1_LOCKABLE_D_BALL_VALVE (OO0O0OOOO0OO0OOO0 ,OD =16.5 ,AA =0 ,**O00000O0O000O0O0O ):#line:33
	if OD ==16.5 :#line:35
	    O000OO0000O0O00OO =34.0 #line:36
	    OOO00O000O0O0000O =123.0 #line:37
	    O00O00O000O000O0O =96.0 #line:38
	    O0OO0OO0OO00O0000 =51.0 #line:39
	    O0000O000O00000OO =29.0 #line:40
	    OOOO000000O0O0O00 =43.0 #line:41
	elif OD ==25.0 :#line:42
	    O000OO0000O0O00OO =44.0 #line:43
	    OOO00O000O0O0000O =155.0 #line:44
	    O00O00O000O000O0O =117.0 #line:45
	    O0OO0OO0OO00O0000 =73.0 #line:46
	    O0000O000O00000OO =41.0 #line:47
	    OOOO000000O0O0O00 =57.0 #line:48
	elif OD ==40.0 :#line:49
	    O000OO0000O0O00OO =67.0 #line:50
	    OOO00O000O0O0000O =205.0 #line:51
	    O00O00O000O000O0O =141.0 #line:52
	    O0OO0OO0OO00O0000 =76.0 #line:53
	    O0000O000O00000OO =57.0 #line:54
	    OOOO000000O0O0O00 =58.0 #line:55
	elif OD ==50.0 :#line:56
	    O000OO0000O0O00OO =80.0 #line:57
	    OOO00O000O0O0000O =224.0 #line:58
	    O00O00O000O000O0O =156.0 #line:59
	    O0OO0OO0OO00O0000 =90.0 #line:60
	    O0000O000O00000OO =43.0 #line:61
	    OOOO000000O0O0O00 =60.0 #line:62
	elif OD ==63.0 :#line:63
	    O000OO0000O0O00OO =91.0 #line:64
	    OOO00O000O0O0000O =269.0 #line:65
	    O00O00O000O000O0O =200.0 #line:66
	    O0OO0OO0OO00O0000 =109.0 #line:67
	    O0000O000O00000OO =66.0 #line:68
	    OOOO000000O0O0O00 =77.0 #line:69
	OO0O00O0O00O0OOO0 =(OD /2.0 )+2.0 #line:72
	OO0O00OO0O00O000O =(OD /2.0 )*1.1 #line:73
	OO000OOOO0OOOO00O =((OOO00O000O0O0000O /2.0 )-O0000O000O00000OO )*1.1 #line:74
	O00O0OOOOOOO0000O =OOO00O000O0O0000O -(OO000OOOO0OOOO00O *2.0 )#line:75
	O0O00O0OOOO0O0000 =O00O0OOOOOOO0000O *0.95 #line:76
	OO00000O000OOOOOO =CYLINDER (OO0O0OOOO0OO0OOO0 ,R =OO0O00OO0O00O000O ,H =O00O0OOOOOOO0000O ).rotateY (-90 ).translate (((O00O0OOOOOOO0000O /2.0 ),0 ,0 ))#line:78
	OOOOOOOO0OO000O00 =CONE (OO0O0OOOO0OO0OOO0 ,R1 =OO0O00O0O00O0OOO0 ,R2 =O000OO0000O0O00OO /2.0 ,H =OO000OOOO0OOOO00O *0.20 ).rotateY (-90 ).translate ((OOO00O000O0O0000O /2.0 ,0 ,0 ))#line:80
	OOOO0O000O000OOOO =CYLINDER (OO0O0OOOO0OO0OOO0 ,R =O000OO0000O0O00OO /2.0 ,H =OO000OOOO0OOOO00O *0.70 ).rotateY (-90 ).translate (((OOO00O000O0O0000O /2.0 )-OO000OOOO0OOOO00O *0.20 ,0 ,0 ))#line:81
	OOO0OOOO0000000O0 =CONE (OO0O0OOOO0OO0OOO0 ,R1 =O000OO0000O0O00OO /2.0 ,R2 =OO0O00OO0O00O000O *1.1 ,H =OO000OOOO0OOOO00O *0.10 ).rotateY (-90 ).translate (((OOO00O000O0O0000O /2.0 )-OO000OOOO0OOOO00O *0.90 ,0 ,0 ))#line:82
	for OOOO00O0O000OO0OO in [OOOO0O000O000OOOO ,OOO0OOOO0000000O0 ]:#line:83
		OOOOOOOO0OO000O00 .uniteWith (OOOO00O0O000OO0OO )#line:84
		OOOO00O0O000OO0OO .erase ()#line:85
	OO000O00OO0O0000O =CONE (OO0O0OOOO0OO0OOO0 ,R1 =OO0O00O0O00O0OOO0 ,R2 =O000OO0000O0O00OO /2.0 ,H =OO000OOOO0OOOO00O *0.20 ).rotateY (-90 ).translate ((OOO00O000O0O0000O /2.0 ,0 ,0 ))#line:87
	O000OO0O00O00OOO0 =CYLINDER (OO0O0OOOO0OO0OOO0 ,R =O000OO0000O0O00OO /2.0 ,H =OO000OOOO0OOOO00O *0.70 ).rotateY (-90 ).translate (((OOO00O000O0O0000O /2.0 )-OO000OOOO0OOOO00O *0.20 ,0 ,0 ))#line:88
	OOO0O0OO0O0O00O00 =CONE (OO0O0OOOO0OO0OOO0 ,R1 =O000OO0000O0O00OO /2.0 ,R2 =OO0O00OO0O00O000O *1.1 ,H =OO000OOOO0OOOO00O *0.10 ).rotateY (-90 ).translate (((OOO00O000O0O0000O /2.0 )-OO000OOOO0OOOO00O *0.90 ,0 ,0 ))#line:89
	for OOOO00O0O000OO0OO in [O000OO0O00O00OOO0 ,OOO0O0OO0O0O00O00 ]:#line:90
		OO000O00OO0O0000O .uniteWith (OOOO00O0O000OO0OO )#line:91
		OOOO00O0O000OO0OO .erase ()#line:92
	OO000O00OO0O0000O .rotateY (180 )#line:93
	OO0OO00OOO000OO0O =CONE (OO0O0OOOO0OO0OOO0 ,R1 =(O000OO0000O0O00OO /2.0 )*1.1 ,R2 =OO0O00OO0O00O000O *1.1 ,H =O0O00O0OOOO0O0000 *0.10 ).rotateY (90 ).translate ((-O0O00O0OOOO0O0000 *0.10 +(OOO00O000O0O0000O /2.0 )-OO000OOOO0OOOO00O -(O00O0OOOOOOO0000O *0.025 ),0 ,0 ))#line:95
	O0OO0OOOO00OOOO0O =CYLINDER (OO0O0OOOO0OO0OOO0 ,R =(O000OO0000O0O00OO /2.0 )*1.1 ,H =O0O00O0OOOO0O0000 *0.90 ).rotateY (90 ).translate ((-(OOO00O000O0O0000O /2.0 )+OO000OOOO0OOOO00O +(O00O0OOOOOOO0000O *0.025 ),0 ,0 ))#line:96
	O0O0OO0O00OOO0O0O =CYLINDER (OO0O0OOOO0OO0OOO0 ,R =((O000OO0000O0O00OO *0.30 )*0.90 )/2.0 ,H =(O000OO0000O0O00OO /2.0 )*1.4 )#line:98
	OO0OOOOOOOOO0000O =AX_HANDLEVERS (OO0O0OOOO0OO0OOO0 ,W =O000OO0000O0O00OO *0.30 ,LE =O00O00O000O000O0O ,TH =3.0 ,HT =O0OO0OO0OO00O0000 -(O000OO0000O0O00OO /2.0 )*1.4 ,T =1.0 ).translate ((0 ,0 ,(O000OO0000O0O00OO /2.0 )*1.4 )).rotateZ (AA )#line:100
	for OOOO00O0O000OO0OO in [OOOOOOOO0OO000O00 ,OO000O00OO0O0000O ,OO0OO00OOO000OO0O ,O0OO0OOOO00OOOO0O ,O0O0OO0O00OOO0O0O ]:#line:102
	    OO00000O000OOOOOO .uniteWith (OOOO00O0O000OO0OO )#line:103
	    OOOO00O0O000OO0OO .erase ()#line:104
	O0O0O00OO00O00OO0 =CYLINDER (OO0O0OOOO0OO0OOO0 ,R =OD /2.0 ,H =OOO00O000O0O0000O ).rotateY (90 ).translate ((-OOO00O000O0O0000O /2.0 ,0 ,0 ))#line:107
	OO00000O000OOOOOO .subtractFrom (O0O0O00OO00O00OO0 )#line:108
	O0O0O00OO00O00OO0 .erase ()#line:109
	if 16.5 <=OD <=25 :#line:111
		OOOOO00O0O00OO00O =CYLINDER (OO0O0OOOO0OO0OOO0 ,R =((O000OO0000O0O00OO *0.30 )*0.90 )/2.0 ,H =(O000OO0000O0O00OO /2.0 )*1.4 ).translate ((0 ,0 ,((O000OO0000O0O00OO /2.0 )*1.4 )+3.0 ))#line:112
		OO0OOOOOOOOO0000O .subtractFrom (OOOOO00O0O00OO00O )#line:113
		OOOOO00O0O00OO00O .erase ()#line:114
	OO0O0OOOO0OO0OOO0 .setPoint ((OOOO000000O0O0O00 ,0 ,0 ),(1 ,0 ,0 ))#line:127
	OO0O0OOOO0OO0OOO0 .setPoint ((-O0000O000O00000OO ,0 ,0 ),(-1 ,0 ,0 ))#line:128
