Skip to content

Commit

Permalink
Fix for ideaMaker EXCLUDE_OBJECT_DEFINE position in gcode
Browse files Browse the repository at this point in the history
  • Loading branch information
Pigi-102 committed Nov 28, 2023
1 parent 8f717dc commit edd913b
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions preprocess_cancellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ def preprocess_ideamaker(infile):
current_hull: HullTracker = None

for line in infile:
if line.startswith(";TOTAL_NUM:"):
total_num = int(line.split(":")[1].strip())
if line.startswith(";PRINTING:"):
name = line.split(":")[1].strip()
id_line = next(infile)
Expand All @@ -388,17 +390,21 @@ def preprocess_ideamaker(infile):
for line in infile:
yield line

if line.startswith(";TOTAL_NUM:"):
total_num = int(line.split(":")[1].strip())
assert total_num == len(known_objects)
yield from header(total_num)
for id, (name, hull) in known_objects.items():
yield from define_object(
name,
center=hull.center(),
polygon=hull.exterior(),
)
if line.strip() and not line.startswith(";"):
break

assert total_num == len(known_objects)
yield from header(total_num)
for id, (name, hull) in known_objects.items():
yield from define_object(
name,
center=hull.center(),
polygon=hull.exterior(),
)
yield "\n\n"

for line in infile:
yield line
if line.startswith(";PRINTING_ID:"):
printing_id = line.split(":")[1].strip()
if current_object:
Expand Down

0 comments on commit edd913b

Please sign in to comment.