橋本 Hashimoto   Baku

橋本 Hashimoto   Baku

Slic3r (Scratchpad)

This page is a personal scratchpad.

こんな感じでCLIを呼び出して、連番STLをGコードに変換する。

import glob
import subprocess
import os

SLIC3R_PATH = '/Applications/Original Prusa Drivers/PrusaSlicer.app/Contents/MacOS/PrusaSlicer'

CONFIG = '../itm/test_animation/slic3r_config.ini'

STL_DIR = '../itm/test_animation/stl'
OUT_DIR = '../itm/test_animation/gcode'

all_stls = glob.glob(STL_DIR + '/**/*.stl')

for stl_file in all_stls:
    out_file = stl_file.replace(STL_DIR, OUT_DIR).replace('.stl', '.gcode')

    os.makedirs(os.path.dirname(out_file), exist_ok=True)

    subprocess.run([SLIC3R_PATH, '-g', stl_file, '--load', CONFIG, '--output', out_file])

BambuのPrivacy Policy更新を巡る動き