Commit Graph
874 Commits
Author SHA1 Message Date
hm f4fcd2da97 Merge remote-tracking branch 'origin/main' 2026-11-12 22:51:30 +08:00
hm 446db48523 test(measure): lock B-Rep surface area API consistency (VDE-1579)
1.0.371: 新增 MeasureTest.BodySurfaceAreaApisAgree——BrepModel::body_surface_area() 与 measure::surface_area() 在球 R2 (50.265482457, rel 8.1e-13)、圆柱 R2xh5 (87.964594299, 1.7e-11)、盒 4^3 (96, 0) 上与闭式解一致,两 API 互差 <=1e-12。同时记录装配层级 STEP 读入阻塞项(VDE-900(1)(2),上游接口未提供,见计划文档)。全量 8,735 执行/8,695 passed/0 failed/967.58s (宿主负载较高);注册 8,738;报告 429;版本 1.0.371。
2026-11-12 22:51:28 +08:00
hm a9f6b71b14 feat(brep): merge coplanar straight-boundary faces 2026-11-12 22:19:42 +08:00
hm 407a5b2b78 fix(brep): scope natural cylinder merge to boolean results 2026-11-12 21:51:48 +08:00
hm bb7cf5e46c feat(brep): merge coaxial cylinder fragments into natural periodic faces 2026-11-12 21:30:20 +08:00
hm d786835da9 test(brep): correct audit false-negative claim; audit detects sphere-sphere failures (VDE-1578)
1.0.370: 撤回 1.0.358 的『审计假阴性』结论——该结论基于误构造的粗糙多面体 make_sphere(2,3,0)。用正确解析球 A=make_sphere(2,0,0)、B=make_sphere(2,0,0,Point3D(3,0,0)) 重测(256 采样、Halton):交集 79/256=30.86% 多料、并集 18/256=7.03% 少料、差集 12/256=4.69% 多料——审计对三种错误全部有效检出(差集虽 validate=valid 静默,但审计可检出)。新增 MeasureTest.BooleanMembershipAuditDetectsSphereSphereFailures(交集 >0.2、并集 >0.03、差集 >0.02,extra/missing 计数为正)。计划文档 §47.150 同步更正。全量 8,734 执行/8,694 passed/0 failed/741.76s;注册 8,737;报告 428;版本 1.0.370。
2026-11-12 20:50:49 +08:00
hm 5be44d2ff2 test(brep): correct sphere-sphere defect matrix and add tripwire regression (VDE-1577)
1.0.369: 重要更正——此前 416/417 报告使用的 make_sphere(2.0,3,0) 实际是 su=3、sv=0->2 的粗糙多面体(非解析球),由它得到的球x球数据(交集 33.51/并集 33.51/差集空,三者 valid=1)不成立,现撤回。用正确构造 make_sphere(2,0,0) 与 make_sphere(2,0,0,Point3D(3,0,0))(均 6 面解析球、体积 33.510321638)实测:交集 1.706760078(应 2.879793266)validate=invalid(可检出);并集 79.490892696(应 64.140850011)invalid;差集 33.510321638(应 30.630528373)valid 但静默错误(偏差 9.4%)。新增 MeasureTest.SphereSphereCrossingBooleansKnownLimited 作为 tripwire:断言交集/并集 invalid、差集 valid 但体积偏离 >1%(未来修复后提醒更新契约)。计划文档 §47.148/§47.150 与报告 427 已更正。全量 8,733 执行/8,693 passed/0 failed/777.57s;注册 8,736;版本 1.0.369。
2026-11-12 20:29:51 +08:00
hm 1d26e2ea39 test(curves): lock curvature and torsion against closed forms (VDE-1576)
1.0.368: 新增 NurbsCurveTest.CurvatureAndTorsionMatchClosedForm——圆 R3 的 kappa=1/R、tau=0(误差 2.8e-16 / 0);直线 kappa=tau=0;椭圆 3x2 的 kappa=ab/(a^2 sin^2 + b^2 cos^2)^{3/2}(按几何点反推参数角,误差 2.2e-16)。曲率/挠率是光顺、桥接、刀路进给的基础量。无源码改动。全量 8,732 执行/8,692 passed/0 failed/729.48s;注册 8,735;报告 426;版本 1.0.368。附:本轮再次尝试用『球 x 半空间盒求交得到球帽、再并集得 lens』的组合方案,实测 cap 体积错误(4.50/48.72 vs 1.44)且 valid=0,方案不可行(未提交代码)。
2026-11-12 20:07:46 +08:00
hm 84f1d67b1a feat(curves): add tessellate_curve adaptive chord-tolerance sampling (VDE-1575)
1.0.367: curves 层此前没有曲线->折线采样函数。新增 tessellate_curve(curve, chord_tolerance=1e-3, max_depth=20):递归二分参数区间,判据为 5 个内点(0.2/0.4/0.6/0.8 与中点)到弦段的最大距离 <= 0.75*tol*控制点尺度;仅用参数中点会低估实际弦高约 33%(实测 1e-3 时 3.85e-3 vs tol_abs 3e-3),故加安全系数。实测圆 R3:33/121/1025 点(tol 1e-2/1e-3/1e-5),稠密 2000 点采样到折线最大距离 <=1.1*tol*scale;端点与采样点均在曲线上(<=1e-12)。新增 NurbsCurveTest.TessellateCurveRespectsChordTolerance。全量 8,731 执行/8,691 passed/0 failed/842.56s;注册 8,734;报告 425;版本 1.0.367。
2026-11-12 19:46:46 +08:00
hm 3cf4f0aa4a feat(curves): add signed/enclosed area for planar closed curves (VDE-1574)
1.0.366: curves 层此前没有面积函数。新增 NurbsCurve::signed_area(plane_normal)(Green 公式 0.5*integral((C x C')·n)dt,逐节点区间 16 点 Gauss-Legendre)与 enclosed_area(绝对值)。实测:圆 piR^2 3.8e-16、椭圆 piab 3.8e-16、矩形 4x2 = 8(0 误差)、反向圆符号翻转 -28.2743 正确。新增 NurbsCurveTest.CurveSignedAreaMatchesClosedForm。全量 8,730 执行/8,690 passed/0 failed/750.76s;注册 8,733;报告 424;版本 1.0.366。
2026-11-12 19:19:20 +08:00
hm d40e7e77b5 feat(curves): add NurbsSurface::surface_area adaptive Gauss integration (VDE-1573)
1.0.365: curves 层此前没有曲面面积函数(面积只存在于 brep analytic_surface_area(BrepModel))。新增 NurbsSurface::surface_area(tolerance=1e-9):对每个节点区间做 8x8 Gauss-Legendre 双重积分 |Su x Sv|,区间内按 1->2->4->8->16 子网格自适应加密至相对变化 <= tolerance。实测:球 4piR^2 2.8e-15、环 4pi^2Rr 4.3e-16、圆柱侧 2piRh 1.0e-15、平面 4x4 7.8e-16。新增 NurbsSurfaceTest.SurfaceAreaMatchesClosedForm。全量 8,729 执行/8,689 passed/0 failed/711.39s;注册 8,732;报告 423;版本 1.0.365。
2026-11-12 18:54:10 +08:00
hm 4d60ae6e53 feat(curves): add is_planar/is_closed/is_linear curve predicates (VDE-1572)
1.0.364: 曲线库此前没有 is_planar/is_closed/is_linear 公共谓词。新增:is_planar(tol=1e-9) 控制点共面(共线视为平面,有理曲线由凸包性质成立);is_closed(tol) 端点重合;is_linear(tol) 控制点共线。容差按控制点尺度缩放。实测:圆/椭圆 平面 true+闭合 true+直线 false;直线段 直线 true+平面 true+闭合 false;螺旋线 全 false。新增 NurbsCurveTest.CurvePredicates。全量 8,728 执行/8,688 passed/0 failed/830.59s;注册 8,731;报告 422;版本 1.0.364。
2026-11-12 18:29:26 +08:00
hm 9da1818c34 feat(curves): add NurbsSurface::is_planar control-point coplanarity test (VDE-1571)
1.0.363: 曲面库此前没有 is_planar 公共判定(SSI 平面分派、网格化、布尔分类各自手写控制点共面检查)。新增 NurbsSurface::is_planar(double tol = 1e-9):取最远点/离直线最远点构造平面,检查全部控制点到平面距离 <= tol*包围盒对角线;空/退化/共线返回 false。实例:解析平面 true;球/柱/环 false;共面控制点的双三次曲面(z=0.2x+0.1y) true;空曲面 false。新增 NurbsSurfaceTest.IsPlanarDetection。全量 8,727 执行/8,687 passed/0 failed/725.28s;注册 8,730;报告 421;版本 1.0.363。
2026-11-12 18:03:35 +08:00
hm c2bb6e135a feat(curves): add equal-arc-length division and sampling APIs (VDE-1570)
1.0.362: 曲线库此前只有总长与弧长->参数,没有等弧长分割 API。新增 divide_curve_equal_arc_length(curve, segments) 返回 segments+1 个参数(含两端)与 curve_equal_arc_points 返回对应 3D 点,基于已验证的 curve_param_at_length(1.0.361 往返 7.1e-15)。实测:圆 R3/12 段、椭圆 3x2/16 段每段弧长与 L/n 偏差 <=1e-12;圆采样点半径 <=1e-12;segments=1 返回两端点、segments=0 返回空。新增 CurvesExactnessTest.EqualArcLengthDivisionIsAccurate。全量 8,726 执行/8,686 passed/0 failed/886.61s;注册 8,729;报告 420;版本 1.0.362。
2026-11-12 17:38:38 +08:00
hm 607eda34f4 test(curves): lock arc-length inverse parameter round-trip (VDE-1569)
1.0.361: 新增 CurvesExactnessTest.ParamAtLengthRoundTripIsExact——圆 R=3 上 11 个目标弧长(0..6pi),curve_param_at_length 反求参数后再用 curve_arc_length(t0,t1) 回算:往返误差 <=7.1e-15(容差 1e-12),总长 6pi 精确到 1e-13。该 API 是等弧长布点/扫掠参数映射的基础。无源码改动。全量 8,725 执行/8,685 passed/0 failed/749.63s;注册 8,728;报告 419;版本 1.0.361。附:本轮再次尝试 cap 面片(不复用 extract_sub_surface、直接构造 [0,1]^2 有理二次球面片),探测程序在退化极点面处崩溃,原型已回退未提交。
2026-11-12 17:13:18 +08:00
hm 7f5b7d8599 test(curves): lock torus closest-point exactness against closed form (VDE-1568)
1.0.360: 新增 NurbsSurfaceTest.ClosestPointTorusIsExact——环面 R=5、r=1 的 24 个空间点(rho in [3,5]、z in [0.5,1.3])与解析最近点(主圆最近点 + 径向单位向量)对比,位置偏差 <=2.2e-15(容差 1e-12)。至此球(1.99e-15)/柱(1.18e-15)/环(2.2e-15) 三类解析曲面的 closest_point 精度全部纳入契约(1.0.354 的脚踏点牛顿抛光在环面路径上同样有效)。无源码改动。全量 8,724 执行/8,684 passed/0 failed/745.71s;注册 8,727;报告 418;版本 1.0.360。
2026-11-12 16:52:19 +08:00
hm 657b09e7d3 docs(reference): record spherical-cap patch prototype and trim-domain finding (VDE-1567)
1.0.359(仅文档,原型已回退): 本轮实现 make_sphere_cap_patch 原型并在探测程序中验证——顶点全部在球面上(径向偏差 2.2e-16),48x16 -> 768 面/1536 边/769 点;但 analytic_surface_area 面积仅为解析值 0.46~0.54 倍(pd=0.5: 9.598 vs 18.850;pd=-0.5: 16.874 vs 31.416;pd=0: 13.184 vs 25.133),判定为裁剪域映射问题:extract_sub_surface 返回的子曲面保留原始 knot 参数范围,而 TrimmedSurface::from_rect 参数域映射不匹配。因未验证通过,原型已 git checkout 回退,不进入代码。下一轮修正方向:按子曲面实际域构造 from_rect 或每面新建 [0,1]^2 球面片,验证面积=2πR(R-pd) 后接入球x球布尔两片缝合。全量 8,723 执行/8,683 passed/0 failed/841.15s;注册 8,726;报告 417;版本 1.0.359。
2026-11-12 16:17:12 +08:00
hm 6d9f4e1dd7 docs(reference): record crossing sphere-sphere silent failure and audit false negative (VDE-1566)
1.0.358(仅文档,无代码变更): 记录 crossing 球x球布尔的静默失败——sphere(R2,0)∩sphere(R2,3) 体积 33.510322(应 2.879793)、并集 33.510322(应 64.140850)、差集空(应 30.630528),三者 valid=1 且 watertight=1,质量门无法发现。同时记录 audit_boolean_membership(256 采样、Halton)对该错误结果 0 误判的假阴性,根因排查中(球体分类路径需改用精确曲面包含判定)。修复方向:spherical cap 曲面片(带单个圆形边界)+ 两片缝合可实现 lens/union/difference。已写入计划文档 §47.148/§47.150。全量 8,723 执行/8,683 passed/0 failed/827.65s;注册 8,726;报告 416;版本 1.0.358。
2026-11-12 15:31:29 +08:00
hm e641eff78b fix(brep): Halton sampling for boolean membership audit (VDE-1565)
1.0.357: audit_boolean_membership 旧采样用 3 条相互关联的 Kronecker 序列(0.7549/0.5698/0.3183),点集高度结构化;改为 Halton(2,3,5) 低差异序列,分层覆盖更均匀且可复现。新增球体场景检出回归:球 R2 完全在 10x10x10 盒内时,正确交集结果(=球) 审计 0 误判;用空体冒充结果检出少料 8/256=3.12%。顺带记录本轮探针发现的静默失败:crossing 球x球布尔 sphere(R2,0)∩sphere(R2,3) 体积 33.51(应 2.88)、并集 33.51(应 64.14)、差集空(应 30.63),三者 valid=1/watertight=1,属闭合曲-曲面片未实现(与 cyl-sphere 同源),已列入计划 §47.148。全量 8,723 执行/8,683 passed/0 failed/732.75s;注册 8,726;报告 415;版本 1.0.357。
2026-11-12 15:09:23 +08:00
hm 49ec71b92e test(curves): lock arc length and self-intersection accuracy (VDE-1564)
1.0.356: 新增 2 个回归——① ArcLengthIsAccurate:curve_arc_length(circle R=3) 相对误差 3.8e-16;ellipse a=3,b=2 实测 15.865439589291,与闭式周长 15.8654395892901 一致到 2.4e-14(dense Simpson 交叉验证)。② SelfIntersectionDetection:椭圆(无自交)返回 0;8 字闭合样条(12 点 lemniscate 插值)返回 1 个自交,参数对 (0.25,0.75),点残差 1.7e-15,位置在原点 <=1e-6。无源码改动。全量 8,722 执行/8,682 passed/0 failed/729.49s;注册 8,725;报告 414;版本 1.0.356。
2026-11-12 14:44:32 +08:00
hm 17734ed5ec fix(curves): merge near-duplicate hits from tangent curve intersections (VDE-1563)
1.0.355: 外切两圆 intersect_curves 修复前返回 5 个交点——其中 3 个位置偏差 2.2e-5~3.6e-5,但曲线间距仅 2.5e-10~6.3e-10(在 tolerance 内),属切触区 Gauss-Newton 近似解重复。修复:intersect_curves 结果按 3D 距离合并近重交点(合并半径 sqrt(tolerance)*尺度,保留残差最小者);真实横穿交点间距远大于该半径不受影响。实测:外切两圆 5→1 个精确切点 (2,0,0) 误差 0;横穿两圆仍 2 个(残差 2.0e-12/1.2e-11)。新增 CurvesExactnessTest.IntersectCurvesMergesTangencyDuplicates;test_curve_tools 45/45、test_nurbs_curve 70/70 PASS。全量 8,720 执行/8,680 passed/0 failed/750.22s;注册 8,723;报告 413;版本 1.0.355。
2026-11-12 14:22:55 +08:00
hm 5f1febdfcc fix(curves): Newton foot-point polish for surface closest_point (VDE-1562)
1.0.354: NurbsSurface::closest_point 旧实现直接返回 project_point_on_surface 的网格解——距离误差已 ~1e-15,但最近点位置误差实测 3.0e-8(球)/2.2e-8(柱)。新增脚踏点牛顿法:解 g=((S-p)·Su,(S-p)·Sv)=0,Hessian 含二阶导 S_uu/S_uv/S_vv,15 次迭代、步长限制 0.25 跨度并钳制参数域;未收敛时回退投影解。实测位置误差降至 1.99e-15(球)/1.18e-15(柱),distance_to 数值保持 ~1e-15。新增 NurbsSurfaceTest.ClosestPointIsExactAfterPolish(≤1e-12);test_nurbs 25/25 PASS。全量 8,719 执行/8,679 passed/0 failed/880.52s;注册 8,722;报告 412;版本 1.0.354。
2026-11-12 14:00:35 +08:00
hm 2e2fc3346b test(measure): tighten primitive area and inertia regressions (VDE-1561)
1.0.353: 承接 1.0.352(体积收紧到 1e-9),本轮收紧表面积与惯性矩。实测表面积相对误差:球 R3 5.3e-15、柱 R2xh5 1.7e-11、精确环 R5xr1 3.4e-12;惯性矩:球 1.6e-13、柱 Ixx 3.8e-9/Izz 1.2e-8、环 2.8e-9(既有 MassPropertiesTest 仅 2e-3)。新增 MeasureTest.PrimitiveAreasAndInertiasMatchClosedFormTight:球面积 1e-12/惯性 1e-11、其余面积 1e-9、惯性 1e-7。全量 8,718 执行/8,678 passed/0 failed/783.33s;注册 8,721;报告 411;版本 1.0.353。
2026-11-12 13:37:30 +08:00
hm 9ff6c48cd9 test(measure): tighten analytic primitive volume regression to 1e-9 (VDE-1560)
1.0.352: 既有 MassPropertiesTest 对球/圆柱/精确环体积只用 1e-3 容差。本轮实测 body_volume 相对误差:球 R3 9.8e-15、圆柱 R2xh5 1.6e-11、精确环 R5xr1 1.25e-11、锥 r2xh4 2.4e-13、圆台 2->1xh4 9.6e-12。新增 MeasureTest.PrimitiveVolumesMatchClosedFormTight:球按 1e-12、其余按 1e-9 锁定。全量 8,717 执行/8,677 passed/0 failed/728.22s;注册 8,720;报告 410;版本 1.0.352。
2026-11-12 13:15:56 +08:00
hm d9337d0629 test(curves): lock offset curve and surface precision (VDE-1559)
1.0.351: 新增偏置精确性回归——① offset_curve(circle R=2, d=0.5) 走解析路径,半径 2.5、128 采样偏差 4.4e-16;② offset_curve(ellipse 3x2, d=+0.7/-0.4) 走自适应拟合(deg 7、40/72 CP),以 curve_closest_point 度量『到原曲线距离-d』,200 采样最大 3.4e-7/3.7e-7(<= tolerance 1e-6,验证 VDE-1482 修复);③ offset_surface(sphere R=2, d=0.5) 半径偏差 8.9e-16。新增 2 个用例。全量 8,716 执行:8,714 PASS + 2 个环境相关容器探测用例(ExternalContainerTest.*)并行下失败、整组单测复跑 5/5 PASS(0.08-0.24s);注册 8,719;报告 409;版本 1.0.351。
2026-11-12 12:53:33 +08:00
hm efe865c1f1 feat(ssi): closed-form plane-cone intersection with conic branch handling (VDE-1558)
1.0.350: 平面×圆锥闭式交线——锥面 p(theta,t)=o+t z+(r1+s t)(cos theta e1+sin theta e2),s=(r2-r1)/h;平面 n.(p-p0)=0 给出 t(theta)=-[n.(o-p0)+r1 B]/(n.z+s B),B=n.e1 cos theta+n.e2 sin theta。椭圆/抛物线/双曲线统一处理:分母≈0 为渐近方向跳过、r(t)<0 无实点、按种子 AABB 过滤;全有效→闭合环,否则按无效点切分为开段。实测:z=1 截 45° 锥 → 闭合圆半径 1(偏差 1.1e-16);z=x+1 → 抛物线 y^2=2x+1(375 点,|F1|=2.2e-16、|F2|=4.4e-16,开);z=-5 → 无交。新增 3 个用例;test_analytic_ssi 56/56 PASS。全量 8,714 执行:8,713 PASS + 1 个随机/负载敏感 fuzz 用例(SSIBooleanUnionTest.FuzzExactTrimAllOperations)并行下失败、单测复跑 PASS(0.89s);注册 8,717;报告 408;版本 1.0.350。
2026-11-12 12:32:02 +08:00
hm 159eab23de feat(ssi): closed-form plane-sphere and plane-cylinder intersection (VDE-1557)
1.0.349: ① 平面×球闭式圆——圆心=球心在平面上的投影、半径 sqrt(r^2-d^2),|d|>r 无交。② 平面×圆柱闭式椭圆——P(theta)=c+R(cos theta e1 + sin theta e2)+t(theta) z,t(theta)=-[n.(c-p0)+R(A cos theta+B sin theta)]/(n.z);n.z≈0 时回退数值追踪。③ 解析结果按种子区域 AABB 过滤:交线完全在区域外时返回空,保持 NoIntersection_Empty 语义。实测:平面 z=2 截 R=5 球 → 闭合圆半径 sqrt(21) 偏差 8.9e-16;斜截 R=2 柱 → 闭合椭圆 |F1|=1.1e-16、|F2|=2.2e-16。新增 2 个用例;test_analytic_ssi 53/53 PASS。全量 8,711 执行/8,671 passed/0 failed/767.57s;注册 8,714;报告 407;版本 1.0.349。
2026-11-12 12:10:03 +08:00
hm a90a7555a1 feat(ssi): closed-form perpendicular equal-radius cylinder intersection (VDE-1556)
1.0.348: 等半径 R、轴互相垂直且相交的两圆柱交线为两条闭式椭圆——轴 u=z1、v=z2 正交,交点 O,P±(phi)=O ± R cos phi·u + R cos phi·v + R sin phi·w(w=u×v);柱面1 到柱面2 轴距离条件导出 t=±R cos phi。新增 cylinder_cylinder_perp_equal 并在 trace_intersection 分派;半径不等、轴不垂直或异面时回退数值追踪。实测:同点轴例 2 条闭合环(514 点)、|F1|=|F2|=2.2e-16;轴错位(交点 (0,0,1))2 条、残差 2.2e-16/4.4e-16。新增 2 个用例;test_analytic_ssi 51/51 PASS。全量 8,709 执行:8,708 PASS + 1 个时序敏感性能用例(VDE1235FilletEdgesPerf.MultiEdgeFilletQualityAndPerf,-j8 下 44.86s 超时、单测复跑 PASS 17.92s);注册 8,712;报告 406;版本 1.0.348。
2026-11-12 11:47:57 +08:00
hm c4139fd9bc feat(ssi): closed-form cylinder-sphere intersection in analytic SSI (VDE-1555)
1.0.347: ssi::trace_intersection 对(圆柱,球)分派闭式解——柱面参数 θ 上 S(θ)=r²−[R²+d²−2R(cx cosθ+cy sinθ)]、z=tc±√S;S>0 区间由 amp·cos(θ−φ)>=target 给出(amp=R·hypot(cx,cy),target=(R²+d²−r²)/2):|target/amp|<1 单条闭合花生环、<=-1 两个分离圆、>=1 无交、amp≈0(共轴)退化为 S 常数的两个圆/切触圆/无交。数值追踪此前对该例输出 20 段开折线。实测:偏轴例 1 条闭合环(513 点)、|F1|=4.4e-16、|F2|=6.7e-16;共轴例 2 个圆 z=±√3、半径偏差 1.1e-16;无交例 0。新增 3 个用例;test_analytic_ssi 49/49 PASS。全量 8,706 执行/8,665 passed/0 failed/731.70s;注册 8,710;报告 405;版本 1.0.347。
2026-11-12 11:25:31 +08:00
hm 5e94e67e2a fix(curves): unify planar pre-dispatch for closed surfaces and skip refine for exact planar cuts (VDE-1554)
1.0.346: ① 移除『仅柱状』闸门,整球也参与平面前置分派——plane(±4,z=1)×sphere(R=2) 由 62 段弧变为 1 条曲线(z 与半径²偏差 <=1e-16)。② 修复两处参数缺陷:intersect_plane_surface 返回曲线的 params 属于另一曲面,先清空再按 A/B 重新投影;闭合环的 p-curve 由 fit_nurbs_curve(开放拟合,uv 误差 1e-3 -> 3D 3e-2)改为插值精确过点。③ 新增 IntersectionCurve::exact_planar_cut 标志,intersect_surfaces_refined 对其跳过 4D 精化(此前精化在闭合接缝把点移到离球面 0.58~0.72);赤道退化例 SurfaceIntersection.PlaneSphereRefinedPcurve 恢复 PASS,新增 PlaneSphere_RefinedSingleCurve。测试:SSI 29/29、SSI extra 219/219、Measure 球面×平面 5/5。全量 8,703 执行/8,662 passed/0 failed/777.58s;注册 8,707;报告 404;版本 1.0.346。
2026-11-12 11:02:26 +08:00
hm e4ea4cf6f1 fix(curves): pre-dispatch planar intersection for full cylinders and unwrap closed-u params (VDE-1553)
1.0.345: ① fill_params_by_projection 在 u 闭合曲面(整柱/整球/整环基底)上会给出跨 0/1 跳变的参数序列,现按相邻差 > span/2 做 ±span 展开,保证 p-curve/refine 连续。② 平面×整柱前置分派:若非平面侧是整闭合曲面且 v 向为直线(柱状判定 maxdev<=1e-9*L),直接 intersect_plane_surface + 平面片矩形过滤 + 离面点防御;实测 plane×cylinder(R=2) 得到 1 条曲线、半径偏差 4.4e-16(原通用路径碎片化/丢线)。③ 整球不启用前置分派:intersect_surfaces_refined 的 p-curve 精化在闭合接缝处仍不稳定(实测 refined 后离面 0.58~0.72),已记录为限制。SSI extra 218/218、SSI refined 关键用例、Measure 球面×平面精确用例全部 PASS。全量 8,702 执行/8,661 passed/0 failed/663.07s;注册 8,706;报告 403;版本 1.0.345。
2026-11-12 10:39:13 +08:00
hm 9c5a7aa32d test(ssi): lock plane-surface cut precision and harden planar fallback (VDE-1552)
1.0.344: 新增 2 个 intersect_plane_surface 精度回归——整圆柱(R=2, z=1/-2) 半径与平面偏差 <=2.2e-16;整球(R=2, z=1/0.5) 半径偏差 <=4.4e-12、z 偏差 <=1e-9(grid_res=32)。平面兜底(1.0.343)增加离面点防御:等值线追踪在退化情形(平面恰落在参数网格线,如球面赤道被 z=0 平面截)会产生离面点,此时整条丢弃并交回通用路径。过程记录:尝试过『平面×整闭合曲面』前置分派,使 plane×sphere 从 62 段弧变为 1 条(半径偏差 6.7e-16),但 intersect_surfaces_refined 的 p-curve 精化对整闭合曲面的参数接缝处理不当(refined 后点离球面 0.97~1.92)→ 前置分派已回退,仅保留兜底+防御。全量 8,702 执行/8,661 passed/0 failed/751.45s;注册 8,706;报告 402;版本 1.0.344。
2026-11-12 10:16:42 +08:00
hm e8b391679c fix(curves): planar fallback for generic surface-surface intersection (VDE-1550)
1.0.343: 通用 intersect_surfaces 在平面片×闭合柱面等情形会返回空(实测 plane(±3,z=1)×cylinder(R=2,z in [-5,5]) 修复前 0 条曲线)。修复为兜底:仅当通用路径无结果时,检测真平面(控制点共面 + 局部矩形范围),调用 intersect_plane_surface 等值线追踪,并用平面片局部基矩形过滤追踪点(project_point_on_surface 会把越界参数钳制回域,不能用于过滤;无限平面会跨越到远处实体)。实测该用例→1 条曲线、半径²偏差 1.8e-15、z 偏差 6.7e-16,两参数顺序一致;远处平面片×圆锥仍返回空。过程记录:最初采用『前置分派』,导致 8 个既有用例回归(布尔精确切分依赖通用路径的曲线/参数形态),改为仅兜底后全部恢复;SSI extra 套件 216/216 PASS。新增 PlaneCylinder_GenericDispatch / PlaneSphere_GenericDispatch 两个回归用例。全量 8,700 执行/8,659 passed/0 failed/715.40s;注册 8,704;报告 401;版本 1.0.343。
2026-11-12 09:31:38 +08:00
hm fecb5a932b test(ssi): lock curved-curved cylinder-sphere intersection residual (VDE-1549)
1.0.342: 新增 AnalyticSsiTest.CylinderSphere_CurvedCurvedResiduals——非共轴圆柱(R=3,轴 Z)与球(r=2,心 (2,0,0))的曲-曲交线,解析式 z=tc±sqrt(S(theta)),S=4-(9+4-12cos theta)。tol=1e-9、step=0.01 追踪 606 点:max|F_cyl|=2.4e-10、max|F_sph|=2.0e-10、z 偏差 1.2e-7。结论:SSI 追踪的几何精度已达 1e-9 级,曲-曲挖孔失败属拓扑分段/裁剪域构造问题而非精度。全量 8,698 执行/8,657 passed/0 failed/726.72s;注册 8,702;报告 400;版本 1.0.342。
2026-11-12 08:35:00 +08:00
hm 20cf0a3079 test(curves): lock connect_curve G2 and exact sphere curvature (VDE-1548)
1.0.341: 新增 CurvesExactnessTest.ConnectCurveContinuityIsExact——曲线输入(c1=90 度圆弧 R=2,c2=120~210 度圆弧 R=3)时 connect_curve 的 G0/G1/G2 端点间隙与切向误差均为 0,G2 二阶导误差 3.2e-15/7.5e-15。新增 SphereCurvatureIsExact——curvature_map(make_sphere_surface(2)) 的 K=0.25、|H|=0.5,实测偏差 <=3.4e-16(解析导数路径)。至此桥接与曲率分析这两个曲面质量关键输入纳入回归。全量 8,697 执行/8,656 passed/0 failed/638.73s;注册 8,701;报告 399;版本 1.0.341。
2026-11-12 08:14:07 +08:00
hm 3f263ae892 test(curves): lock revolve/extrude exactness (VDE-1547)
1.0.340: 新增 CurvesExactnessTest.RevolveAndExtrudeGeneratorsAreExact——revolve_surface(直线 x=2, 180 度) 生成圆柱面 R=2、z 属于 [0,10],半径偏差 6.7e-16;extrude_curve(90 度圆弧 R=3, 沿 Z 拉伸 10) 生成圆柱片,半径偏差 1.3e-15、z 范围精确。同时完成有理 3x3 网格曲面研究:net_surface(3 纬线圆, 3 经线半圆) 返回 3x3 控制点(交点即控制点构造),对球面网络径向偏差 15.09,说明 >2x2 有理网络尚未实现精确插值,需要在齐次空间做网格插值/求解(已列后续工作)。全量 8,695 执行/8,654 passed/0 failed/693.71s;注册 8,699;报告 398;版本 1.0.340。
2026-11-12 07:52:56 +08:00
hm 52062d16ed test(brep): lock multi-loop curved-face trimming (VDE-1546)
1.0.339: 新增 MeasureTest.CurvedFaceWithHoleLoopTrimsCorrectly——整圆柱基底上取 u 属于 [0,0.5] 的半侧片,加 UV 小圆内孔环(仅 B-Rep 环、不挂 TrimmedSurface),body_volume 实测 93.3639,解析值 94.2478-0.9475=93.3003(0.07% 偏差来自自适应积分分辨率),锁定内孔环参与裁剪域重建。隔离探针查明:手工给带孔面挂 TrimmedSurface 会被体积积分错误解释(94.25 变 121.54),B-Rep 环路径正确、单外环 TS 正常。据此把曲面挖孔的合并侧面改为仅用 B-Rep 环、坑壁面用单外环 TS,但装配后体积恒为 537.70(合并侧面按整圈 188.5 全侧面计入),体积自检失败,根因未定位;为避免水密但体积错误的静默结果,实现再次全部回退。全量 8,694 执行/8,653 passed/0 failed/658.19s;注册 8,698;报告 397;版本 1.0.339。
2026-11-12 07:31:20 +08:00
hm fc683def70 test(curves): lock curve-curve intersection precision (VDE-1544)
1.0.338: 新增 CurvesExactnessTest.CurveCurveIntersectionIsPrecise——圆×圆(圆心距 3、R=2)解析交点 (1.5, ±sqrt(1.75)),实测参数误差 6e-13;直线×圆(y=1)解析 x=±sqrt(3),实测 ≤2.4e-8(默认容差 1e-6 内)。同时完成圆柱×侧向穿出球的曲-曲挖孔研究:交线闭式解 S(theta)=r^2-[R^2+d^2-2R(cx cos theta+cy sin theta)]、z=tc±sqrt(S),alpha=41.4 度;实现「整侧片替换(规范圆柱大面+内环)+ 整球坑壁」可装配出 6 面水密候选,但自建 TrimmedSurface 的 pcurve 裁剪域未按预期生效(体积 310.92 vs 254.47,rel 22.2%)→ 为避免水密但体积错误的静默结果,实现已全部回退,公式与方案入档。全量 8,693 执行/8,652 passed/0 failed/699.40s;注册 8,697;报告 396;版本 1.0.338。
2026-11-12 07:05:23 +08:00
hm 6c2b352d45 feat(brep): export boolean membership audit as JSON (VDE-1542)
1.0.337: BooleanMembershipAudit::to_json()(samples/mismatches/extra_material/missing_material/boundary_skipped/mismatch_fraction/worst_point),供 CI 与质量看板直接采集;既有审计用例增加 JSON 字段断言。同时完成圆柱×侧向穿出球的曲-曲挖孔研究:圆柱×球交线有闭式解 S(theta)=r^2-[R^2+d^2-2R(cx cos theta+cy sin theta)]、z=tc±sqrt(S),实测 alpha=41.4 度、两支在 S=0 处闭合(320 点解析环,无需数值追踪);但 A 侧面按 0/90/180/270 度分成 4 个 90 度片,环跨两片,需要双内环 + theta=0 接缝边三段剖分,临时实现已回退(避免水密但体积错误的静默结果)。全量 8,692 执行/8,651 passed/0 failed/796.59s;注册 8,696;报告 395;版本 1.0.337。
2026-11-12 06:37:29 +08:00
hm 7888c04582 fix(curves): remove rational knots via homogeneous least squares (VDE-1540)
1.0.336: remove_knot now fits rational curves in homogeneous space; circle insert/remove 9-10-9 with 7.03e-13 geometric deviation; non-rational path unchanged; new regression test; full suite 8,692 executed 0 failed; report 394.
2026-11-12 06:07:19 +08:00
hm b3c34e67ca feat(brep): add boolean membership consistency audit (VDE-1539)
质量门控 evaluate_boolean_quality 只能发现拓扑问题(开放壳/悬挂边/非流形),无法发现「水密但面片归属错误」的静默错误。新增 audit_boolean_membership(a,b,op,result,samples=128,on_tol=1e-6):在 A∪B 包围盒内取确定性抖动采样点,用 classify_point_mesh 判断点在 A/B/结果内或外(落在任一边界容差内则跳过),按 BooleanAuditOp 的集合语义核对结果成员关系,返回失配率、多料/少料计数、首个失配点。新增 BooleanAuditOp / BooleanMembershipAudit 类型。实测:box−sphere(球心 z=4.5) 的差/交/并三种操作均 0/128 失配;用空体冒充差集结果 → 失配 >0.5(missing_material>0,工具可检出);cyl−sphere(side bite) 差集 6/128(4 多料 + 2 少料)。并借此澄清圆环面布尔:make_torus(4,3,32,16) 是分段(faceted)体,自身体积 688.046599(解析 710.611517,rel 3.18e-2),因此此前以解析环面体积为期望得出的「torus 布尔体积错误 80%」结论不成立;成员审计显示 box∪/box−torus 均 0/128 失配。新增 MeasureTest.BooleanMembershipAuditMatchesExactResults(精确结果 <=1% 失配、空体冒充 >50% 失配)。注册 8,695;全量 8,691 执行/8,650 passed/0 failed/773.32s;报告 393;版本 1.0.335。
2026-11-12 05:43:23 +08:00
hm 5db15fd3a7 test(curves): lock analytic generator exactness with regression tests (VDE-1538)
本轮审计用探针验证了 6 类解析生成器/构造器的精确性:pipe 直母线→圆柱面(半径 4.4e-16、z 范围精确)、pipe 圆弧母线→环面(4.8e-15)、variable_pipe 沿直线→线性圆台(4.4e-16)、net_surface 3x3 抛物面网络 z=x^2+y^2(6.7e-16)、loft 三圆截面 v=0/1/0.5 均 0/0/1.0e-15;另 ellipse 隐式 4.4e-16、arc_3point 半径 4.4e-16、rectangle 边界 0、trim/untrim 4.4e-16、reverse^2 0。以上此前无回归测试守护,补齐 3 个 CurvesExactnessTest 用例(ExactAnalyticSweepGenerators / ExactNetSurfaceOnParaboloid / LoftSectionInterpolationIsExact,阈值均 1e-12),并在 test_curve_tools.cpp 增加 generative_surfaces.h / nurbs_operations.h 引用。仅测试文件变更,无行为变化。注册 8,694;全量 8,690 执行/8,649 passed/0 failed/644.23s;报告 392;版本 1.0.334。
2026-11-12 05:18:22 +08:00
hm ca136fd077 perf(curves): interpolate high-turn helices at the 1024-sample cap (VDE-1537)
NurbsCurve::helix 的插值采样上限为 1024;此前当 ceil(turns*48)+1 > 1024(turns > 21)时直接退回 72 极点/圈的经典逼近,实测 turns=22/30/50 的半径偏差为 1.573e-3/1.539e-3/1.275e-3,CP 数 1585/2161/3601。修复:只要每圈仍有 >=16 个采样点(turns <= 64)就走插值,采样数取 min(desired,1024)。实测 turns=22/30/50 半径偏差降至 8.464e-6/2.920e-5/2.231e-4(分别提升 186x/53x/5.7x),CP 数固定 1024,端点 z 仍精确;turns>64 继续退回 72 极点经典逼近。代价是 turns 22-64 构造需解 1024 阶插值系统(探针 4 条曲线共 1.58 s,单条约 0.4 s)。同步更新 nurbs_curve.h 精度说明。新增 NurbsCurveFactoryTest.Helix_HighTurnAccuracy(turns=30,6000 采样,|r-R|<=1e-4);既有 5 个 Helix 用例回归通过。注册 8,691;全量 8,687 执行/8,646 passed/0 failed/691.84s;报告 391;版本 1.0.333。过程记录:本轮曾把等参切分推广到圆环面并支持平面×圆环双圆裁剪,虽使 torus 布尔水密但体积错误(不可接受),已全部回退。
2026-11-12 04:56:05 +08:00
hm 465e060115 fix(curves): cap LS-fit control points at 3/4 sample count to stop near-interpolation oscillation (VDE-1535)
fit_nurbs_curve 从 8 个控制点按 1.5 倍迭代增长,直到样本残差 <= tolerance 或 CP 数达到采样点数。实测 120 点螺旋线(5 圈)输入时 CP 数收敛到 120(=采样数):正规方程 A^T A 接近方阵、条件数平方级恶化,样本残差仅 8.0e-7(通过容差)但样本之间曲线剧烈振荡——几何半径偏差 0.2449(应 <=1e-4);同一现象导致 helix_curve(samples=24) 半径偏差 2.449e-1。修复:CP 数增长上限取采样点数的 3/4(保持超定最小二乘良态)。实测:120 点拟合半径偏差 0.2449 → 5.019e-5(样本残差 4.1e-6);helix_curve 各档:samples=12 9.9e-3→1.016e-3、samples=24 2.449e-1→5.014e-5、samples=50 1.638e-6→2.398e-6、samples=100 9.21e-7 不变。同步更新 curve_tools.h 文档说明上限与病态原因。新增 CurveToolsTest.FitNurbsCurveDoesNotOscillateBetweenSamples(拟合几何偏差 <=1e-4 且 helix_curve(samples=24) <=1e-4)。注册 8,690;全量 8,686 执行/8,645 passed/0 failed/680.47s;报告 390;版本 1.0.332。
2026-11-12 04:27:06 +08:00
hm a03a979bb9 feat(curves): exact rational-quadratic obround slot profile (VDE-1534)
NurbsCurve::slot 旧实现为「18 点 degree-1 多边形」逼近两半圆(每半圆 8 段),文档标注 1 阶封闭 NURBS 近似;实测 L=10/W=4 时轮廓相对精确腰形孔的最大偏差 1.346e-1(半径 2 的 6.7%)。腰形孔由两段直线 + 四个 90 度圆弧组成,相邻段在切点处 G1 连续,因此可用单条 degree-2 有理 B 样条精确表示:13 个控制点(圆弧中间点权重 sqrt(2)/2,端点/直线点权重 1)、6 段(内节点重数 2、端点重数 3)。实测边界偏差 1.332e-15(本质精确),首尾重合封闭,degree=2;length<width 时退化为精确整圆(NurbsCurve::circle)。同步更新 nurbs_curve.h 工厂方法文档。新增 NurbsCurveFactoryTest.Slot_ExactObroundBoundary(720 采样,偏差 ≤1e-12,首尾重合 ≤1e-12);既有 NurbsCurveFactoryTest.Slot 与 NurbsCurveVDE1213Test.Slot_BoundingBoxMatchesLengthAndWidth 回归通过。注册 8,689;全量 8,685 执行/8,644 passed/0 failed/698.25s;报告 389;版本 1.0.331。
2026-11-12 04:05:04 +08:00
hm 03c8ee2a61 perf(curves): raise helix interpolation density to 48 samples/turn (VDE-1533)
NurbsCurve::helix 自 VDE-1213 起用「按弦长参数化插值 24 采样点/圈」构造,文档标注径向相对误差 <1e-4;本轮实测 radius=1/pitch=2/height=10/turns=5 的最大径向偏差 1.014e-4。三次样条插值误差随采样间隔 4 次方下降,因此把每圈采样从 24 提升到 48:实测最大径向偏差降至 2.243e-6(约 45 倍),总转角 31.415926536(=10π)仍精确,端点 z=10 精确;高圈数(采样数 >1024,约 >21 圈)仍退回 72 极点/圈的经典逼近路径(~1e-3)。同步更新 nurbs_curve.h 的精度说明。新增 NurbsCurveFactoryTest.Helix_RadialAccuracy(400 采样,|r−R| ≤1e-5);Helix_Basic / ConstantRadius / SingleTurn / ZeroTurns 回归通过。注册 8,688;全量 8,684 执行/8,643 passed/0 failed/664.65s;报告 388;版本 1.0.330。
2026-11-12 03:39:22 +08:00
hm e5e7795296 fix(brep): skip degenerate patch boundary edges at sphere poles (VDE-1531)
1.0.328 后球面×平面的交、差已精确,但 box ∪ sphere(球心 z=4.5) 仍 ok=0(wt 0.9524、1 条 non-manifold 边;体积已精确 1.93e-10)。逐边诊断:该 NM 边两端点都是球极点 (0,0,6.5) → 零长边;make_patch_fragment 总为 4 条边界建边,极点处 4 条零长边被 find_or_add_edge 按「端点对+直线标志」缓存合并成一条被 4 个面共用的边。修复:make_patch_fragment 检测退化边界(两角点重合),跳过该边并把极点角点合并为同一顶点,使环在极点直接衔接(三角环,标准退化表示)。实测 box∪sphere(z=4.5) 由 wt 0.9524/ok=0 → watertight 1.0、悬挂 0、non-manifold 0、体积 1010.602875(rel 1.93e-10)、10 面;球面×平面的 8 个交/差布局与 cyl∪sphere(z=5) 全部保持精确。过程记录:曾把 unify_coincident_dangling_edges 扩展到并/交核,导致 VDE1239WireframeStability 出现 adjacent_faces=-1 回归,已回退(仅差集保留),复测通过。新增 MeasureTest.BoxUnionSphereCrossingFaceIsExact;brep_boolean.h 已知限制段更新;注册 8,687;全量 8,683 执行/8,642 passed/0 failed/777.67s;报告 387;版本 1.0.329。
2026-11-12 03:14:47 +08:00
hm 2532b11c43 fix(brep): unify coincident chord/arc dangling edge pairs after difference (VDE-1530)
1.0.327 的等参线精确切分使 box∩sphere(球心 z=4.5) 精确,但同布局差集仍无效(V=987.290822、wt 0.75、8 悬挂边)。逐边诊断(VDE1530_DEBUG,已移除)显示 8 条悬挂边恰好是成对重合的圆环象限弧:A 面内环由精确圆锥裁剪得到 degree-1 弦边,球面片等参切割得到 degree-2 真圆弧边;端点顶点 id 完全相同,但 sew_faces 的边缓存键包含 is_straight 标志,因此不合并,每对留下一条单面边。修复:新增 unify_coincident_dangling_edges——统计边使用次数,按「端点无序对」把悬挂边分组,保留曲线控制点更多的一条(弧优于弦),把所有环中的另一条改指向它(顶点相同、环仍闭合),在差集 sew_faces + heal_gaps + heal_slivers 之后调用。实测:box−sphere(球心 z=4.5,穿出 1.5) 由无效(V=987.290822、wt 0.75、8 悬挂)→ 精确 V=977.092554(rel 6.88e-11)、watertight 1.0、悬挂 0、14 面;球面×平面的交与差在球心于面内侧/面上/中心/内部的 8 个布局全部精确水密(rel ≤7.6e-12 ~ 3.22e-9)。新增 MeasureTest.BoxMinusSphereCrossingFaceIsExact;brep_boolean.h 已知限制段改写(剩余曲-曲,如 cyl−sphere 侧面咬合 wt 0.625);注册 8,686;全量 8,682 执行/8,641 passed/0 failed/674.19s;报告 386;版本 1.0.328。
2026-11-12 02:28:19 +08:00
hm 60ebdd38d0 fix(brep): exact isoparametric split of sphere patches against planes (VDE-1529)
1.0.326 分析确认「球心在面内侧穿透(z=4.5)」缺陷根因:球面碎片用 split_face_by_plane 的**多边形弦**裁剪(只用面角点),而 A 面内环用精确圆锥曲线,两侧 rim 表示不一致。本轮实现通用修复:1) 新增 make_patch_fragment:把矩形 NURBS 子片封装为单面 BrepModel 片段(4 条边界曲线作边 + 外环 + 朝向标志 + 体/壳);2) 在 split_face_by_face_ssi_impl 的平面切分前增加等参线检测:对球面片分别沿 u/v 采样平面有符号距离,变化方向即极角方向,验证端点跨零后二分求切点,再用 extract_sub_surface 精确切成两片——rim 是真正的圆(球面等参线),与平面侧的精确圆锥 rim 同源。实测:box ∩ sphere(球心 z=4.5) 由无效(V=36.141317、wt 0.333、16 悬挂边)→ 精确 V=22.907446(rel 3.22e-9)、watertight 1.0、悬挂 0、9 面;球心在中心/内部、球心在面上(盒/柱)的全部交/差用例保持精确(rel ≤7.6e-12)。仍未修:box−sphere(z=4.5) 差集(V=987.290822、wt 0.75、8 悬挂)。新增 MeasureTest.BoxIntersectSphereCrossingFaceIsExact;brep_boolean.h 已知限制段更新;注册 8,685;全量 8,681 执行/8,640 passed/0 failed/654.12s;报告 385;版本 1.0.327。
2026-11-12 02:02:43 +08:00
hm e8805b339d docs(brep): root-cause analysis for sphere-center-inside-face penetration (VDE-1528)
1.0.324/1.0.325 已使「球心恰在面上」的交、差在盒/柱基体上精确;本轮分析「球心在面内侧、球穿出」(z=4.5)仍失效的根因。症状:box−sphere(z=4.5) V=967.969995(应 977.092554,rel 9.34e-3、wt 0.750、8 悬挂边、14 面);box∩sphere(z=4.5) V=36.141317(应 22.907446、wt 0.333、16 悬挂边)。追踪(VDE1528_DEBUG,已随本轮移除):差集 A 通道顶面在第一个球面片处切成 2 片,最终分类一片 IN(-1)(圆盘,丢弃)、一片 OUT(1)(环形,保留)——A 侧切分与分类正确。根因(高置信):平面 z=5 与球心 z=4.5 的球交于球面 v 参数带中部(非节点线);球面碎片由 split_face_by_plane 以弦折线裁剪,而 A 顶面内环由 Guard 1.4 的精确圆锥曲线(真圆)生成,两侧 rim 表示不一致 → 缝合留 8 条悬挂边。对照:球心恰在面上时切割线为 equator(v=0.5 节点线),两侧 rim 同源,故精确。下一步:① 球面片按等参 v=const 精确切分(extract_sub_surface)+ 子曲面单面片段构造器;② 或统一 rim 弦化口径(兜底)。本轮无代码行为变更,仅 brep_boolean.h 已知限制数字更新(box∩sphere(z=4.5) 183.17→36.14)与报告 384;注册 8,684;全量 8,680 执行/8,639 passed/0 failed/865.40s;版本 1.0.326。
2026-11-12 01:36:05 +08:00