# freecad-python generated by Parametrix
# run the script with:
# freecad.cmd myScript.py

import FreeCAD as App
import Part

#print(sys.argv)
outFileName = "scarabase"
if (len(sys.argv) == 3):
    outFileName = sys.argv[2]
print(f"outFileName: {outFileName}")

def ctr_face_scarabase_facePlate_Fa0_Ctr0():
	P000 = App.Vector(0.0000, 0.0000, 0)
	P001 = App.Vector(40.0000, 0.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(40.0000, 19.7266, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(40.0184, 19.9975, 0)
	P004 = App.Vector(40.0734, 20.2633, 0)
	S002 = Part.Arc(P002, P003, P004)
	P005 = App.Vector(48.8997, 51.9499, 0)
	S003 = Part.LineSegment(P004, P005)
	P006 = App.Vector(20.0000, 90.0000, 0)
	P007 = App.Vector(-8.8997, 51.9499, 0)
	S004 = Part.Arc(P005, P006, P007)
	P008 = App.Vector(-0.0734, 20.2633, 0)
	S005 = Part.LineSegment(P007, P008)
	P009 = App.Vector(-0.0184, 19.9975, 0)
	P010 = App.Vector(0.0000, 19.7266, 0)
	S006 = Part.Arc(P008, P009, P010)
	P011 = App.Vector(0.0000, 0.0000, 0)
	S007 = Part.LineSegment(P010, P000)
	aShape = Part.Shape([S000, S001, S002, S003, S004, S005, S006, S007])
	aWire = Part.Wire(aShape.Edges)
	subFace = Part.Face(aWire)
	subFace.check()
	return subFace

def ctr_face_scarabase_facePlate_Fa0_Ctr1():
	# Radius, XYZ-position, orientation
	aCircle = Part.makeCircle(10.0000, App.Vector(20.0000, 60.0000, 0), App.Vector(0, 0, 1))
	aWire = Part.Wire(aCircle)
	rFace = Part.Face(aWire)
	return rFace

def face_scarabase_facePlate_Fa0():
	FC000 = ctr_face_scarabase_facePlate_Fa0_Ctr0()
	FC001 = ctr_face_scarabase_facePlate_Fa0_Ctr1()
	rOneFace = FC000.cut([FC001])
	rOneFace.check()
	return rOneFace

def scarabase_facePlate():
	FA000 = face_scarabase_facePlate_Fa0()
	rOneFig = FA000
	rOneFig.check()
	return rOneFig

def ctr_face_scarabase_faceBack_Fa0_Ctr0():
	P000 = App.Vector(0.0000, 20.0000, 0)
	P001 = App.Vector(40.0000, 20.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(40.0000, 70.0000, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(0.0000, 70.0000, 0)
	S002 = Part.LineSegment(P002, P003)
	P004 = App.Vector(0.0000, 20.0000, 0)
	S003 = Part.LineSegment(P003, P000)
	aShape = Part.Shape([S000, S001, S002, S003])
	aWire = Part.Wire(aShape.Edges)
	subFace = Part.Face(aWire)
	subFace.check()
	return subFace

def ctr_face_scarabase_faceBack_Fa0_Ctr1():
	# Radius, XYZ-position, orientation
	aCircle = Part.makeCircle(2.5000, App.Vector(10.0000, 30.0000, 0), App.Vector(0, 0, 1))
	aWire = Part.Wire(aCircle)
	rFace = Part.Face(aWire)
	return rFace

def ctr_face_scarabase_faceBack_Fa0_Ctr2():
	# Radius, XYZ-position, orientation
	aCircle = Part.makeCircle(2.5000, App.Vector(30.0000, 30.0000, 0), App.Vector(0, 0, 1))
	aWire = Part.Wire(aCircle)
	rFace = Part.Face(aWire)
	return rFace

def ctr_face_scarabase_faceBack_Fa0_Ctr3():
	# Radius, XYZ-position, orientation
	aCircle = Part.makeCircle(2.5000, App.Vector(10.0000, 60.0000, 0), App.Vector(0, 0, 1))
	aWire = Part.Wire(aCircle)
	rFace = Part.Face(aWire)
	return rFace

def ctr_face_scarabase_faceBack_Fa0_Ctr4():
	# Radius, XYZ-position, orientation
	aCircle = Part.makeCircle(2.5000, App.Vector(30.0000, 60.0000, 0), App.Vector(0, 0, 1))
	aWire = Part.Wire(aCircle)
	rFace = Part.Face(aWire)
	return rFace

def face_scarabase_faceBack_Fa0():
	FC000 = ctr_face_scarabase_faceBack_Fa0_Ctr0()
	FC001 = ctr_face_scarabase_faceBack_Fa0_Ctr1()
	FC002 = ctr_face_scarabase_faceBack_Fa0_Ctr2()
	FC003 = ctr_face_scarabase_faceBack_Fa0_Ctr3()
	FC004 = ctr_face_scarabase_faceBack_Fa0_Ctr4()
	rOneFace = FC000.cut([FC001, FC002, FC003, FC004])
	rOneFace.check()
	return rOneFace

def scarabase_faceBack():
	FA000 = face_scarabase_faceBack_Fa0()
	rOneFig = FA000
	rOneFig.check()
	return rOneFig

def ctr_face_scarabase_faceT3_Fa0_Ctr0():
	P000 = App.Vector(0.0000, 0.0000, 0)
	P001 = App.Vector(3.0000, 0.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(3.0000, 20.1367, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(2.9816, 20.4075, 0)
	P004 = App.Vector(2.9266, 20.6734, 0)
	S002 = Part.Arc(P002, P003, P004)
	P005 = App.Vector(-6.0098, 52.7549, 0)
	S003 = Part.LineSegment(P004, P005)
	P006 = App.Vector(20.0000, 87.0000, 0)
	P007 = App.Vector(46.0098, 52.7549, 0)
	S004 = Part.Arc(P005, P006, P007)
	P008 = App.Vector(37.0734, 20.6734, 0)
	S005 = Part.LineSegment(P007, P008)
	P009 = App.Vector(37.0184, 20.4075, 0)
	P010 = App.Vector(37.0000, 20.1367, 0)
	S006 = Part.Arc(P008, P009, P010)
	P011 = App.Vector(37.0000, 0.0000, 0)
	S007 = Part.LineSegment(P010, P011)
	P012 = App.Vector(40.0000, 0.0000, 0)
	S008 = Part.LineSegment(P011, P012)
	P013 = App.Vector(40.0000, 19.7266, 0)
	S009 = Part.LineSegment(P012, P013)
	P014 = App.Vector(40.0184, 19.9975, 0)
	P015 = App.Vector(40.0734, 20.2633, 0)
	S010 = Part.Arc(P013, P014, P015)
	P016 = App.Vector(48.8997, 51.9499, 0)
	S011 = Part.LineSegment(P015, P016)
	P017 = App.Vector(20.0000, 90.0000, 0)
	P018 = App.Vector(-8.8997, 51.9499, 0)
	S012 = Part.Arc(P016, P017, P018)
	P019 = App.Vector(-0.0734, 20.2633, 0)
	S013 = Part.LineSegment(P018, P019)
	P020 = App.Vector(-0.0184, 19.9975, 0)
	P021 = App.Vector(0.0000, 19.7266, 0)
	S014 = Part.Arc(P019, P020, P021)
	P022 = App.Vector(0.0000, 0.0000, 0)
	S015 = Part.LineSegment(P021, P000)
	aShape = Part.Shape([S000, S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011, S012, S013, S014, S015])
	aWire = Part.Wire(aShape.Edges)
	subFace = Part.Face(aWire)
	subFace.check()
	return subFace

def face_scarabase_faceT3_Fa0():
	FC000 = ctr_face_scarabase_faceT3_Fa0_Ctr0()
	rOneFace = FC000
	rOneFace.check()
	return rOneFace

def ctr_face_scarabase_faceT3_Fa1_Ctr0():
	# Radius, XYZ-position, orientation
	aCircle = Part.makeCircle(13.0000, App.Vector(20.0000, 60.0000, 0), App.Vector(0, 0, 1))
	aWire = Part.Wire(aCircle)
	rFace = Part.Face(aWire)
	return rFace

def ctr_face_scarabase_faceT3_Fa1_Ctr1():
	# Radius, XYZ-position, orientation
	aCircle = Part.makeCircle(10.0000, App.Vector(20.0000, 60.0000, 0), App.Vector(0, 0, 1))
	aWire = Part.Wire(aCircle)
	rFace = Part.Face(aWire)
	return rFace

def face_scarabase_faceT3_Fa1():
	FC000 = ctr_face_scarabase_faceT3_Fa1_Ctr0()
	FC001 = ctr_face_scarabase_faceT3_Fa1_Ctr1()
	rOneFace = FC000.cut([FC001])
	rOneFace.check()
	return rOneFace

def scarabase_faceT3():
	FA000 = face_scarabase_faceT3_Fa0()
	FA001 = face_scarabase_faceT3_Fa1()
	rOneFig = FA000.fuse([FA001])
	rOneFig.check()
	return rOneFig

def ctr_face_scarabase_faceSide_Fa0_Ctr0():
	P000 = App.Vector(0.0000, 10.0000, 0)
	P001 = App.Vector(47.0000, 10.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(47.0000, 0.0000, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(50.0000, 0.0000, 0)
	S002 = Part.LineSegment(P002, P003)
	P004 = App.Vector(50.0000, 20.0000, 0)
	S003 = Part.LineSegment(P003, P004)
	P005 = App.Vector(10.0000, 20.0000, 0)
	S004 = Part.LineSegment(P004, P005)
	P006 = App.Vector(10.0000, 70.0000, 0)
	S005 = Part.LineSegment(P005, P006)
	P007 = App.Vector(50.0000, 70.0000, 0)
	S006 = Part.LineSegment(P006, P007)
	P008 = App.Vector(50.0000, 90.0000, 0)
	S007 = Part.LineSegment(P007, P008)
	P009 = App.Vector(47.0000, 90.0000, 0)
	S008 = Part.LineSegment(P008, P009)
	P010 = App.Vector(47.0000, 80.0000, 0)
	S009 = Part.LineSegment(P009, P010)
	P011 = App.Vector(0.0000, 80.0000, 0)
	S010 = Part.LineSegment(P010, P011)
	P012 = App.Vector(0.0000, 10.0000, 0)
	S011 = Part.LineSegment(P011, P000)
	aShape = Part.Shape([S000, S001, S002, S003, S004, S005, S006, S007, S008, S009, S010, S011])
	aWire = Part.Wire(aShape.Edges)
	subFace = Part.Face(aWire)
	subFace.check()
	return subFace

def face_scarabase_faceSide_Fa0():
	FC000 = ctr_face_scarabase_faceSide_Fa0_Ctr0()
	rOneFace = FC000
	rOneFace.check()
	return rOneFace

def ctr_face_scarabase_faceSide_Fa1_Ctr0():
	P000 = App.Vector(70.0000, 0.0000, 0)
	P001 = App.Vector(73.0000, 0.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(73.0000, 10.0000, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(87.0000, 10.0000, 0)
	S002 = Part.LineSegment(P002, P003)
	P004 = App.Vector(87.0000, 0.0000, 0)
	S003 = Part.LineSegment(P003, P004)
	P005 = App.Vector(90.0000, 0.0000, 0)
	S004 = Part.LineSegment(P004, P005)
	P006 = App.Vector(90.0000, 20.0000, 0)
	S005 = Part.LineSegment(P005, P006)
	P007 = App.Vector(70.0000, 20.0000, 0)
	S006 = Part.LineSegment(P006, P007)
	P008 = App.Vector(70.0000, 0.0000, 0)
	S007 = Part.LineSegment(P007, P000)
	aShape = Part.Shape([S000, S001, S002, S003, S004, S005, S006, S007])
	aWire = Part.Wire(aShape.Edges)
	subFace = Part.Face(aWire)
	subFace.check()
	return subFace

def face_scarabase_faceSide_Fa1():
	FC000 = ctr_face_scarabase_faceSide_Fa1_Ctr0()
	rOneFace = FC000
	rOneFace.check()
	return rOneFace

def ctr_face_scarabase_faceSide_Fa2_Ctr0():
	P000 = App.Vector(70.0000, 70.0000, 0)
	P001 = App.Vector(90.0000, 70.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(90.0000, 90.0000, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(87.0000, 90.0000, 0)
	S002 = Part.LineSegment(P002, P003)
	P004 = App.Vector(87.0000, 80.0000, 0)
	S003 = Part.LineSegment(P003, P004)
	P005 = App.Vector(73.0000, 80.0000, 0)
	S004 = Part.LineSegment(P004, P005)
	P006 = App.Vector(73.0000, 90.0000, 0)
	S005 = Part.LineSegment(P005, P006)
	P007 = App.Vector(70.0000, 90.0000, 0)
	S006 = Part.LineSegment(P006, P007)
	P008 = App.Vector(70.0000, 70.0000, 0)
	S007 = Part.LineSegment(P007, P000)
	aShape = Part.Shape([S000, S001, S002, S003, S004, S005, S006, S007])
	aWire = Part.Wire(aShape.Edges)
	subFace = Part.Face(aWire)
	subFace.check()
	return subFace

def face_scarabase_faceSide_Fa2():
	FC000 = ctr_face_scarabase_faceSide_Fa2_Ctr0()
	rOneFace = FC000
	rOneFace.check()
	return rOneFace

def scarabase_faceSide():
	FA000 = face_scarabase_faceSide_Fa0()
	FA001 = face_scarabase_faceSide_Fa1()
	FA002 = face_scarabase_faceSide_Fa2()
	rOneFig = FA000.fuse([FA001, FA002])
	rOneFig.check()
	return rOneFig

def fex_subpax_scarabase_plate2():
	FIG = scarabase_facePlate()
	VEX = FIG.extrude(App.Vector(0, 0, 10))
	VR1 = VEX.rotate(App.Vector(0, 0, 0), App.Vector(1, 0, 0), 0.0000)
	VR2 = VR1.rotate(App.Vector(0, 0, 0), App.Vector(0, 1, 0), 0.0000)
	VR3 = VR2.rotate(App.Vector(0, 0, 0), App.Vector(0, 0, 1), 0.0000)
	VFP = VR3.translate(App.Vector(0.0000, 0.0000, 10.0000))
	return VFP
subpax_scarabase_plate2 = fex_subpax_scarabase_plate2()

def fex_subpax_scarabase_plate4():
	FIG = scarabase_facePlate()
	VEX = FIG.extrude(App.Vector(0, 0, 10))
	VR1 = VEX.rotate(App.Vector(0, 0, 0), App.Vector(1, 0, 0), 0.0000)
	VR2 = VR1.rotate(App.Vector(0, 0, 0), App.Vector(0, 1, 0), 0.0000)
	VR3 = VR2.rotate(App.Vector(0, 0, 0), App.Vector(0, 0, 1), 0.0000)
	VFP = VR3.translate(App.Vector(0.0000, 0.0000, 70.0000))
	return VFP
subpax_scarabase_plate4 = fex_subpax_scarabase_plate4()

def fex_subpax_scarabase_back():
	FIG = scarabase_faceBack()
	VEX = FIG.extrude(App.Vector(0, 0, 10))
	VR1 = VEX.rotate(App.Vector(0, 0, 0), App.Vector(1, 0, 0), 90.0000)
	VR2 = VR1.rotate(App.Vector(0, 0, 0), App.Vector(0, 1, 0), 0.0000)
	VR3 = VR2.rotate(App.Vector(0, 0, 0), App.Vector(0, 0, 1), 0.0000)
	VFP = VR3.translate(App.Vector(0.0000, 10.0000, 0.0000))
	return VFP
subpax_scarabase_back = fex_subpax_scarabase_back()

def fex_subpax_scarabase_t31():
	FIG = scarabase_faceT3()
	VEX = FIG.extrude(App.Vector(0, 0, 10))
	VR1 = VEX.rotate(App.Vector(0, 0, 0), App.Vector(1, 0, 0), 0.0000)
	VR2 = VR1.rotate(App.Vector(0, 0, 0), App.Vector(0, 1, 0), 0.0000)
	VR3 = VR2.rotate(App.Vector(0, 0, 0), App.Vector(0, 0, 1), 0.0000)
	VFP = VR3.translate(App.Vector(0.0000, 0.0000, 0.0000))
	return VFP
subpax_scarabase_t31 = fex_subpax_scarabase_t31()

def fex_subpax_scarabase_t35():
	FIG = scarabase_faceT3()
	VEX = FIG.extrude(App.Vector(0, 0, 10))
	VR1 = VEX.rotate(App.Vector(0, 0, 0), App.Vector(1, 0, 0), 0.0000)
	VR2 = VR1.rotate(App.Vector(0, 0, 0), App.Vector(0, 1, 0), 0.0000)
	VR3 = VR2.rotate(App.Vector(0, 0, 0), App.Vector(0, 0, 1), 0.0000)
	VFP = VR3.translate(App.Vector(0.0000, 0.0000, 80.0000))
	return VFP
subpax_scarabase_t35 = fex_subpax_scarabase_t35()

def fvol_pax_scarabase():
	V000 = subpax_scarabase_plate2
	V001 = V000.fuse(subpax_scarabase_plate4)
	V002 = V001.fuse(subpax_scarabase_back)
	V003 = V002.fuse(subpax_scarabase_t31)
	V004 = V003.fuse(subpax_scarabase_t35)
	VFC = V004.removeSplitter()
	return VFC
pax_scarabase = fvol_pax_scarabase()


pax_scarabase.check()
#pax_scarabase.exportBrep(f"{outFileName}.brep")
#pax_scarabase.exportIges(f"{outFileName}.igs")
#pax_scarabase.exportStep(f"{outFileName}.stp")
pax_scarabase.exportStl(f"{outFileName}.stl")

