nonplanar and preview
This commit is contained in:
parent
0e6b6f4b92
commit
af96629b76
2 changed files with 5 additions and 9 deletions
|
|
@ -294,7 +294,6 @@ class SLICENODE_SliceShells(SliceNode):
|
||||||
|
|
||||||
return slices
|
return slices
|
||||||
|
|
||||||
|
|
||||||
@register_class
|
@register_class
|
||||||
class SLICENODE_BufferShells(SliceNode):
|
class SLICENODE_BufferShells(SliceNode):
|
||||||
bl_label = "Buffer Shells"
|
bl_label = "Buffer Shells"
|
||||||
|
|
@ -567,11 +566,7 @@ class SLICENODE_GcodeToMesh(ExecSliceNode):
|
||||||
new_e = params.get('E', last_e)
|
new_e = params.get('E', last_e)
|
||||||
|
|
||||||
if cmd == 'G1':
|
if cmd == 'G1':
|
||||||
# Check if it's an extrusion move
|
is_extruding = new_e > 0
|
||||||
# In absolute mode (typical), E must increase.
|
|
||||||
# In relative mode, E must be > 0.
|
|
||||||
# We'll assume absolute mode as per Pather.to_gcode() M82
|
|
||||||
is_extruding = new_e > last_e
|
|
||||||
|
|
||||||
if is_extruding:
|
if is_extruding:
|
||||||
segments.append(((last_x, last_y, last_z), (new_x, new_y, new_z)))
|
segments.append(((last_x, last_y, last_z), (new_x, new_y, new_z)))
|
||||||
|
|
|
||||||
|
|
@ -331,6 +331,7 @@ class Pather(object):
|
||||||
]
|
]
|
||||||
|
|
||||||
last_z = -1.0
|
last_z = -1.0
|
||||||
|
max_z = 0
|
||||||
|
|
||||||
for line in self.paths:
|
for line in self.paths:
|
||||||
coords = line.tolist()
|
coords = line.tolist()
|
||||||
|
|
@ -341,7 +342,7 @@ class Pather(object):
|
||||||
|
|
||||||
if abs(z0 - last_z) > 0.001:
|
if abs(z0 - last_z) > 0.001:
|
||||||
gcode.append(f";BEFORE_LAYER_CHANGE")
|
gcode.append(f";BEFORE_LAYER_CHANGE")
|
||||||
gcode.append(f"G1 Z{z0:.3f} F720")
|
gcode.append(f"G0 Z{z0:.3f} F720")
|
||||||
gcode.append(f";AFTER_LAYER_CHANGE")
|
gcode.append(f";AFTER_LAYER_CHANGE")
|
||||||
last_z = z0
|
last_z = z0
|
||||||
|
|
||||||
|
|
@ -350,11 +351,11 @@ class Pather(object):
|
||||||
|
|
||||||
for p1, p2 in zip(coords, coords[1:]):
|
for p1, p2 in zip(coords, coords[1:]):
|
||||||
seg_len: float = segment_length_3d(p1, p2)
|
seg_len: float = segment_length_3d(p1, p2)
|
||||||
# Calculate extrusion for this segment only
|
|
||||||
e_segment = seg_len * self.extrusion_rate
|
e_segment = seg_len * self.extrusion_rate
|
||||||
x, y, z = p2
|
x, y, z = p2
|
||||||
gcode.append(
|
gcode.append(
|
||||||
f"G1 X{x:.3f} Y{y:.3f} Z{z:.3f} E{e_segment:.5f} F{self.feedrate}"
|
f"G1 X{x:.3f} Y{y:.3f} Z{z:.3f} E{e_segment:.5f} F{self.feedrate}"
|
||||||
)
|
)
|
||||||
|
max_z = max(max_z, z)
|
||||||
|
|
||||||
return "\n".join(gcode)
|
return "\n".join(gcode)
|
||||||
Loading…
Add table
Reference in a new issue