3mf generation complete
This commit is contained in:
parent
43e565932f
commit
3a856358dc
1 changed files with 16 additions and 1 deletions
|
|
@ -1078,8 +1078,23 @@ class SLICENODE_PrusaslicerSlice(ExecSliceNode):
|
||||||
slicing_group = SlicingGroup([obj])
|
slicing_group = SlicingGroup([obj])
|
||||||
|
|
||||||
# Offset by the bed center
|
# Offset by the bed center
|
||||||
|
def parse_bed_center(bed_shape_str: str) -> np.ndarray:
|
||||||
|
try:
|
||||||
|
points = []
|
||||||
|
for p in bed_shape_str.split(','):
|
||||||
|
x, y = map(float, p.split('x'))
|
||||||
|
points.append((x, y))
|
||||||
|
points_np = np.array(points)
|
||||||
|
return (points_np.min(axis=0) + points_np.max(axis=0)) / 2.0
|
||||||
|
except:
|
||||||
|
return np.array([125.0, 105.0])
|
||||||
|
|
||||||
|
bed_shape = cache.profiles[printer_id].all_conf_dict.get('bed_shape', '0x0,250x0,250x210,0x210')
|
||||||
|
bed_center = parse_bed_center(bed_shape)
|
||||||
|
|
||||||
a_z = -slicing_group.min_z
|
a_z = -slicing_group.min_z
|
||||||
slicing_group.offset()
|
offset = np.array([bed_center[0], bed_center[1], a_z]) - np.array([slicing_group.center_xy[0], slicing_group.center_xy[1], 0])
|
||||||
|
slicing_group.offset(offset)
|
||||||
|
|
||||||
# Generate the ConfigWriter with no overrides
|
# Generate the ConfigWriter with no overrides
|
||||||
conf_writer = cache.generate_conf_writer(printer_id, filament_ids, print_id, overrides={})
|
conf_writer = cache.generate_conf_writer(printer_id, filament_ids, print_id, overrides={})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue