added machine bounds

CURA-11777
This commit is contained in:
Saumya Jain 2024-05-07 12:51:03 +02:00
parent d8c852b74a
commit fdfc5dcc67

View file

@ -109,13 +109,15 @@ class MakerbotWriter(MeshWriter):
if not success:
self.setInformation(gcode_writer.getInformation())
return False
if file_format == "application/x-makerbot-sketch":
match file_format:
case "application/x-makerbot-sketch":
filename, filedata = "print.gcode", gcode_text_io.getvalue()
self._PNG_FORMATS = self._PNG_FORMAT
else:
case "application/x-makerbot":
filename, filedata = "print.jsontoolpath", du.gcode_2_miracle_jtp(gcode_text_io.getvalue())
self._PNG_FORMATS = self._PNG_FORMAT + self._PNG_FORMAT_METHOD
case _:
raise Exception("Unsupported Mime type")
png_files = []
for png_format in self._PNG_FORMATS:
@ -221,9 +223,8 @@ class MakerbotWriter(MeshWriter):
meta["version"] = MakerbotWriter._META_VERSION
meta["preferences"] = dict()
for node in nodes:
bounds = node.getBoundingBox()
meta["preferences"][str(node.getName())] = {
bounds = application.getBuildVolume().getBoundingBox()
meta["preferences"]["instance0"] = {
"machineBounds": [bounds.right, bounds.back, bounds.left, bounds.front] if bounds is not None else None,
"printMode": CuraApplication.getInstance().getIntentManager().currentIntentCategory,
}