fix(slicer): 서포트 스타일 목록을 PrusaSlicer 2.9 실제 값(grid/snug/organic)으로 — 'snake'는 슬라이싱 실패, 'tree'는 구형, snug 누락. 저장 프로파일의 옛 값은 가까운 값으로 표시

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
kimandClaude Sonnet 5.5 committed 2026-09-30 14:08:42 +09:00
1 parent a426c6aee6
commit 6b6f44cfe3
1 file changed
+11 -1
+11 -1
View File
@@ -77,7 +77,7 @@
] },
{ title: '서포트', fields: [
{ key: 'support_material', label: '서포트 사용', type: 'check' },
{ key: 'support_material_style', label: '서포트 스타일', type: 'select', opts: [['grid', '그리드'], ['organic', '유기(트리)'], ['tree', '트리(구형)'], ['snake', '스네이크']] },
{ key: 'support_material_style', label: '서포트 스타일', type: 'select', opts: [['grid', '그리드'], ['snug', '스너그(윤곽 밀착)'], ['organic', '유기(트리)']] },
{ key: 'support_material_threshold', label: '오버행 임계각(°)', type: 'number', min: 0, max: 90, step: 1 },
{ key: 'support_material_buildplate_only', label: '바닥면 전용', type: 'check' },
{ key: 'support_material_spacing', label: '서포트 간격(mm)', type: 'number', min: 0.5, max: 10, step: 0.5 },
@@ -759,9 +759,19 @@
if (f.type === 'check') el.checked = String(raw) === '1' || String(raw).toLowerCase() === 'true';
else if (f.pct) el.value = parseFloat(String(raw)) || 0;
else if (f.type === 'number') el.value = parseFloat(String(raw));
else if (key === 'support_material_style') el.value = normalizeSupportStyle(raw);
else el.value = String(raw);
}
// PrusaSlicer 2.9의 서포트 스타일은 grid / snug / organic 셋뿐이다(--help로 확인). 예전 화면 목록의
// 'snake'는 슬라이싱 자체가 실패하고 'tree'는 구형 이름이라, 저장된 프로파일에 남아 있으면 가까운
// 값으로 바꿔 보여 준다 — 그렇지 않으면 select가 빈 값이 되고 저장할 때 그대로 나간다.
function normalizeSupportStyle(v) {
const s = String(v || '').toLowerCase();
if (s === 'grid' || s === 'snug' || s === 'organic') return s;
return s === 'tree' ? 'organic' : 'grid';
}
function getIniValue(f) {
const el = panelEl.querySelector('#' + fieldId(f.key)); if (!el) return null;
if (f.virtual) return null;