from cgal_pycad import *
from fractions import Fraction
import os

print("Starting test...")

try:
    L, W, T = 100, 200, 2
    bottom = cube([L, W, T])
    slot = cube([10, T+1, T+2])

    for i in range(5):
        # translate([20*i, -1, -1])(slot)
        # Note: 20*i isint, -1 int.
        t_vec = [20*i, -1, -1]
        t_slot = translate(t_vec)(slot)
        bottom = bottom - t_slot

    bottom = bottom.scale([1, 1, Fraction(1,2)])
    bottom.to_stl("bottom.stl")
    
    if os.path.exists("bottom.stl"):
        print("Success: bottom.stl created.")
    else:
        print("Failure: bottom.stl not found.")

except Exception as e:
    print(f"Error during execution: {e}")
    import traceback
    traceback.print_exc()
