Skip to content

Commit

Permalink
Merge pull request #30 from Pigi-102/main
Browse files Browse the repository at this point in the history
Fix for ideaMaker EXCLUDE_OBJECT_DEFINE position in gcode
  • Loading branch information
kageurufu authored Jan 31, 2024
2 parents 44bb938 + edd913b commit a92fcb4
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 @@ -365,6 +365,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 @@ -390,17 +392,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 a92fcb4

Please sign in to comment.