def MakeObjQuad(origsize, trimsize, scale, depth, plane, outfilename):
    p0 = [ (trimsize[0] - origsize[0]/2)*scale, (-trimsize[3]+origsize[1]/2)*scale, depth ]
    p1 = [ (trimsize[0] - origsize[0]/2)*scale, (-trimsize[1]+origsize[1]/2)*scale, depth ]
    p2 = [ (trimsize[2] - origsize[0]/2)*scale, (-trimsize[1]+origsize[1]/2)*scale, depth ]
    p3 = [ (trimsize[2] - origsize[0]/2)*scale, (-trimsize[3]+origsize[1]/2)*scale, depth ]

    
    if plane == "XZ":
        p0[1], p0[2] = p0[2], p0[1]
        p1[1], p1[2] = p1[2], p1[1]
        p2[1], p2[2] = p2[2], p2[1]
        p3[1], p3[2] = p3[2], p3[1]
        
        
    f = open(outfilename, "w")
    f.write ( 'v %(x)f %(y)f %(z)f\n'% {'x':p0[0], 'y':p0[1], 'z':p0[2]})
    f.write ( 'v %(x)f %(y)f %(z)f\n'% {'x':p1[0], 'y':p1[1], 'z':p1[2]})
    f.write ( 'v %(x)f %(y)f %(z)f\n'% {'x':p2[0], 'y':p2[1], 'z':p2[2]})
    f.write ( 'v %(x)f %(y)f %(z)f\n'% {'x':p3[0], 'y':p3[1], 'z':p3[2]})
    
    if plane=="XY":
        f.write ( 'vn 0 0 1\n')
    elif plane=="XZ":
        f.write ( 'vn 0 1 0\n')
    f.write ( 'vt 1 0\n')
    f.write ( 'vt 1 1\n')
    f.write ( 'vt 0 1\n')
    f.write ( 'vt 0 0\n')
    #f.write ( 'f 1/1/1 2/2/1 3/3/1 4/4/1\n')
    f.write ( 'f 1/1/1 2/2/1 3/3/1 \n')
    f.write ( 'f 1/1/1 3/3/1 4/4/1 \n')
dataset/ETHPy150Open kleientertainment/ds_mod_tools/pkg/unix/mod_tools/tools/scripts/buildcutout.py/MakeObjQuad/original