Skip to content

Commit

Permalink
Fix logic for Slic3r as well
Browse files Browse the repository at this point in the history
  • Loading branch information
jniebuhr authored Dec 8, 2023
1 parent ce90ed8 commit 95f0687
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions preprocess_cancellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,19 +329,21 @@ def preprocess_slicer(infile):
y = float(params["Y"])
current_hull.add_point(Point(x, y))


infile.seek(0)
for line in infile:
yield line
if line.strip() and not line.startswith(";"):
# Inject custom marker
yield from header(len(known_objects))
for object_id, hull in known_objects.values():
yield from define_object(
object_id,
center=hull.center(),
polygon=hull.exterior(),
)
yield line
break

yield from header(len(known_objects))
for object_id, hull in known_objects.values():
yield from define_object(
object_id,
center=hull.center(),
polygon=hull.exterior(),
)
yield line

for line in infile:
yield line
Expand Down

0 comments on commit 95f0687

Please sign in to comment.