refactor(M02): 도면 기본 양식을 resources/master_template/drawing/ 으로 옮김 · 읽는 자리 고침 (PLAN 10-0 · 10-3)
- resources/template_2dDrawing → resources/master_template/drawing (안 쓰는 01_template_Longitudinal 둘 포함) - B07 도각 엔진 _TEMPLATE_DIR · 도각 편집 주석 · 표지 시험 경로 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PxvYb5ufV1kWdBvZbpDfu6
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""B07 도각 템플릿 병합 — openwebcad JSON 템플릿을 도면 콘텐츠 둘레에 배치한다.
|
||||
|
||||
resources/template_2dDrawing/의 사전 변환 템플릿(A1 도각 등)을 로드해,
|
||||
resources/master_template/drawing/의 사전 변환 템플릿(A1 도각 등)을 로드해,
|
||||
도면 콘텐츠 bbox에 맞춰 균등 스케일·이동시킨 뒤 잠금 프레임 레이어
|
||||
(b08-frame) 엔티티로 병합한다. 콘텐츠 좌표(m)는 건드리지 않는다 —
|
||||
템플릿 쪽을 확대해 콘텐츠를 감싼다.
|
||||
@@ -27,7 +27,7 @@ from B07_DesignDetail.B07_DesignDetail_Engine_Cad import (
|
||||
)
|
||||
from B07_DesignDetail.B07_DesignDetail_Engine_Cad_Svg import fit_polylines, svg_polylines
|
||||
|
||||
_TEMPLATE_DIR = Path(__file__).resolve().parent.parent / "resources" / "template_2dDrawing"
|
||||
_TEMPLATE_DIR = Path(__file__).resolve().parent.parent / "resources" / "master_template" / "drawing"
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -44,7 +44,7 @@ _A1_INNER = (42.0, 47.0, 812.0, 567.0)
|
||||
_CONTENT_MARGIN = 0.02
|
||||
|
||||
# 회사가 자기 도각을 두는 자리 — `storage/{회사}/templates/`. 프로그램 기본 도각
|
||||
# (`resources/template_2dDrawing/`)은 **읽기 전용**이고, 고객이 고친 도각은 여기 쌓인다
|
||||
# (`resources/master_template/drawing/`)은 **읽기 전용**이고, 고객이 고친 도각은 여기 쌓인다
|
||||
# (2026-09-01 사용자 확정: "정본은 그냥 두고 수정하는 기능").
|
||||
COMPANY_TEMPLATE_SUBDIR = "templates"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* B07 도각 편집 모드 — 캐드 화면에서 도각(양식)만 따로 열어 고치고 [완료]로 한 번에 반영한다.
|
||||
*
|
||||
* 정본(`resources/template_2dDrawing/00_template_A1.json`)은 프로그램 기본 도각이라
|
||||
* 정본(`resources/master_template/drawing/00_template_A1.json`)은 프로그램 기본 도각이라
|
||||
* 건드리지 않는다. 고친 도각은 **회사 도각**(`storage/{회사}/templates/`)으로 저장되고,
|
||||
* 이후 그리는 도면이 그것을 쓴다 (2026-09-01 사용자 확정).
|
||||
*
|
||||
|
||||
@@ -12,7 +12,7 @@ import pytest
|
||||
from B07_DesignDetail.B07_DesignDetail_Engine_Cad import DRAWING_FORMAT, FRAME_LAYER_ID
|
||||
from B07_DesignDetail.B07_DesignDetail_Engine_Cad_Cover import build_cover_drawing
|
||||
|
||||
TEMPLATE = Path("resources/template_2dDrawing/00_template_cover.json")
|
||||
TEMPLATE = Path("resources/master_template/drawing/00_template_cover.json")
|
||||
|
||||
# A1 도각 템플릿과 같은 재단 표식 원점 — 두 도면이 같은 종이 좌표계를 써야 한다.
|
||||
PAPER = (-5.05, -5.04, 834.95, 588.96)
|
||||
@@ -62,9 +62,7 @@ def test_도면은_잠금_도각_레이어로_나온다():
|
||||
assert {e["layerId"] for e in drawing["entities"]} == {FRAME_LAYER_ID}
|
||||
layers = {layer["id"]: layer for layer in drawing["layers"]}
|
||||
assert layers[FRAME_LAYER_ID]["isLocked"] is True
|
||||
assert any(not layer["isLocked"] for layer in drawing["layers"]), (
|
||||
"덧그릴 비잠금 도면층이 없다"
|
||||
)
|
||||
assert any(not layer["isLocked"] for layer in drawing["layers"]), "덧그릴 비잠금 도면층이 없다"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
Reference in New Issue
Block a user