# Korytko kablowe pod biurko 600, DC01 1,5 mm (polka 30, plecy 100, dno 100, rant 30)
t  = param("grubosc", 1.5)
b  = param("dlugosc", 600)
sheet_rule(thickness: t, radius: 0.8, k: 0.33)
s = contour_flange([[-30, 98.5, 0], [0, 98.5, 0], [0, 0, 0], [100, 0, 0], [100, 30, 0]], b, normal: [0, 0, 1], symmetric: true)
name(s, "Korytko_600")
lico = face(s, normal: [-1, 0, 0], near: [0, 50, 0], within: 3)
f = unfold(lico)
okna = sketch(plane.yz, name: "Okna_dna_110x50") { line([-260,-72.434],[-160,-72.434]); arc([-160,-72.434],[-155,-67.434],[-156.464,-70.970]); line([-155,-67.434],[-155,-27.434]); arc([-155,-27.434],[-160,-22.434],[-156.464,-23.898]); line([-160,-22.434],[-260,-22.434]); arc([-260,-22.434],[-265,-27.434],[-263.536,-23.898]); line([-265,-27.434],[-265,-67.434]); arc([-265,-67.434],[-260,-72.434],[-263.536,-70.970]); line([-120,-72.434],[-20,-72.434]); arc([-20,-72.434],[-15,-67.434],[-16.464,-70.970]); line([-15,-67.434],[-15,-27.434]); arc([-15,-27.434],[-20,-22.434],[-16.464,-23.898]); line([-20,-22.434],[-120,-22.434]); arc([-120,-22.434],[-125,-27.434],[-123.536,-23.898]); line([-125,-27.434],[-125,-67.434]); arc([-125,-67.434],[-120,-72.434],[-123.536,-70.970]); line([20,-72.434],[120,-72.434]); arc([120,-72.434],[125,-67.434],[123.536,-70.970]); line([125,-67.434],[125,-27.434]); arc([125,-27.434],[120,-22.434],[123.536,-23.898]); line([120,-22.434],[20,-22.434]); arc([20,-22.434],[15,-27.434],[16.464,-23.898]); line([15,-27.434],[15,-67.434]); arc([15,-67.434],[20,-72.434],[16.464,-70.970]); line([160,-72.434],[260,-72.434]); arc([260,-72.434],[265,-67.434],[263.536,-70.970]); line([265,-67.434],[265,-27.434]); arc([265,-27.434],[260,-22.434],[263.536,-23.898]); line([260,-22.434],[160,-22.434]); arc([160,-22.434],[155,-27.434],[156.464,-23.898]); line([155,-27.434],[155,-67.434]); arc([155,-67.434],[160,-72.434],[156.464,-70.970]) }
f = extrude(okna, 10, op: "cut", target: f, through_all: true, direction: "symmetric")
otw = sketch(plane.yz, name: "Otwory_D5_polka") { arc([-252.5,113.934],[-247.5,113.934],[-250,111.434]); arc([-247.5,113.934],[-252.5,113.934],[-250,116.434]); arc([-2.5,113.934],[2.5,113.934],[0,111.434]); arc([2.5,113.934],[-2.5,113.934],[0,116.434]); arc([247.5,113.934],[252.5,113.934],[250,111.434]); arc([252.5,113.934],[247.5,113.934],[250,116.434]) }
f = extrude(otw, 10, op: "cut", target: f, through_all: true, direction: "symmetric")
s = refold(f)
name(s, "Korytko_600")
print(measure(s))
fp = flat_pattern(face(s, normal: [-1, 0, 0], near: [0, 50, 0], within: 3))
name(fp, "Rozwiniecie")
print(measure(fp))
export_file(s, "Korytko_kablowe_600.step")