Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add objects metadata to FDM Attrs #52

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gcode_metadata/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ def set_attr(self, name, value):
"normal_change_in_present": bool,
"layer_info_present": bool,
"max_layer_z": float,
"objects_info": json.loads,
}

# Add attributes that have multiple values in MMU print gcodes
Expand Down
1 change: 1 addition & 0 deletions tests/gcodes/fdn_full_0.15mm_PETG_MK3S_2h6m.gcode
Original file line number Diff line number Diff line change
Expand Up @@ -209977,6 +209977,7 @@ M73 Q100 S0
; notes =
; nozzle_diameter = 0.4
; nozzle_high_flow = 0
; objects_info = {"objects":[{"name":"Shape-Box id:0 copy 0","polygon":[[111.000,111.000],[93.000,111.000],[93.000,93.000],[111.000,93.000]]},{"name":"Shape-Box id:0 copy 1","polygon":[[87.000,111.000],[69.000,111.000],[69.000,93.000],[87.000,93.000]]},{"name":"Shape-Box id:0 copy 2","polygon":[[111.000,87.000],[93.000,87.000],[93.000,69.000],[111.000,69.000]]},{"name":"Shape-Box id:0 copy 3","polygon":[[87.000,87.000],[69.000,87.000],[69.000,69.000],[87.000,69.000]]}]}
; only_retract_when_crossing_perimeters = 0
; ooze_prevention = 0
; output_filename_format = {input_filename_base}_{layer_height}mm_{filament_type[0]}_{printer_model}_{print_time}.gcode
Expand Down
42 changes: 42 additions & 0 deletions tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,48 @@ def test_full(self):
'normal_percent_present': True,
'quiet_left_present': True,
'quiet_percent_present': True,
# objects don't match up with the actually printed objects
# this is expected - I have copied object info from another file
'objects_info': {
"objects": [
{
"name": "Shape-Box id:0 copy 0",
"polygon": [
[111.000, 111.000],
[93.000, 111.000],
[93.000, 93.000],
[111.000, 93.000]
]
},
{
"name": "Shape-Box id:0 copy 1",
"polygon": [
[87.000, 111.000],
[69.000, 111.000],
[69.000, 93.000],
[87.000, 93.000]
]
},
{
"name": "Shape-Box id:0 copy 2",
"polygon": [
[111.000, 87.000],
[93.000, 87.000],
[93.000, 69.000],
[111.000, 69.000]
]
},
{
"name": "Shape-Box id:0 copy 3",
"polygon": [
[87.000, 87.000],
[69.000, 87.000],
[69.000, 69.000],
[87.000, 69.000]
]
}
]
}
}
assert len(meta.thumbnails['640x480_PNG']) == 158644

Expand Down
Loading