Date:2015-01-23 06:49:20 (9 years 2 months ago)
Author:Werner Almesberger
Commit:dc79b03b1d9345a2edeec034af854cefd94c90a9
Message:sfc/slicer.py: add overshoot only after slicing

Otherwise, we slice below the bottom of the piece , which probably won't
go too well ..
Files: sfc/slicer.py (1 diff)

Change Details

sfc/slicer.py
217217if height is not None and height < 0 and z_levels[-1] > height:
218218    z_levels.append(height - z_off)
219219
220z_levels[-1] += end
221
222for next_z in z_levels:
220for i in range(0, len(z_levels)):
221    next_z = z_levels[i]
223222    wires = shape.slice(Base.Vector(0, 0, 1), next_z + epsilon)
223    if i == len(z_levels) - 1:
224        next_z += end
224225    if z_step is None or last_z is None or last_z - z_step <= next_z:
225226        dump_level(wires, next_z + z_off)
226227    else:
227228        d = last_z - next_z
228229        n = int(d // z_step) + 1
229        for i in range(0, n):
230            dump_level(wires, last_z - (i + 1) * (d / n) + z_off)
230        for j in range(0, n):
231            dump_level(wires, last_z - (j + 1) * (d / n) + z_off)
231232    last_z = next_z
232233
233234#

Archive Download the corresponding diff file

Branches:
master



interactive