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

import FreeCAD as App
import Part

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

def ctr_face_ushelf_faceFace_Fa0_Ctr0():
	P000 = App.Vector(20.0000, 60.0000, 0)
	P001 = App.Vector(680.0000, 60.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(680.0000, 420.0000, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(20.0000, 420.0000, 0)
	S002 = Part.LineSegment(P002, P003)
	P004 = App.Vector(20.0000, 60.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 face_ushelf_faceFace_Fa0():
	FC000 = ctr_face_ushelf_faceFace_Fa0_Ctr0()
	rOneFace = FC000
	rOneFace.check()
	return rOneFace

def ushelf_faceFace():
	FA000 = face_ushelf_faceFace_Fa0()
	rOneFig = FA000
	rOneFig.check()
	return rOneFig

def ctr_face_ushelf_faceSide_Fa0_Ctr0():
	P000 = App.Vector(280.0000, 0.0000, 0)
	P001 = App.Vector(280.0000, 580.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(0.0000, 580.0000, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(0.0000, 60.0000, 0)
	S002 = Part.LineSegment(P002, P003)
	P004 = App.Vector(30.0000, 60.0000, 0)
	S003 = Part.LineSegment(P003, P004)
	P005 = App.Vector(30.0000, 0.0000, 0)
	S004 = Part.LineSegment(P004, P005)
	P006 = App.Vector(280.0000, 0.0000, 0)
	S005 = Part.LineSegment(P005, P000)
	aShape = Part.Shape([S000, S001, S002, S003, S004, S005])
	aWire = Part.Wire(aShape.Edges)
	subFace = Part.Face(aWire)
	subFace.check()
	return subFace

def face_ushelf_faceSide_Fa0():
	FC000 = ctr_face_ushelf_faceSide_Fa0_Ctr0()
	rOneFace = FC000
	rOneFace.check()
	return rOneFace

def ushelf_faceSide():
	FA000 = face_ushelf_faceSide_Fa0()
	rOneFig = FA000
	rOneFig.check()
	return rOneFig

def ctr_face_ushelf_faceSideR_Fa0_Ctr0():
	P000 = App.Vector(280.0000, 0.0000, 0)
	P001 = App.Vector(280.0000, 430.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(0.0000, 430.0000, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(0.0000, 60.0000, 0)
	S002 = Part.LineSegment(P002, P003)
	P004 = App.Vector(30.0000, 60.0000, 0)
	S003 = Part.LineSegment(P003, P004)
	P005 = App.Vector(30.0000, 0.0000, 0)
	S004 = Part.LineSegment(P004, P005)
	P006 = App.Vector(280.0000, 0.0000, 0)
	S005 = Part.LineSegment(P005, P000)
	aShape = Part.Shape([S000, S001, S002, S003, S004, S005])
	aWire = Part.Wire(aShape.Edges)
	subFace = Part.Face(aWire)
	subFace.check()
	return subFace

def face_ushelf_faceSideR_Fa0():
	FC000 = ctr_face_ushelf_faceSideR_Fa0_Ctr0()
	rOneFace = FC000
	rOneFace.check()
	return rOneFace

def ushelf_faceSideR():
	FA000 = face_ushelf_faceSideR_Fa0()
	rOneFig = FA000
	rOneFig.check()
	return rOneFig

def ctr_face_ushelf_faceTop_Fa0_Ctr0():
	P000 = App.Vector(20.0000, 20.0000, 0)
	P001 = App.Vector(680.0000, 20.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(680.0000, 280.0000, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(20.0000, 280.0000, 0)
	S002 = Part.LineSegment(P002, P003)
	P004 = App.Vector(20.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 face_ushelf_faceTop_Fa0():
	FC000 = ctr_face_ushelf_faceTop_Fa0_Ctr0()
	rOneFace = FC000
	rOneFace.check()
	return rOneFace

def ushelf_faceTop():
	FA000 = face_ushelf_faceTop_Fa0()
	rOneFig = FA000
	rOneFig.check()
	return rOneFig

def ctr_face_ushelf_faceBeamTop_Fa0_Ctr0():
	P000 = App.Vector(20.0000, 20.0000, 0)
	P001 = App.Vector(50.0000, 20.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(50.0000, 170.0000, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(20.0000, 170.0000, 0)
	S002 = Part.LineSegment(P002, P003)
	P004 = App.Vector(20.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 face_ushelf_faceBeamTop_Fa0():
	FC000 = ctr_face_ushelf_faceBeamTop_Fa0_Ctr0()
	rOneFace = FC000
	rOneFace.check()
	return rOneFace

def ctr_face_ushelf_faceBeamTop_Fa1_Ctr0():
	P000 = App.Vector(650.0000, 20.0000, 0)
	P001 = App.Vector(680.0000, 20.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(680.0000, 170.0000, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(650.0000, 170.0000, 0)
	S002 = Part.LineSegment(P002, P003)
	P004 = App.Vector(650.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 face_ushelf_faceBeamTop_Fa1():
	FC000 = ctr_face_ushelf_faceBeamTop_Fa1_Ctr0()
	rOneFace = FC000
	rOneFace.check()
	return rOneFace

def ctr_face_ushelf_faceBeamTop_Fa2_Ctr0():
	P000 = App.Vector(50.0000, 20.0000, 0)
	P001 = App.Vector(650.0000, 20.0000, 0)
	S000 = Part.LineSegment(P000, P001)
	P002 = App.Vector(650.0000, 50.0000, 0)
	S001 = Part.LineSegment(P001, P002)
	P003 = App.Vector(50.0000, 50.0000, 0)
	S002 = Part.LineSegment(P002, P003)
	P004 = App.Vector(50.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 face_ushelf_faceBeamTop_Fa2():
	FC000 = ctr_face_ushelf_faceBeamTop_Fa2_Ctr0()
	rOneFace = FC000
	rOneFace.check()
	return rOneFace

def ushelf_faceBeamTop():
	FA000 = face_ushelf_faceBeamTop_Fa0()
	FA001 = face_ushelf_faceBeamTop_Fa1()
	FA002 = face_ushelf_faceBeamTop_Fa2()
	rOneFig = FA000.fuse([FA001, FA002])
	rOneFig.check()
	return rOneFig

def fex_subpax_ushelf_plateau():
	FIG = ushelf_faceTop()
	VEX = FIG.extrude(App.Vector(0, 0, 20))
	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, 200.0000))
	return VFP
subpax_ushelf_plateau = fex_subpax_ushelf_plateau()

def fex_subpax_ushelf_back():
	FIG = ushelf_faceFace()
	VEX = FIG.extrude(App.Vector(0, 0, 20))
	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, 20.0000, 0.0000))
	return VFP
subpax_ushelf_back = fex_subpax_ushelf_back()

def fex_subpax_ushelf_sideL():
	FIG = ushelf_faceSide()
	VEX = FIG.extrude(App.Vector(0, 0, 20))
	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), 90.0000)
	VFP = VR3.translate(App.Vector(680.0000, 0.0000, 0.0000))
	return VFP
subpax_ushelf_sideL = fex_subpax_ushelf_sideL()

def fex_subpax_ushelf_sideR():
	FIG = ushelf_faceSideR()
	VEX = FIG.extrude(App.Vector(0, 0, 20))
	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), 90.0000)
	VFP = VR3.translate(App.Vector(0.0000, 0.0000, 0.0000))
	return VFP
subpax_ushelf_sideR = fex_subpax_ushelf_sideR()

def fex_subpax_ushelf_beam():
	FIG = ushelf_faceBeamTop()
	VEX = FIG.extrude(App.Vector(0, 0, 30))
	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, 170.0000))
	return VFP
subpax_ushelf_beam = fex_subpax_ushelf_beam()

def fvol_pax_ushelf():
	V000 = subpax_ushelf_plateau
	V001 = V000.fuse(subpax_ushelf_back)
	V002 = V001.fuse(subpax_ushelf_sideL)
	V003 = V002.fuse(subpax_ushelf_sideR)
	V004 = V003.fuse(subpax_ushelf_beam)
	VFC = V004.removeSplitter()
	return VFC
pax_ushelf = fvol_pax_ushelf()


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

