Skip to content

Commit

Permalink
Fixes #29, inject define_object before first instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
jniebuhr authored Dec 8, 2023
1 parent 8f717dc commit ce90ed8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions preprocess_cancellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,18 @@ def preprocess_cura(infile):

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 mesh_id, hull in known_objects.values():
yield from define_object(
mesh_id,
center=hull.center(),
polygon=hull.exterior(),
)
yield line
break

# Inject custom marker
yield from header(len(known_objects))
for mesh_id, hull in known_objects.values():
yield from define_object(
mesh_id,
center=hull.center(),
polygon=hull.exterior(),
)
yield line

current_object = None
for line in infile:
Expand Down

0 comments on commit ce90ed8

Please sign in to comment.