cimery-ifc README + usd 테스트 unused import 정리

## crates/ifc/README.md 신설
- Phase 1~3c 현황표 (Sprint 33~37) + 미구현 로드맵
- 사용 예: 직접 구성 / viewer scene_params_to_ifc 변환
- IFC 뷰어 호환성 (BlenderBIM/Solibri/Navisworks/IfcOpenShell)
- GUID 설명, snapshot 테스트 가이드

## crates/usd/src/lib.rs
cargo fix 로 unused imports 자동 정리 (test 모듈).

cargo check --workspace --all-targets --features occt: 0 경고.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
minsung
2026-04-16 08:43:41 +09:00
parent a985e62254
commit 6a80aac30b
2 changed files with 103 additions and 3 deletions

100
cimery/crates/ifc/README.md Normal file
View File

@@ -0,0 +1,100 @@
# cimery-ifc
교량 IR → IFC4X3 Add2 STEP Part21 익스포터.
## 기능 현황 (Sprint 33~37)
| Phase | 내용 | Sprint |
|-------|------|--------|
| 1 | STEP Part21 writer + 핵심 계층(Project/Site/Bridge) + 거더·데크·피어·교대·받침 사각 profile | 33 |
| 2 | PSC-I 실제 14점 단면(IfcArbitraryClosedProfileDef) + Skew 회전 + 헌치 + 방호벽(IfcRailing) | 34 |
| 3a | Pset_BeamCommon (Reference·Span·LoadBearing·IsExternal) | 35 |
| 3b | IfcAlignment (직선 horizontal + 평지 vertical 세그먼트) | 36 |
| 3c (camber) | `camber > 0` 시 거더 10 세그먼트 분할 포물선 근사 | 37 |
### 미구현 로드맵 (Phase 4+)
- IfcLinearPlacement — 요소를 IfcAlignment 에 anchor
- Pset_BearingCommon · Pset_SlabCommon
- IfcElementAssembly 로 Pier(column+cap+footing) 그룹화
- IfcPile (IFC4X3 신규, 현재 기초는 IfcFooting 통합)
- 변단면 거더 IFC 반영 (현재 뷰어만)
## 사용 예
```rust
use cimery_ifc::{BridgeExportParams, IfcSectionKind, export_bridge};
let params = BridgeExportParams {
name: "MyBridge".into(),
span_m: 40.0,
span_count: 3,
girder_count: 5,
girder_spacing: 2_500.0,
girder_height: 1_800.0,
slab_thickness: 220.0,
bearing_height: 60.0,
section_kind: IfcSectionKind::PscI,
skew_deg: 15.0,
haunch_depth: 80.0,
show_parapets: true,
show_joints: true,
camber_mid_mm: 50.0,
};
let ifc_text = export_bridge(&params);
std::fs::write("bridge.ifc", ifc_text).unwrap();
```
또는 viewer `SceneParams` 에서 자동 변환:
```rust
use cimery_viewer::project_file::scene_params_to_ifc;
let ifc_params = scene_params_to_ifc(&scene_params, "MyBridge");
let ifc_text = cimery_ifc::export_bridge(&ifc_params);
```
## IFC 뷰어 호환성
IFC4X3_ADD2 스키마 준수. 다음 뷰어에서 열 수 있음:
- **BlenderBIM** (bonsai.bim) — IFC4X3 전면 지원, 권장
- **Solibri Office/Anywhere** — IFC4/IFC4X3 지원
- **Navisworks 2025+** — IFC4X3 임포트 지원
- **IfcOpenShell 기반 CLI 검증**: `ifcopenshell-tester bridge.ifc`
- **bSI IFC4X3 validator (웹)** — 스키마 검증용
제한:
- `IfcBridge`·`IfcAlignment` 는 IFC4X3 전용 → IFC2X3 전용 도구(Revit 일부 버전)에서 미표시.
- 거더가 camber > 0 일 때 10 개 세그먼트로 분할 — 뷰어에서 "수많은 빔" 으로 표시 (정상).
## IfcGloballyUniqueId (GUID)
UUIDv4 128비트를 buildingSMART base64 22자 (`0-9A-Za-z_$`) 로 인코딩.
매 실행마다 새 GUID 생성 → **결정적 비교 시 snapshot 테스트는 `mask_guids()` 로 정규화** 필수.
## 테스트
```bash
cargo test -p cimery-ifc # 20 단위 + 8 snapshot
INSTA_UPDATE=always cargo test ... # snapshot baseline 갱신
```
## 크레이트 구조
```
src/
├── lib.rs 공개 API (export_bridge, BridgeExportParams, IfcSectionKind)
├── writer.rs STEP Part21 writer — IfcWriter, Ref, lit/real/real3/ref_list
├── guid.rs IfcGUID 생성 (UUIDv4 → base64-22)
└── bridge_export.rs Bridge 계층 + 엔티티 생성 로직
tests/
├── snapshot_tests.rs 결정적 회귀 테스트 (GUID 마스킹)
└── snapshots/ insta baseline .snap 파일
```
## 참조
- buildingSMART IFC4X3 Add2: https://standards.buildingsmart.org/IFC/RELEASE/IFC4_3/
- STEP Part21: ISO 10303-21:2016
- ParaWiki 교각 파라미터 매핑: `wiki/교각 파라미터 카탈로그.md`
- ADR-004: Sprint 25~39 아키텍처 결정 (D10~D13 IFC)

View File

@@ -288,10 +288,10 @@ impl BridgeExporter {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use cimery_core::{AbutmentType, BearingType, MaterialGrade, PierType, ColumnShape, SectionType}; use cimery_core::{MaterialGrade, SectionType};
use cimery_ir::{ use cimery_ir::{
AbutmentIR, BearingIR, CapBeamIR, FeatureId, GirderIR, FeatureId, GirderIR,
PscISectionParams, SectionParams, WingWallIR, PscISectionParams, SectionParams,
}; };
use cimery_kernel::{PureRustKernel, StubKernel}; use cimery_kernel::{PureRustKernel, StubKernel};