Commit Graph
1159 Commits
Author SHA1 Message Date
hm 1467599888 merge: sync origin/main (CAE beam/Nedelec mesh VDE-1619/1620/1621, box-sphere bench guard) into 1.0.471 release 2026-11-20 04:49:52 +08:00
hm 7091f6ff7b feat(kcp): Wave 4 - bounded boolean fragmentation, CBRA perf, SSI region graph, midsurface chain, interop honesty, heal KPI (1.0.471) 2026-11-20 04:49:32 +08:00
hm 5ed5d5e88c merge: integrate W21 CBRA cut-graph profiling and exact-path perf (task-92) 2026-11-20 04:00:35 +08:00
hm d9594653c1 perf(cbra): W21 exact trim-domain hot-path precompute + opt-in cross-frame warm hints
Cut graph 真实模型 snap_clip profile 定位的三处热点:

1) 默认开启(精确、结果逐位不变):p-curve UV 控制点盒预筛
   - FaceTrimDomain::pc_uv_bbox:每条 trim p-curve 控制点 UV 包围盒(有理权>0
     时曲线在凸包内 => 盒距为最近距离下界),域构建时一次算好
   - face_violation_uv 两遍选择:先取盒下界最小者做种子,再按原顺序剪枝
     lb > best_d*(1+1e-9)+1e-12;平局规则与旧 qd>=best_d 跳过等价
   - 效果:pcurve 求值 9,677,114 -> 1,193 cals,pcurve 12,008ms -> 2.4ms

2) 默认开启(精确):trim 环朝向预计算 FaceTrimDomain::loop_ccw
   - face_violation_uv 不再每次对 819,400 点 trim 多边形重算 polygon_area
   - 效果:exact_clip 15,545ms -> 330~521ms(真实模型 union raw)

3) 默认关闭(VDE_CB1_CROSS_WARM):数值分支不同帧 trim 基面批量温启动分类
   - face_contains_uv/face_contains_with_tol 接受 base_hint,残差超限回退全局
   - VERIFY_UV 下与全局分类对照计数;默认 off,行为与改动前一致

附带:VDE_CB1_PROFILE/NO_WARM_PROJ/VERIFY_UV 改为每次 build_cut_graph 动态读取;
CutGraphStats 增加 uv_hint_checks/uv_hint_mismatches 只读计数;增加 CB1-XPH/NUM/DOM
env 门控调试输出;新增 7 个 topology 测试(env 惰性/确定性/域一致性)。

正确性:18 行 gated [CBRA] 与 ab_1050_final_cbra_gated.txt 逐字节一致;
VDE_CB1_VERIFY_UV=1 下 9 个 CBRA run hint 35,325 次 mismatch=0;
定向 ctest 100% passed (441 tests, 0 failed)。
2026-11-20 03:57:50 +08:00
hm 76bcf78aab merge: integrate W23 multi-face-chain midsurface + offset/region bridge (task-94) 2026-11-20 03:31:13 +08:00
hm 4122870fbd feat(brep): W23 multi-face-chain & shell-body midsurface with offset/region bridge (VDE-1624)
- new opt-in module vde::brep::midsurface_chain: face-level chain midsurface
  (mid_surface_chain), shell-body midsurface (midsurface_from_shell_body),
  midsurface shell assembly (build_midsurface_shell) bridging to
  offset_body / analyze_face_regions / analyze_regions.
- plane/cylinder double-sided pairing, chain merge (coplanar within 5 deg,
  line shared edges), loop stitch/cancel + boundary clipping, thickness
  field classification Constant/Graded/LocalBoundary, patch splitting for
  non-uniform walls with honest e_nonuniform_thickness fallback.
- 15 new tests VDE1624MidsurfaceChain.* (box / hollow box / stepped and
  graded thickness / tilted plate / L bracket / cylinder tube / open shell
  rejection / determinism / face-region consistency / closed shell
  assembly / offset_body bridge); default behaviour unchanged.
- docs/planning/wave4/mid-notes.md: configurations, thickness field,
  unsupported boundaries, reproduction.

Baseline bc4a431d (VDE 1.0.470).
2026-11-20 03:30:14 +08:00
hm 0ffe49427c merge: integrate W22 SSI region-graph boolean prototype (task-93) 2026-11-20 02:54:32 +08:00
hm 40d02afe73 feat(brep): W22 region-graph curved boolean prototype (opt-in)
KCP-1.0 Wave 4 / W22 (task-93): 区域图式曲面布尔 P0 能力第一刀,显式 opt-in。

- 新增 SSIRegionGraphOptions/Stats 与 ssi_boolean_region_graph +
  union/intersection/difference(a,b,opts) 重载;enable=false 转发历史
  3 参重载,默认路径逐位不变(18 行 gated 基线 SHA256 一致)。
- 管线:SeamNetwork(CB1 交线图 + 端点合并/T 拆分/开环端点分类) ->
  LoopRebuild(CB2 面域环/洞/岛/环序审计) -> RegionClassify(CB3 采样 +
  绕数/奇偶独立交叉校验与 ON 消解) -> Stitch(CB4 两遍容差 + gap 驱动
  重缝 + weld 兜底) + valid/水密/体积守恒带终验。
- 失败复用 BooleanFailureReason 诚实上报(空体 + 非空 detail,绝不静默
  水密错误体);AABB 相离快速路径、完全包含 no-cut 路径、开壳/面数超限/
  挖腔差集/全平面/相切构型边界均诚实处理。
- 测试:tests/brep/test_ssi_region_graph.cpp 22 例(全部 Passed);
  ctest -R "SSI|ssi|Boolean|Brep" 316/317 passed, 0 failed。
- 笔记:docs/planning/wave4/ssi-notes.md(设计/能力边界/未完成/证据)。
2026-11-20 02:54:00 +08:00
cp4-io 7ed661b090 feat(io): W24 task-95 honest third-party JT/XT/SAT import + minimal ACIS SAT planar import
- add NativeImportReport/Status/Capability + import_{acis_sat,parasolid_xt,jt}_ex APIs
- third-party ACIS SAT text parser (planar/polyhedral V7 subset: body/lump/shell/face/loop/coedge/edge/vertex/point), type-driven pointers, explicit skip for curved surfaces/edges
- JT segment diagnostics (JTImportInfo): brep payload vs tessellation LOD vs no-geometry, explicit unsupported/partial
- XT capability labels incl. tessellation-only evidence; empty-input and malformed explicit codes
- format_io: accept_native_import() rejects empty models with Error ImportIssue instead of silent ok; capability labels and degraded warnings in messages/diagnostic
- 17 Wave4Interop tests: third-party SAT exact/partial/malformed/unsupported, capability matrix snapshot, JT/XT honesty, import_cad integration
- docs/planning/wave4/io-notes.md: capability matrix before/after, unsupported list, next steps

Baseline bc4a431d (VDE 1.0.470). Task: task-95 (KC-K01).
2026-11-20 02:49:17 +08:00
hm fd775ee5cb feat(cae): periodic node pairing, beam mesh and Nedelec edge mesh handoff (VDE-1619/1621/1620)
Wave 3 of the feedback implementation plan (3 parallel agents + integration);
completes the "not implemented" list of docs/reference/feedback-audit-2026-11-19.md.

VDE-1619 (P2): pair_periodic_nodes -- translational/rotational(Rodrigues)/mirror
1:1 pairing of boundary face nodes; greedy nearest with ambiguity rejection
(whole request fails, no partial output), unmatched lists, no exceptions,
deterministic; 8/8 tests.

VDE-1621 (P2): beam_mesh -- B-Rep to centerlines (analytic cylinder axis ->
faceted prism axis inference -> straight-edge fallback) -> Line2/Line3 elements
with section assignment, junction/end nodes, local axes, Line3 midpoints;
9/9 tests.

VDE-1620 (P3): edge_element_mesh -- global unique edge table, tetra_edges +
tetra_edge_sign direction contract (v-u == sign*(b-a)), B-Rep edge tags,
boundary face edges for PEC; Nedelec1 explicitly rejected (no silent
degradation); 8/8 tests.

Docs: api-reference-mesh +149 lines (3 API contracts), wave-3 parallel
implementation report, remaining-gaps closed list + record, feedback-status
batch entries, ticket appendices.

Verification: full Release build exit 0; 23-suite integration 847 tests passed
0 failed; PR gate 930/930 (104.10 s).
2026-11-20 02:29:45 +08:00
hm 858c113bb4 merge: sync origin/main (face midsurface/offset, surface shell mesh, region table VDE-1623/1618) into 1.0.470 release 2026-11-20 02:02:35 +08:00
hm dd39668a80 fix(brep): sync origin/main (STEP assembly IO) with decoupled header and document-order assembly children (1.0.470 prep) 2026-11-20 02:01:16 +08:00
hm fef4ca22ab feat(brep/cae): face-level midsurface/offset and surface shell mesh; region table (VDE-1623/1618)
pr-quality / static-gate (workflows + docs claims + coverage profile) (push) Canceled after 0s
pr-quality / fast-gate (build + core-pr tests + determinism) (push) Canceled after 0s
VDE-1623 (P1) - face-level midsurface and shell mesh:
  include/vde/brep/face_midsurface.h + src/brep/face_midsurface.cpp
    FaceTrimmedSurface (3D loops + per-segment source faces + thickness)
    offset_face_surface (plane/cylinder exact; sphere/cone/torus/spline reject)
    mid_surface_face (thickness min/mean/max, loop pairing, e_* diagnostics)
  include/vde/cae/surface_shell_mesh.h + src/cae/surface_shell_mesh.cpp
    surface_shell_mesh: quads/tris + thickness + element_source_face +
    boundary_nodes(node, source face)
  deviations documented: cae namespace (avoids brep<->mesh cycle), face-level
  3D loops instead of parametric brep::TrimmedSurface, new function name.
  test_vde1623_face_midsurface 15/15: plate thickness 2 / area 5000 / all quads /
  boundary sources; holed plate keeps 1 inner loop with hole-wall tags;
  wedge e_nonuniform_thickness; loop mismatch e_face_count_mismatch.

VDE-1618 (P2) - body region semantics:
  include/vde/cae/region_table.h + src/cae/region_table.cpp (namespace vde::mesh)
    RegionRole/MeshRegion/RegionTable + build_region_table
    connected-component regions by shared nodes; FNV-1a geometric-signature
    region_id independent of material/element count/order; boundary face tags.
  test_vde1618_region_table 13/13: single box 1 Solid region/6 tags; stable ids
  across remesh; material-independent ids; thin-wall shell 1 Solid/12 planes;
  shell+cavity merged mesh -> Solid+Cavity 2 regions.

Integration fixes:
  surface_shell_mesh.cpp undefined surface_index (blocked A7 builds) -> input_index
  loop_source_faces was all -1: BrepModel::edge_faces takes edge array index while
  sampling stored TopoEdge::id (vertex ids 0..7 shift edge ids 8..19 vs index 0..11)
  -> whole chain now stores indices; source-face tags verified.

Verification: full Release build OK; 20 integration suites all green
(test_vde1623 15/15, test_vde1618 13/13, test_vde1346 15/15, test_vde1360 12/12,
test_fea_mesh 68+1 skip, test_brep 96/96, test_trimmed_surface 34/34, ...);
PR gate 930/930 passed, 0 failed, 76.58 s.
2026-11-20 01:56:43 +08:00
hm 7372161f5a merge: sync origin/main (body access/STEP assembly IO/POLY_LOOP/midsurface + rebase verification) into 1.0.470 release 2026-11-20 01:21:50 +08:00
hm bcd11c317a feat(kcp): Wave 3 - B1 real-model closure diagnosis, boolean pipeline dedupe, TNP wiring, NURBS fit-tolerance, CI coverage gate, tolerant recovery (1.0.470) 2026-11-20 01:21:23 +08:00
hm d0589e4d6c merge: integrate W19 tolerant recovery closure (gap bridge/stitch/heal)
# Conflicts:
#	tests/brep/CMakeLists.txt
2026-11-20 00:53:58 +08:00
hm d5ae3bc614 merge: integrate W17 NURBS fit-to-tolerance closed loop (curves/surfaces) 2026-11-20 00:53:44 +08:00
hm 7e41fa0692 feat(brep): W19 tolerant modeling recovery closed loop (KCP-1.0 Wave 3) 2026-11-20 00:44:06 +08:00
hm 051ca7531d feat(kcp): W17 - NURBS fit-tolerance closed loop and minimal control points
New independent API (fit_tolerance.h/.cpp), no existing behavior touched:
- fit_curve_to_tolerance(points, tol, options): chord parameters, initial
  uniform clamped LSQ fit, measured closest-point error via existing
  curve_closest_point, parameter refinement (strictly decreasing only), knot
  insertion at the max-error location until tolerance met or iteration /
  control-point limit; honest ok=false + diagnostic otherwise.
- fit_surface_to_tolerance(grid, tol, options): tensor-product LSQ with
  measured closest-point error via NurbsSurface::closest_point_param,
  per-direction insertion, same honest stopping rules.
- reverse pruning: remove_knot / reduce_degree_curve / surface_remove_knot
  candidates accepted only when re-measured error stays within tolerance.
- error metric never under-reports: min(closest-point API distance,
  known-fit-parameter evaluate distance); both are genuine distances. For
  large point sets, a known-parameter distance <= tolerance is a provable
  per-point acceptance test and skips the expensive projection (early-skip).
- performance: initial control-point caps 128 (curve) / 64 per direction
  (surface); 10000-point curve 219.1 s -> 1.37 s (112 CP), 101x101 grid
  131.6 s -> 0.03 s (17x25 CP net).

Tests: tests/curves/test_fit_tolerance.cpp (19 cases: curve 12 + surface 7),
registered in tests/curves/CMakeLists.txt. Full suite 19/19; ctest
-R "Curves|Nurbs|Fit|Surface" 21/21; gated [CBRA] 18-line baseline
byte-identical (2344 B, raw SHA256 b3acddc6...e2c). WIP notes in
docs/planning/wave3/nurbs-notes.md.

Existing API behavior unchanged (only 2 CMake registration lines added to
existing files).
2026-11-20 00:36:21 +08:00
hm 7870344bf7 feat(kcp3-tnp): W16 boolean evolution naming facade and u64 backend adapter 2026-11-20 00:35:00 +08:00
hm 848746588f feat(brep/cae): body access contract, STEP assembly IO, PinSlot fix, POLY_LOOP volume, midsurface patches
VDE-1622 实体访问契约:TopoBody 增加 stable_id/revision,新增 body_access.h/.cpp
(list_bodies/extract_body/resolve_body,Resolved/Missing/Ambiguous/Split/Merged),
新增 additive 序列化段 17 BODY_IDENTITY(旧读端跳过,旧文件 revision=0)。

VDE-900 STEP 装配读写:import_step_assembly(PRODUCT/NAUO/IDT -> AssemblyNode 树),
导出端每实例补 CONTEXT_DEPENDENT_SHAPE_REPRESENTATION,产品名与 id 同步改写。

VDE-901 PinSlot:由串行布尔改为单次精确差集(腰形棱柱工具体),体积 1000->400,
新增 apply_assembly_feature_checked 失败外显诊断;BoltHole/RivetPattern 不回归。

VDE-1346 §7 中面元数据:MidsurfacePatch.patch_id/faces/edges/thickness_min/max/mean,
MidSurface.patches/junctions/feature_edges/valid/issues;平面共面 tile 做几何并集
(顶点切分+端点吸附+反向线段抵消),sample_loops 改为按顶点串链避免环绕向丢失。

POLY_LOOP 体积一致性:恢复 VDE-1355 逐三角带符号朝向回退(|raw|<5%*sum|t| 时用体心),
修复 StepImportPolyLoop 两个用例的 mesh_volume 0/49.2 vs analytic 4.08。

tests: test_vde1622_body_access 14, test_vde900_assembly_io 6, test_assembly_pmi 10,
test_step_import 104, test_step_export 22, test_vde1346_cae_preprocess 15, test_fea_mesh 68(+1 skip),
test_brep 96, test_measure 160, test_vde_format 90; PR gate 918/918 (76.09 s).
2026-11-20 00:14:03 +08:00
hm f67920a01f feat(kcp): Wave 2 - deterministic booleans, heal two-pass, topology naming facade, SSI fuzzy, real corpus KPI, exact domain (1.0.469)
pr-quality / static-gate (workflows + docs claims + coverage profile) (push) Canceled after 0s
pr-quality / fast-gate (build + core-pr tests + determinism) (push) Canceled after 0s
2026-11-19 23:33:40 +08:00
hm 5a9c68a4fe merge: integrate Wave 2 W11 SSI fuzzy near-coincident and tangent patch (3ff9741d) 2026-11-19 23:16:36 +08:00
cp2-ssi 3ff9741d1c feat(brep): W11 SSI fuzzy 近重合与相切补丁(BOP/IntPatch 语义借鉴)
- 新增 SSIBooleanFuzzyOptions/SSIBooleanFuzzyStats:fuzzy 默认关闭(enable=false),默认路径逐位不变
- 特性①:区域级近重合面对合并(法向 < fuzzy_angle、|gap| <= fuzzy_tol),接口塌缩+顶点吸附+重缝合,体积守恒/水密/方向验收
- 特性②:相切/近切补丁(平面×圆柱/球、球×球相切检测;退化小环丢弃;近重合切点合并)
- 特性③:三条 ssi_boolean_* 新增 fuzzy 重载,公共实现统一 ssi_boolean_public_impl
- 特性④:诚实失败复用 W2 BooleanFailureReason(FallbackLevelRejected/NotWatertight/VolumeOutOfBand),不改 boolean_diagnostics.*
- 16 例验收测试 tests/brep/test_ssi_fuzzy_patch.cpp;[CBRA] 18 行 gated 基线逐字符一致
- 性能:近重合样例 fuzzy=8.761ms vs baseline=5.826ms(1.50x < 2x)
2026-11-19 23:15:59 +08:00
hm 91e7455318 merge: integrate Wave 2 W13 exact domain KC-A15 + fallback eval + coverage baseline (ff41661c) 2026-11-19 23:11:58 +08:00
hm cc26ab36c2 merge: integrate Wave 2 W10 unified topology naming facade (76e616cd) 2026-11-19 23:11:58 +08:00
hm ff41661c25 feat(brep): W13 KC-A15 coaxial multi-feature exact difference + fallback eval + coverage baseline
- KC-A15: classify coaxial stepped cylinders / cylinder+ring / ball+cylinder
  cutters as new supported kinds, certify difference volume with a closed-form
  axial-profile union integral for axis-aligned box hosts (task-82)
- tests: 2 legacy contract cases rewritten, new ExactCoaxialToolDomain suite
  (9 cases incl. boundary membership sampling), oracle suite 74/74 green
- tools: new boolean_fallback_eval.py (CBRA logs + diagnosed JSON, non-blocking
  by default); vde_coverage_check.py gains --update-baseline/--min-line-pct
  baseline/--strict-baseline + tools/coverage/baseline.json registry
- docs: wave2 governance notes for KC-A15/fallback/coverage
2026-11-19 23:11:27 +08:00
hm 76e616cd53 feat(kcp2-tnp): unified topology naming facade (TNaming) for brep
Add a standalone facade that unifies the two existing topology naming
backends (signature-based topo_naming and u64 persistent_topology)
without changing their APIs or behavior:

- include/vde/brep/topology_naming.h, src/brep/topology_naming.cpp:
  stable TopologyKey (signature + u64 id + center), generation /
  evolution / split / selection records, history queries, cross
  boolean/split/heal inheritance, import from both backends,
  consistency checks, and lazy materialization so recording costs
  only a BrepModel snapshot.
- tests/brep/test_topology_naming_facade.cpp: 15 acceptance tests
  (boolean ID stability, split/heal inheritance, degraded history,
  cross-backend consistency, renumbering migration, perf < 5%).
- CMake registration only; brep_boolean.cpp untouched.

Evidence: 15/15 facade tests pass; ctest -R "Topo|Naming|Persistent|Tnp"
100% (83/83); recording overhead 0.74%/0.71% of boolean time (small/
medium); [CBRA] 18-line curved-boolean audit output identical to the
6518335f baseline.
2026-11-19 23:07:17 +08:00
hm 974a028790 KCP-1.0 W9: heal gap-driven two-pass stitch and conservation rollback (task-78)
- Add HealGapHistogram/HealGapMeasurement/HealGapOptions/HealGapReport and
  measure_stitch_gaps()/derive_gap_tolerance()/stitch_with_gap_analysis():
  free-edge gap analysis, gap histogram, safety-factor derived tolerance
  (default 1.6x max gap capped by bbox_diag*1e-2), second-pass retry,
  sliver opt-in, area/volume/face-count conservation rollback.
- Extend stitch_with_escalation() with opt-in gap_driven flag (default
  false keeps legacy behavior byte-identical) and fill gap stats.
- automatic_heal(): gap-stitch fallback only for already-failed raw models
  (invalid raw, and either not recovered or faces grew by fabrication);
  strict watertight/no-face-growth/conservation acceptance; env
  VDE_HEAL_GAP_STITCH=0 disables. Valid models (e.g. CBRA) are inert.
- New tests/brep/test_brep_heal_wave2.cpp (12 cases); register in CMake.
- docs/planning/wave2/heal-notes.md: OCCT public-semantics mapping,
  license conclusion (clean-room, no source copied), data and disclosures.

Evidence: bench_kcp B2 unchanged 3/19 (harness detach bug, disclosed);
corrected equivalent harness strict detach 6/15 -> 15/15; ctest heal subset
105/105; CBRA gated 18 lines byte-identical (SHA256 F4598150...).
2026-11-19 22:55:25 +08:00
hm 12f3d85248 feat(kcp): Wave 1 - quality gates, boolean failure semantics, tolerance, corpus/bench, CBRA support, blend, OSS alignment (1.0.468) 2026-11-19 22:16:21 +08:00
hm 3bb004ea2b merge: W6 blend coverage (vertex_blend API, conflict recovery, 13 tests, fixtures) 2026-11-19 21:54:52 +08:00
hm d362c036ee merge: W5 exact difference support domain (coaxial sphere-cylinder path, tool classification, 14 tests) 2026-11-19 21:54:52 +08:00
hm 35984f5470 merge: W3 tolerance system (PerFaceTolerance closures, conservation tests, edge_sig12 fix, scaled tolerances) 2026-11-19 21:54:51 +08:00
hm a63be56e69 feat(brep): W2 布尔失败语义与质量门控扩展(KC-A01/A02/A03/A04/A10/A18)
- 新增 boolean_diagnostics:结构化 BooleanFailureReason/Stage/RepairAction、
  失败定位与修复建议、遥测统计(uncovered_failures==0 证明不可信结果 100% 带码)、
  BooleanResultMetrics(拓扑/定向一致性/欧拉数/体积守恒/自交穿透/面归属)、
  brep_*_diagnosed 主入口与 exact/checked/robust 诊断适配器、
  默认关闭的预算化分级回退阶梯(KC-A01 骨架,可 opt-in 且不改变默认结果)。
- 新增 boolean_shadow_oracle:独立解析体积 vs 自算有向网格体积对比、
  结果面到输入面的归属抽样(A/B 来源与法向期望),阈值/豁免可配置。
- 新增 test_boolean_failure_semantics(12 例):空并集 checked 静默错误、
  整体反向水密体的旧 validate 漏检、robust SDF 兜底假成功、回退预算耗尽码、
  遥测覆盖与 shadow oracle 正常/异常对照。
- CMake 注册新源文件与测试;默认 API 行为逐位兼容(新入口 opt-in)。
2026-11-19 21:45:55 +08:00
hmandcp-blend 72b5f6e038 feat(brep): W6 blend real-config coverage - vertex_blend + conflict recovery diagnostics
- add vertex_blend(): vertex-keyed 3+-face spherical blend with geometric
  acceptance (valid/watertight/volume-removal), report metrics (G1/volume/
  watertightness/free-nonmanifold edges); supported on box, square-pyramid
  (4-face), tetrahedron, real STEP plate; rejects mixed tri/quad prism gap
- enhance detect_blend_conflicts with face ids, safe radii, suggestions
- add blend_network_solve_recover(): clamp - solve - geometric acceptance,
  multi-factor safety retry, honest failure reporting (strict solve unchanged)
- add tests/brep/fixtures/blend_fixtures.h (proper prism/pyramid/tetrahedron)
- add 13 tests: vertex_blend x6, recovery x5, coverage matrix + real STEP
  plate probe; 82/82 test_advanced_blend pass, ctest blend suite 559/559 pass

Co-authored-by: cp-blend
2026-11-19 21:42:52 +08:00
cp-cbra 6a586b1c09 feat(brep): W5 exact difference analytic support domain + tool classification (KC-A05/KC-A13) 2026-11-19 21:38:48 +08:00
hm 1bccc6eb18 feat(brep): KCP-1.0 W3 tolerance system (KC-B01/B02/B04/B06/B08)
KC-B01/B02: wire PerFaceTolerance into tolerant_boolean and SSI boolean core.

- tolerance.h/cpp: FaceToleranceResolution + resolve_face_tolerance_field,

  symmetric_pair_tolerance, resolve_ssi_tolerance, model_scale_of and

  scale_fixed_tolerance (crossover scale 100, small models bit-identical).

- tolerant_modeling: BooleanTolerancePlan + five-arg tolerant_boolean;

  pre/post heal, coplanarity/tangency and degenerate-edge thresholds now

  resolve per-face tolerances (widen-only, never shrink below baseline).

- ssi_boolean: SSIBooleanToleranceOptions + 3-arg overloads of ssi_boolean_*;

  compute_all_ssi propagates the per-pair tolerance to intersect_surfaces and

  records ssi_tolerance_max / ssi_tolerance_overrides in SSIBooleanResult.

KC-B04: add tests/brep/test_tolerance_conservation.cpp (43 cases) covering

resolution, symmetry, widening, fallback/clamp, plan scaling and SSI path.

KC-B06: unify_coincident_topology edge signature 12 -> 13 components

  (key[12] = qll(m2.z())) so near-duplicate edges no longer collide; semantics

  of 'merge only when identical' is unchanged (only fewer false merges).

KC-B08: scale the six fixed absolute tolerances in the boolean pipeline by

  model_scale/100 when scale > 100; scale <= 100 stays bit-identical.
2026-11-19 21:32:32 +08:00
hm ab89d75ff2 fix(curves): rename internal robust SSIOptions to RobustSSIOptions (avoid ODR clash with advanced_intersection) 2026-11-18 15:07:43 +08:00
hm f065979123 Merge branch 'feat/drawing-dxf-block-import' into feat/integration-drawing-dxf
Bring the drawing-branch DXF/DWG capability line (485505a8, v1.0.0-3379,
based on 391152439, 64 commits, 37 files +41575/-860) onto the latest VDE
engine line (cf60fed8, v1.0.0-3490).

Scope merged: DXF/DWG writers (io_dxf/dwg_writer/dwg_writer_r12), DWG
object decoding (dwg_object), MLINE/HATCH/HELIX/ACAD_TABLE, D-14
dwg_helix_bridge, DWG compare, STYLE/DIMSTYLE/LTYPE/XREF tables,
3DFACE/Dimension/underlay bridge and the matching foundation/brep tests
(tests/foundation + tests/brep + tests/drafting).

Conflict resolution: no textual conflicts (git merge clean). Only
src/CMakeLists.txt was modified on both lines and was auto-merged:
CBRA/SMLib target-side vde_curves/vde_brep entries are preserved, and the
drawing-side vde_io additions (foundation/dwg_compare.cpp,
brep/dwg_helix_bridge.cpp) are added; no side's lines were dropped.

No version-chain/CHANGELOG edits; no main-tree changes.
2026-11-18 14:28:19 +08:00
hm 485505a829 feat(foundation): DXF 写回器 OBJECTS 段 IMAGEDEF/PDFDEFINITION 底图定义输出
- write_geometry=true 时补齐 R13+ 底图整链:模型空间 / 块定义内 / 布局纸空间
  的 IMAGE、PDFUNDERLAY 实体(340/360 硬引用、放置/U-V 向量、显示尺寸、显示
  标志、亮度/对比度/淡入、裁剪组码 71/91/14/24 或 11/21,纸空间 67=1 与所属
  块记录),以及 OBJECTS 段的 IMAGEDEF / PDFDEFINITION 定义对象、
  ACAD_IMAGE_DICT / ACAD_PDFDEFINITIONS(含 ACAD_IMAGE_VARS / RASTERVARIABLES
  与 IMAGEDEF_REACTOR)命名对象字典;句柄统一分配并覆盖 $HANDSEED。
- CLASSES 段保持"整文件最多一段":按 AutoCAD 常规顺序一次性合并 IMAGE 家族、
  PDF 家族与既有 ARC_DIMENSION,避免出现两个 CLASSES 段。
- 报告字段改为真实写出/降级计数:underlays_written /
  block_underlays_written / layout_underlays_written / raster_variables_written /
  images_dropped / pdf_underlays_dropped / block_underlays_skipped /
  underlays_skipped;缺路径、几何非有限、像素尺寸缺失、裁剪非法(按缺省裁剪
  写出)、PDF 比例非法(按 1.0 写出)、块/布局非法、R12 目标等全部计数并追加
  中文 warnings,禁止静默丢。
- 默认等价:无底图 write_geometry=true 与全部 write_geometry=false 输出逐字节
  不变;DWG 方向黄金字节保持 AC1015 4601B/FNV 0x3a0bbc39ae6f9ecb、
  AC1032 7977B/FNV 0xcc12865126b095e8。
- 测试:test_dxf_write_entities 41→47(6 个新用例:默认逐字节、R2000 三作用域
  往返、CLASSES 与 ARC_DIMENSION 合并单段、R12 降级、降级计数与告警、340/360
  句柄引用闭环);既有 test 9 按"合法底图现已写出"更新降级语义。
- 验证:test_dxf_write_entities 47/47、test_dxf 43/43、test_dxf_tables 22/22、
  test_dxf_drawing 64/64、test_dwg_writer 38 + 1 skip、test_dwg_linetype 11/11,
  全 EXIT=0。

风险:未在 AutoCAD/ODA/QCAD 实机打开 AUDIT;PDFUNDERLAY 组码 280 显示标志与
页号(PDFDEFINITION 组码 2)解释、PDF 裁剪局部坐标、字典键名(IMAGE_1/PDF_1)
与外部 CAD 缺省命名差异需实机复核;R13/R14 目标按文档口径自 R13+ 写出但未实机
验证。
2026-11-18 12:39:37 +08:00
hm 15d4ae67c1 feat(foundation): DXF 写回器 OBJECTS 段多布局 LAYOUT 写出
D-14 尾项:foundation DXF 写回器此前从不写 OBJECTS 段的 LAYOUT 定义
对象(drawing.layouts 非空时只计 layouts_skipped 并把布局图元折进
模型空间)。本次补齐 R13+ 目标的纸空间多布局写出:

- TABLES 段 BLOCK_RECORD 表为每个有效布局写
  *Paper_Space / *Paper_Space<N> 记录;BLOCKS 段写同名空块定义;
- ENTITIES 段:按 entity_layout(缺省回退 DxfLayout::entity_indices)
  把布局图元写出,owner 330 指向布局块记录并带 67=1;
- OBJECTS 段:命名对象字典 + ACAD_LAYOUT 字典(每布局 3 页签名 + 350
  句柄)+ 每个 LAYOUT 对象(AcDbPlotSettings 默认组码、AcDbLayout 下列
  1 页签名/70=1/71 页签顺序/10-21 界限/12/14/15/146/13-17 UCS 等,
  最后一个 330 = 所属 *Paper_Space<N> 块记录),与 ACAD_MLINESTYLE
  字典共存时按固定顺序写出;$HANDSEED 覆盖全部新增句柄。

降级口径(均计数 + 中文 warnings,不静默丢):
- R12 及更早:不写布局对象,layouts_written=0、layouts_skipped=N、
  布局图元折模型空间并计 layout_entities_demoted;
- 页签名缺失/为 Model/ASCII 小写重名:该布局不写、图元降级;
- 纸张尺寸非有限或 <= 0:按 A4 210×297 写 LAYOUT 界限并计
  layout_paper_defaulted;
- 布局内 IMAGE/PDFUNDERLAY 底图仍不写(定义对象不在本项范围)。

默认等价:drawing.layouts 为空时输出与 HEAD 逐字节一致;黄金字节保持
(AC1015 4601B/FNV 0x3a0bbc39ae6f9ecb、AC1032 7977B/FNV
0xcc12865126b095e8);既有 MLINESTYLE-only OBJECTS 路径分配序列不变。

测试(tests/foundation/test_dxf_write_entities.cpp):
- 新增 5 用例(多布局默认路径逐字节不变、双布局往返保持 layouts/
  entity_layout/entity_indices、R2000/R2018 双目标往返、R12 降级计数与
  模型空间归属、非法页签名降级计数与警告);
- 既有 test 9 ObjectSectionsMissingCountedAndWarned 按新契约改用非法
  页签名触发降级分支(原语义「合法布局也降级」已不成立),断言更新为
  layouts_written==0 / layout_entities_written==0;
- 套件结果:test_dxf_write_entities 41/41、test_dxf 43/43、
  test_dxf_tables 22/22、test_dxf_drawing 64/64、
  test_dwg_writer 38 通过 + 1 既有 SKIPPED、test_dwg_linetype 11/11,
  全部 EXIT=0。

风险:LAYOUT 最小 AcDbPlotSettings 组码与纸空间 BLOCKS 空块定义尚未在
真实 AutoCAD/中望实机打开验证;页签名非 ASCII 在 R2000 单字节目标仅
note_non_ascii 计数告警;布局内 INSERT 的 ATTRIB/SEQEND 组合未做外部
专项验证;未加 255 布局上限检查。
2026-11-18 11:19:58 +08:00
hm 5b37716429 feat(foundation): DXF ATTRIB/ATTDEF 结构化与 DWG 桥双向属性往返
- 新增 DxfAttrib/DxfAttdef、DxfInsert::attributes、DxfBlock::attdefs:
  R13+ 写 INSERT(66=1)/ATTRIB/SEQEND 与块内 ATTDEF;R12 仍用 66=1
  属性流且不写 5/330/100 子类句柄。解析按 330 owner 挂接、66=1 待挂链
  兜底;无法关联的 ATTRIB/ATTDEF 保持旧 DxfText 摊平并计入
  attribs_orphaned/attdefs_orphaned(中文告警,不静默)。
- DWG 桥双向往返:DxfInsert::attributes→DwgWriteInsert::attributes,
  DxfBlock::attdefs→DwgWriteEntityKind::AttDef;DWG 导入侧把
  DwgAttrib/DwgAttdef 结构化回填到 INSERT/块定义,孤儿保持旧摊平。
- 新增 attribs_written/skipped、attdefs_written/skipped 等计数与中文
  降级告警;默认(无属性)文档逐字节不变,黄金字节 AC1015 4601B /
  FNV 0x3a0bbc39ae6f9ecb、AC1032 7977B / FNV 0xcc12865126b095e8 保持。
- 测试:test_dxf_write_entities 新增 7 用例(默认字节不变、R2000/R12
  组码往返、块 ATTDEF、DXF→DWG 桥往返、孤儿降级、黄金字节);适配
  test_dwg.cpp 原生往返断言(ATTRIB 已结构化挂接,实体数 15→13,
  改为 INSERT::attributes 断言,属预期语义变化)。
- 自检:test_dxf_write_entities 36/36、test_dxf 43/43、test_dxf_tables
  22/22、test_dxf_drawing 64/64、test_dwg 20 passed+2 skipped、
  test_dwg_writer 38 passed+1 skipped、test_dwg_linetype 11/11。
2026-11-18 08:12:44 +08:00
hm d8d9d4ed56 feat(foundation): DXF 写回器原生 ARC_DIMENSION 写出与读侧补齐
- io_dxf.h:DxfTablesWriteReport 新增 dimensions_written / dimensions_degraded /
  dimensions_skipped;同步段序契约(HEADER → [CLASSES] → TABLES → BLOCKS →
  ENTITIES → EOF)、图元覆盖列表与已知限制,删除「DxfDimension 不在写出覆盖内」
  陈旧句;DxfDimension 文档补充 DXF 写出行为。
- io_dxf.cpp:实现 DxfGeometryWriter::write_typed(const DxfDimension&):
  目标 R13+ 写原生 0 ARC_DIMENSION(AcDbDimension 基类段 10/11/70 低 4 位=8/71/
  1/3/42,随后 100 AcDbArcDimension 子类段 13/14/15/40/41/子类 70/71/16/17),
  仅在确有原生尺寸写出时于 HEADER 与 TABLES 之间插入一次 CLASSES 段登记
  ARC_DIMENSION / AcDbArcDimension / ObjectDBX Classes(90 4095、280 0、281 1);
  R12 及更早目标在承载块已写出时降级为该匿名块的 INSERT(dimensions_degraded),
  几何字段非有限/缺承载块计 dimensions_skipped,均追加中文 warnings;尺寸引用的
  承载匿名块随几何一起写出(含块内嵌套引用迭代到不动点),其余匿名块口径不变。
- 读侧:parse_dimension 增加 arc_type_hint,parse_entities_into 接受
  ARC_DIMENSION 类型(此前该类型被静默丢弃),弧长尺寸字段可完整往返。
- 测试:test_dxf_write_entities 23→29 用例(默认路径字节不变、原生组码与
  CLASSES 登记、import→write→import 语义字段往返、R12 降级 INSERT、非法几何/
  缺块计数、CLASSES 仅在原生尺寸写出时出现);六套件全绿:
  test_dxf_write_entities 29/29、test_dxf 43/43、test_dxf_tables 22/22、
  test_dxf_drawing 64/64、test_dwg_writer 38+1 skip、test_dwg_linetype 11/11。
- 默认路径与 DWG 黄金字节 AC1015 4601B/FNV 0x3a0bbc39ae6f9ecb、
  AC1032 7977B/FNV 0xcc12865126b095e8 不变(CLASSES 按需,无尺寸不写)。
2026-11-18 07:08:09 +08:00
hm bf2ce4bd51 feat(foundation): DWG 自定义 LTYPE 复杂元素(形/文字)写出
- 新增 DwgWriteLinetypeElement / DwgWriteLinetypeElementKind 与 DwgWriteLinetype::elements(与旧 dashes 二选一):按 LibreDWG dwg.spec 的 DWG_TABLE (LTYPE) DWG 分支编码 BD(49) → BS(75 complex_shapecode) → H(340 形样式硬指针) → RD(44) → RD(45) → BD(46) → BD(50) → BS(74 shape_flag),文字内容只写入记录末尾 strings_area(AC1015 256B 单字节 char*+NUL,AC1032 512B UTF-16LE 码元+NUL)
- 复杂元素非法或目标版本无法表达时逐元素降级为简单 dash(保留长度参与图案),新增 DwgWriteResult::linetypes_complex_skipped 与中文 warnings,不静默;elements 为空时输出与旧 dashes API 逐字节一致
- test_dwg_linetype 6 → 11 用例(简单等价、形/文字组码、降级计数、默认字节);离线构建 build/vde-r101ltype 八套件全绿:test_dwg_linetype 11/11、test_dwg_tables 69 passed+7 skip、test_dwg_writer 38 passed+1 skip、test_dwg_3dface 9/9、test_dxf_write_entities 23/23、test_dxf 43/43、test_dxf_tables 22/22、test_dxf_drawing 64/64
- 黄金字节保持:AC1015 4601B / FNV 0x3a0bbc39ae6f9ecb、AC1032 7977B / FNV 0xcc12865126b095e8;空 linetypes 仍不分配句柄
2026-11-18 06:16:30 +08:00
hm 9d2d3c604c feat(foundation/brep): DXF 写回器 MLINESTYLE OBJECTS 定义与读侧解析
- 写侧:新增 DxfMlineStyle 模型(元素 offset/color/linetype、比例/旗标/填充色/起止角);
  write_geometry=true 且 MLINE 的 340 命中定义时,在 ENTITIES 之后写出 OBJECTS 段
  (ACAD_MLINESTYLE 字典 + MLINESTYLE 定义,定义句柄复用 MLINE 的 340),$HANDSEED
  统一覆盖新句柄;无 MLINE/无命中定义时不写 OBJECTS,表段输出逐字节不变。
- 读侧:foundation/brep 解析 OBJECTS 段 MLINESTYLE(句柄索引、组码 2/70/3/62/51/52/71
  与每元素 49/62/6),MLINE 的 340 可解析时计 mlinesStyleResolved 并用定义名补全样式名;
  未命中仍计 mlinesStyleUnresolved 并输出中文告警。
- 测试:test_dxf_write_entities 19→23、test_dxf_drawing 63→64;test_dxf 43、
  test_dxf_tables 22 全绿;默认路径与黄金字节 AC1015/AC1032 保持不变。
- 边界:DWG→DXF 转换链暂无 DxfMline 分支(未接通);未被引用的定义不写出;
  未提供定义时仍按悬空计数告警。
2026-11-18 04:56:00 +08:00
hm 8b1f570801 feat(foundation/brep): DXF 原生 MLINE 写出与读回(替代顶点路径近似)
- foundation:新增 DxfMline/DxfMlineVertex/DxfMlineElement 实体类型(样式名 +
  340 句柄 + 比例/对正/标志/元素根数 + 顶点位置/方向/斜接方向 + 逐顶点逐元素
  74/41、75/42 参数),DxfGeometryWriter 写原生 MLINE(R13+;R12 skip+计数;
  空/非有限几何整条跳过,非法字段默认值降级并计数);报告新增
  mlines_written/skipped/degraded/style_dangling。
- foundation:DWG→DXF 转换的 DwgMLine 分支由「顶点路径近似」改为构造原生
  DxfMline(元素参数保留),mline_approx 统计更名为 mlines_native。
- brep:新增 MLINE 解析(版本门控、74/75 参数块状态机、72/73 一致性校验、
  340 句柄解析、块内同源、ByLayer/包围盒/图层统计接入),报告新增
  mlinesParsed/VersionSkipped/Skipped/Degraded/StyleUnresolved/mlineVertices/
  mlineVerticesDropped 并给中文降级告警。
- 测试:test_dxf_write_entities 14→19(默认路径字节不变、原生组码往返、R12
  跳过、退化几何、块内);test_dxf_drawing 59→63(组码解析、块内、版本门控、
  降级剔除)。
- 默认 write_geometry=false 表段输出逐字节不变,黄金字节 AC1015 4601B/FNV
  0x3a0bbc39ae6f9ecb、AC1032 7977B/FNV 0xcc12865126b095e8 保持。
2026-11-18 03:57:57 +08:00
hm 7825bcbdc9 feat(foundation/brep): DXF 写回器 HATCH 实体输出与整圆弧长尺寸往返
- D-14 尾项:dxf_write_drawing_* 在 write_geometry 开启时写出 HATCH
  (SOLID 与图案填充、多环边界成对组码、图案定义线、句柄进入
  $HANDSEED);缺图案线/缺字段按默认值降级并计数告警,R12 目标
  跳过计数,退化几何整体跳过;默认(write_geometry=false)路径与
  含表段导出逐字节不变。
- D-11 尾项:brep DXF 读侧对 40/41 归一后相等但 42 与 2*pi*r 自洽
  (容差 max(1e-6, 1e-6*2*pi*r))的整圆弧长尺寸按 2*pi 扫角解析,
  新增报告计数 arc_dimensions_full_circle;根仓导出侧整圆同样写
  原生 ARC_DIMENSION(41=40+2*pi、42=2*pi*r),R12 仍走 aligned
  降级。
- 测试:test_dxf_write_entities 新增 5 用例(14/14)、
  test_dxf_drawing 新增 4 用例(59/59);其余套件无回归,黄金字节
  AC1015 4601B/FNV 0x3a0bbc39ae6f9ecb、AC1032 7977B/FNV
  0xcc12865126b095e8 保持。
2026-11-18 02:47:33 +08:00
hm b0cede61bb feat(foundation): DXF 写回器 ENTITIES/BLOCKS 实体几何输出
D-14 尾项:io_dxf 写路径此前只写 TABLES 段(BLOCKS/ENTITIES 为空段,OBJECTS 不写)。

- DxfTablesWriteOptions 新增 write_geometry 门控(默认 false,默认输出逐字节不变),
  新增 dxf_write_drawing_string/file 便捷入口(内部强置 true)
- 几何写出:LINE/CIRCLE/ARC/POINT/TEXT/MTEXT/LWPOLYLINE/POLYLINE/INSERT/
  ELLIPSE/SPLINE/3DFACE/SOLID/TRACE;块定义 + BLOCK_RECORD 表(R13+)句柄一致;
  $HANDSEED 计算后移到几何写出之后,覆盖全部句柄
- 不支持图元(HATCH/DIMENSION 等)与 OBJECTS 段(底图/LAYOUT)显式计数 + 中文告警;
  R12 目标降级(无句柄/无 BLOCK_RECORD,LWPOLYLINE/MTEXT/ELLIPSE/SPLINE 跳过计数)
- 新增 tests/foundation/test_dxf_write_entities.cpp 9 用例:
  默认路径字节不变、13 类图元往返、块定义与句柄、$HANDSEED、不支持计数告警、
  R12 降级、非 ASCII 告警版本门控、文件 API、OBJECTS 缺失计数
- 验证:test_dxf_write_entities 9/9、test_dxf 43、test_dxf_tables 22、
  test_dwg_writer 38+1 skip、test_dxf_drawing 55,全 EXIT=0;
  DWG 黄金字节 AC1015 4601B/FNV 0x3a0bbc39ae6f9ecb、AC1032 7977B/FNV 0xcc12865126b095e8 保持
2026-11-18 01:53:57 +08:00
hm cf60fed8a5 chore(repo): CBRA-L4 - L-stage closeout and PR #1 final review (1.0.467)
Close out CBRA L stage (L1 1.0.464 find_seeds -68.1%, L2 1.0.465 CB4 R4 tolerance scaling, L3 1.0.466 P5f opt-in) with release governance: version 1.0.467, report 532, L-stage worktree archive (build/cleanup/l/, 12 files) and removal (worktree 1), merge checklist updated to 1.0.467, PR #1 final review (open/mergeable, base main@9bda9f16, branch ahead 71, 154 files +42436/-123). Full ctest 9121 passed 0 failed (735.38 s).
2026-11-18 01:40:27 +08:00
hm 98da71df49 feat(brep): CBRA-L3 - P5f expensive-success saturation parameterized (opt-in, 1.0.466)
Parameterize P5f dispatch controls: expensive-success cooldown (mode/threshold/duration env) and combined operand-sum budget (a+b faces admission), default off (behavior identical to 1.0.465). Sweep candidate C2 (takeover + 10s cooldown + budget 48) passes all gates: macro ctest 0.676, BENCH 0.707, matched-set CPU 0.9445 (1098 items, 0 failures). Adopted as opt-in only; 3 reservations documented (macro gain mainly from budget admission, bench/stress bucket regressions, 1.0.465 default macro regression). 18 [CBRA] rows byte-identical; CBRA fast/slow 98/98; full ctest 9121 passed 0 failed.
2026-11-18 01:22:26 +08:00