Wire EDM, Laser Cutting, and Nesting
Overview
Wire EDM and laser cutting are 2D profile processes: the tool follows a closed contour in the plane. Rasmah generates the contour-following toolpaths and also nests many parts onto a sheet to minimise waste:
wire_edm— a wire cuts a closed contour with a taper angle.laser_profile— a laser follows a contour with a kerf offset and optional pierce.nest_rectangles— pack rectangles onto a sheet of a given width.
The worked part is the profile an engineer actually burns or cuts: an L-bracket blank, 50 × 30 mm with a 20 × 30 mm notch — wire-cut from 20 mm tool-steel plate when the part is thick, laser-cut from 2 mm sheet when it is not.
using Rasmah
mm(v) = round(uconvert(u"mm", v); digits = 1)mm (generic function with 1 method)
Cut a contour
Define the closed polygon contour and generate both a wire-EDM and a laser path. The contour length is the drawing’s perimeter — 50 + 30 + 30 + 20 + 30 = 160 mm:
contour = [[0.0, 0.0, 0.0], [0.05, 0.0, 0.0], [0.05, 0.03, 0.0],
[0.02, 0.03, 0.0], [0.0, 0.03, 0.0], [0.0, 0.0, 0.0]]
edm_top, edm_bot = wire_edm(contour; thickness = 0.020, taper = deg2rad(2.0), feedrate = 0.01)
laser = laser_profile(contour; kerf = 0.0002, pierce = true)
println("wire-EDM top/bottom motions = ", num_motions(edm_top), " / ", num_motions(edm_bot))
println("laser motions = ", num_motions(laser), ", length = ", mm(toolpath_length(laser)), " mm")wire-EDM top/bottom motions = 8 / 8
laser motions = 10, length = 164.7 mm
println("laser cut time = ", round(toolpath_time(laser); digits = 1), " s at 20 mm/s")laser cut time = 8.2 s at 20 mm/s
The laser burns the 160 mm perimeter plus its pierce move in about eight seconds at the 20 mm/s profile speed. Wire EDM returns two toolpaths — one per wire guide — which is what makes the 2° taper possible: the top guide follows the printed contour while the bottom one traces the offset, cutting draft relief into the 20 mm plate.
The bracket’s material comes for free from the same numbers: the blank is a 50 × 30 rectangle minus the 20 × 30 notch, 900 mm² of stock out of a 1500 mm² blank — a 60% yield:
A_blank = 0.050 * 0.030
A_part = A_blank - 0.020 * 0.030
println("part area = ", round(A_part * 1e6; digits = 0), " mm² (yield ", round(A_part / A_blank * 100; digits = 0), "%)")part area = 900.0 mm² (yield 60.0%)
Nest rectangles
Pack a set of rectangular parts onto a sheet — a real nesting job: four brackets on a 100 mm-wide strip with a 2 mm cut gap. nest_rectangles returns the placed rectangles and the total sheet height:
parts = [[0.020, 0.010], [0.020, 0.010], [0.030, 0.020], [0.020, 0.020]]
layout, total_h = nest_rectangles(parts, 0.100; gap = 0.002)
println("nested ", length(layout), " rectangles, sheet height = ", round(total_h * 1000; digits = 0), " mm")
println("all fit in sheet width: ", all(r -> r[1] + r[3] <= 0.100 + 1e-9, layout))nested 4 rectangles, sheet height = 20.0 mm
all fit in sheet width: true
The utilization is the part area over the sheet area — the number that decides whether the nesting is worth it:
A_parts = sum(w * h for (w, h) in parts)
println("material utilization = ", round(A_parts / (0.100 * total_h) * 100; digits = 0), "%")material utilization = 70.0%
Verification
Both processes produce finite toolpaths of positive length, and the nesting places every rectangle within the sheet width.
Next steps
- CNC toolpaths — the milling operations.
- Lathe turning — the rotational counterpart.
