파일마다 포맷 폭이 달라(≈80 대 100) 한 줄만 고쳐도 포맷터가 무관한 줄을 대량 재포맷했음. 사용자 지시로 전체를 한 번에 맞춤. 코드 동작 변경 없음 — 포맷만. - 프론트엔드 `.ts/.css/.html` → 저장소 prettier (`.prettierrc`, printWidth 100) - `B07_DesignDetail/openwebcad/**` → 자체 biome (tab 들여쓰기·single quote·lineWidth 100). `biome format` 만 사용 — `biome lint --write` 는 포맷 아닌 코드 수정까지 하므로 제외 - 파이썬 → `ruff format` (엔진 코드는 이미 정합, resources·scratch 스크립트 24개만 변경) 두 포맷터가 서로 되돌리지 않도록 `.prettierignore` 신규 — openwebcad 와 빌드·산출물 폴더를 prettier 대상에서 뺌. `.prettierrc` 에 `endOfLine: "auto"` 추가 — 기본값 `lf` 가 `core.autocrlf=true` 로 받은 CRLF 파일을 매번 전부 다시 써서 `--list-different` 가 실제 포맷 차이를 가리고 있었음. 검증: `tsc --noEmit` 통과(루트·openwebcad 둘 다), pytest 349 passed / 17 skipped / 0 failed, CAD vitest 87건 중 81 passed / 6 failed(laptop-sub 기준선과 동일, 회귀 없음). 포맷터 재실행 시 prettier·biome 모두 변경 0건. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
219 lines
5.0 KiB
TypeScript
219 lines
5.0 KiB
TypeScript
/** 홈 탭 — 그리기 패널 명령 (조사표 1절 전 항목) */
|
||
import type { CadCommand } from './command.types';
|
||
import { Tool } from '../tools';
|
||
import { circleToolStateMachine } from '../tools/circle-tool';
|
||
import {
|
||
arcToolStateMachine,
|
||
donutToolStateMachine,
|
||
ellipseToolStateMachine,
|
||
plineToolStateMachine,
|
||
pointToolStateMachine,
|
||
polygonToolStateMachine,
|
||
splineToolStateMachine,
|
||
} from '../tools/draw/basic-draw-tools';
|
||
import {
|
||
mlineToolStateMachine,
|
||
mlstyleToolStateMachine,
|
||
rayToolStateMachine,
|
||
wipeoutToolStateMachine,
|
||
xlineToolStateMachine,
|
||
} from '../tools/draw/construction-tools';
|
||
import { divideToolStateMachine, measureLengthToolStateMachine } from '../tools/draw/divide-tools';
|
||
import {
|
||
boundaryToolStateMachine,
|
||
gradientToolStateMachine,
|
||
hatchToolStateMachine,
|
||
regionToolStateMachine,
|
||
} from '../tools/draw/fill-tools';
|
||
import { lineToolStateMachine } from '../tools/line-tool';
|
||
import { rectangleToolStateMachine } from '../tools/rectangle-tool';
|
||
|
||
export const DRAW_COMMANDS: CadCommand[] = [
|
||
{
|
||
id: 'LINE',
|
||
label: '선',
|
||
aliases: ['L'],
|
||
glyph: '╱',
|
||
hint: '두 점 사이에 직선 세그먼트를 작성한다',
|
||
tool: Tool.LINE,
|
||
machine: lineToolStateMachine,
|
||
},
|
||
{
|
||
id: 'PLINE',
|
||
label: '폴리선',
|
||
aliases: ['PL'],
|
||
glyph: '⌁',
|
||
hint: '연결된 선을 하나의 객체로 작성한다',
|
||
tool: Tool.PLINE,
|
||
machine: plineToolStateMachine,
|
||
},
|
||
{
|
||
id: 'CIRCLE',
|
||
label: '원',
|
||
aliases: ['C'],
|
||
glyph: '○',
|
||
hint: '중심과 반지름으로 원을 작성한다',
|
||
tool: Tool.CIRCLE,
|
||
machine: circleToolStateMachine,
|
||
},
|
||
{
|
||
id: 'ARC',
|
||
label: '호',
|
||
aliases: ['A'],
|
||
glyph: '◜',
|
||
hint: '시작점·통과점·끝점 세 점으로 호를 작성한다',
|
||
tool: Tool.ARC,
|
||
machine: arcToolStateMachine,
|
||
},
|
||
{
|
||
id: 'RECTANG',
|
||
label: '직사각형',
|
||
aliases: ['REC'],
|
||
glyph: '▭',
|
||
hint: '두 대각점으로 직사각형을 작성한다',
|
||
tool: Tool.RECTANGLE,
|
||
machine: rectangleToolStateMachine,
|
||
},
|
||
{
|
||
id: 'POLYGON',
|
||
label: '다각형',
|
||
aliases: ['POL'],
|
||
glyph: '⬠',
|
||
hint: '지정한 변 수의 정다각형을 작성한다',
|
||
tool: Tool.POLYGON,
|
||
machine: polygonToolStateMachine,
|
||
},
|
||
{
|
||
id: 'ELLIPSE',
|
||
label: '타원',
|
||
aliases: ['EL'],
|
||
glyph: '⬭',
|
||
hint: '중심과 두 축으로 타원을 작성한다',
|
||
tool: Tool.ELLIPSE,
|
||
machine: ellipseToolStateMachine,
|
||
},
|
||
{
|
||
id: 'SPLINE',
|
||
label: '스플라인',
|
||
aliases: ['SPL'],
|
||
glyph: '∿',
|
||
hint: '지정한 점을 지나는 부드러운 곡선을 작성한다',
|
||
tool: Tool.SPLINE,
|
||
machine: splineToolStateMachine,
|
||
},
|
||
{
|
||
id: 'MLINE',
|
||
label: '다중선',
|
||
aliases: ['ML'],
|
||
glyph: '⋕',
|
||
hint: '평행한 여러 선을 한 번에 작성한다',
|
||
tool: Tool.MLINE,
|
||
machine: mlineToolStateMachine,
|
||
},
|
||
{
|
||
id: 'MLSTYLE',
|
||
label: '다중선 스타일',
|
||
glyph: '⚙',
|
||
hint: '다중선의 요소 수와 간격을 정한다',
|
||
tool: Tool.MLSTYLE,
|
||
machine: mlstyleToolStateMachine,
|
||
},
|
||
{
|
||
id: 'XLINE',
|
||
label: '구성선',
|
||
aliases: ['XL'],
|
||
glyph: '⟷',
|
||
hint: '양방향으로 길게 뻗는 기준선을 작성한다',
|
||
tool: Tool.XLINE,
|
||
machine: xlineToolStateMachine,
|
||
},
|
||
{
|
||
id: 'RAY',
|
||
label: '광선',
|
||
glyph: '⟶',
|
||
hint: '한 방향으로 길게 뻗는 기준선을 작성한다',
|
||
tool: Tool.RAY,
|
||
machine: rayToolStateMachine,
|
||
},
|
||
{
|
||
id: 'POINT',
|
||
label: '점',
|
||
aliases: ['PO'],
|
||
glyph: '·',
|
||
hint: '점 객체를 작성한다',
|
||
tool: Tool.POINT,
|
||
machine: pointToolStateMachine,
|
||
},
|
||
{
|
||
id: 'DONUT',
|
||
label: '도넛',
|
||
aliases: ['DO'],
|
||
glyph: '◎',
|
||
hint: '내부·외부 지름으로 링을 작성한다',
|
||
tool: Tool.DONUT,
|
||
machine: donutToolStateMachine,
|
||
},
|
||
{
|
||
id: 'DIVIDE',
|
||
label: '등분',
|
||
aliases: ['DIV'],
|
||
glyph: '⋯',
|
||
hint: '객체를 자르지 않고 같은 간격의 점을 배치한다',
|
||
tool: Tool.DIVIDE,
|
||
machine: divideToolStateMachine,
|
||
},
|
||
{
|
||
id: 'MEASURE',
|
||
label: '길이분할',
|
||
aliases: ['ME'],
|
||
glyph: '⋮',
|
||
hint: '지정 거리마다 점을 배치한다',
|
||
tool: Tool.MEASURE_LENGTH,
|
||
machine: measureLengthToolStateMachine,
|
||
},
|
||
{
|
||
id: 'HATCH',
|
||
label: '해치',
|
||
aliases: ['H', 'BH'],
|
||
glyph: '▨',
|
||
hint: '닫힌 경계를 패턴으로 채운다',
|
||
tool: Tool.HATCH,
|
||
machine: hatchToolStateMachine,
|
||
},
|
||
{
|
||
id: 'GRADIENT',
|
||
label: '그라데이션',
|
||
aliases: ['GD'],
|
||
glyph: '◪',
|
||
hint: '닫힌 경계를 색 변화로 채운다',
|
||
tool: Tool.GRADIENT,
|
||
machine: gradientToolStateMachine,
|
||
},
|
||
{
|
||
id: 'BOUNDARY',
|
||
label: '경계',
|
||
aliases: ['BO'],
|
||
glyph: '⬡',
|
||
hint: '선택 객체에서 닫힌 폴리선 경계를 만든다',
|
||
tool: Tool.BOUNDARY,
|
||
machine: boundaryToolStateMachine,
|
||
},
|
||
{
|
||
id: 'REGION',
|
||
label: '영역',
|
||
aliases: ['REG'],
|
||
glyph: '⬢',
|
||
hint: '닫힌 객체를 영역(닫힌 폴리선)으로 만든다',
|
||
tool: Tool.REGION,
|
||
machine: regionToolStateMachine,
|
||
},
|
||
{
|
||
id: 'WIPEOUT',
|
||
label: '와이프아웃',
|
||
glyph: '▩',
|
||
hint: '뒤쪽 객체를 가리는 마스크를 작성한다',
|
||
tool: Tool.WIPEOUT,
|
||
machine: wipeoutToolStateMachine,
|
||
},
|
||
];
|