AndrewEllis93 / Ellis-SuperSlicer-Profiles

752 stars 167 forks source link

Compact the output of feature_gcode by using a variable instead of repeating each extrusion_role individually #6

Closed kesor closed 2 years ago

AndrewEllis93 commented 2 years ago

Hi,

I like the line breaks - though it's more of a stylistic choice than functional. It makes it easier for me to read rather than one monolithic wall of text.

That said, I did take your slightly shorter if/elsif statements, they seem to be working, so I will likely incorporate that.

Hopefully this won't even be necessary soon. The PR to make this native was just merged to the dev branch.

; External perimeter
{if extrusion_role=~/ExternalPerimeter/}
SET_VELOCITY_LIMIT ACCEL=1000 ACCEL_TO_DECEL=500 SQUARE_CORNER_VELOCITY=8

; Perimeter
{elsif extrusion_role=~/Perimeter/}
SET_VELOCITY_LIMIT ACCEL=2000 ACCEL_TO_DECEL=1000 SQUARE_CORNER_VELOCITY=8

; Overhang perimeter
{elsif extrusion_role=~/OverhangPerimeter/}
SET_VELOCITY_LIMIT ACCEL=2000 ACCEL_TO_DECEL=1000 SQUARE_CORNER_VELOCITY=8

; Overhang perimeter
{elsif extrusion_role=~/InternalInfill/}
SET_VELOCITY_LIMIT ACCEL=7000 ACCEL_TO_DECEL=3500 SQUARE_CORNER_VELOCITY=8

; Top solid infill
{elsif extrusion_role=~/TopSolidInfill/}
SET_VELOCITY_LIMIT ACCEL=2000 ACCEL_TO_DECEL=1000 SQUARE_CORNER_VELOCITY=8

; Solid infill
{elsif extrusion_role=~/SolidInfill/}
SET_VELOCITY_LIMIT ACCEL=4000 ACCEL_TO_DECEL=2000 SQUARE_CORNER_VELOCITY=8

; Bridge infill
{elsif extrusion_role=~/BridgeInfill/}
SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500 SQUARE_CORNER_VELOCITY=8

; Gap fill
{elsif extrusion_role=~/GapFill/}
SET_VELOCITY_LIMIT ACCEL=2000 ACCEL_TO_DECEL=1000 SQUARE_CORNER_VELOCITY=8

; Skirt
{elsif extrusion_role=~/Skirt/}
SET_VELOCITY_LIMIT ACCEL=7000 ACCEL_TO_DECEL=3500 SQUARE_CORNER_VELOCITY=8

; Support material
{elsif extrusion_role=~/SupportMaterial/}
SET_VELOCITY_LIMIT ACCEL=7000 ACCEL_TO_DECEL=3500 SQUARE_CORNER_VELOCITY=8

; Support material interface
{elsif extrusion_role=~/SupportMaterialInterface/}
SET_VELOCITY_LIMIT ACCEL=7000 ACCEL_TO_DECEL=3500 SQUARE_CORNER_VELOCITY=8

; Thin walls
{elsif extrusion_role=~/ThinWall/}
SET_VELOCITY_LIMIT ACCEL=2000 ACCEL_TO_DECEL=1000 SQUARE_CORNER_VELOCITY=8

; Other / catch-all
{else}
SET_VELOCITY_LIMIT ACCEL=4444 ACCEL_TO_DECEL=2222 SQUARE_CORNER_VELOCITY=8
{endif}
AndrewEllis93 commented 2 years ago

Modified feature gcode

kesor commented 2 years ago

In my PR I used ; [extrusion_role] (that is how variables are used in SS) that translates in the gcode into the ; Thin walls or ; Support material or whatever other comment you had there explicitly. By looking at my gcode I just noticed that these comments are appearing in "the wrong place" since you placed them before the elsif where they actually belong, which is why I placed it at the very top of the section - so there is just one single comment at the right place.

@AndrewEllis93

AndrewEllis93 commented 2 years ago

Maybe I misunderstood then. So with the code block I posted earlier, it just needs that ; [extrusion_role] at the top? (I basically took this from Stephan's profile, so I can't say I know exactly how it works)

AndrewEllis93 commented 2 years ago

If you can update that code block I posted, I can try it out again