163 lines
7.1 KiB
HTML
163 lines
7.1 KiB
HTML
|
|
<!doctype html>
|
|||
|
|
<html lang="zh-CN">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8" />
|
|||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|||
|
|
<title>Occupancy Fitting · AURORA A1</title>
|
|||
|
|
<link rel="stylesheet" href="style.css?v=20261125e" />
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<div id="app">
|
|||
|
|
<aside id="panel">
|
|||
|
|
<header class="brand">
|
|||
|
|
<div class="eyebrow"><span class="dot"></span> OCP · STEP → VOXEL</div>
|
|||
|
|
<h1>OCCUPANCY<br /><span>FITTING</span></h1>
|
|||
|
|
<p class="sub">用可调立方体逼近一辆 F1 概念车<br />FSD 占用网络 · 可解释沙盒</p>
|
|||
|
|
</header>
|
|||
|
|
|
|||
|
|
<section class="block controls">
|
|||
|
|
<div class="label-row">
|
|||
|
|
<label for="size">立方体边长</label>
|
|||
|
|
<output id="sizeOut">8 cm</output>
|
|||
|
|
</div>
|
|||
|
|
<input id="size" type="range" min="0" max="0" step="1" value="0" />
|
|||
|
|
|
|||
|
|
<div class="label-row second">
|
|||
|
|
<label for="threshold">占据阈值</label>
|
|||
|
|
<output id="thrOut">30%</output>
|
|||
|
|
</div>
|
|||
|
|
<input id="threshold" type="range" min="0" max="100" step="1" value="30" />
|
|||
|
|
<div class="hint" id="thrHint">概率 ≥ 30% 的体素被保留</div>
|
|||
|
|
|
|||
|
|
<div class="button-row">
|
|||
|
|
<button id="calibrate" class="primary" title="把阈值设为当前边长下体积最接近真实值的水平">体积校准</button>
|
|||
|
|
<button id="resetView" class="ghost">重置视角</button>
|
|||
|
|
</div>
|
|||
|
|
</section>
|
|||
|
|
|
|||
|
|
<section class="block chart-block">
|
|||
|
|
<div class="block-title"><span>体积差异 vs 边长</span><span class="sub2">点击折线切换</span></div>
|
|||
|
|
<div class="chart-wrap">
|
|||
|
|
<canvas id="chart"></canvas>
|
|||
|
|
<div class="chart-tip" id="chartTip"></div>
|
|||
|
|
</div>
|
|||
|
|
<div class="chart-legend"><span class="pos">偏大</span><span class="zero">0</span><span class="neg">偏小</span></div>
|
|||
|
|
</section>
|
|||
|
|
|
|||
|
|
<section class="block stats">
|
|||
|
|
<div class="block-title"><span>推理结果</span><span class="live">LIVE</span></div>
|
|||
|
|
|
|||
|
|
<div class="metric big">
|
|||
|
|
<span class="k">拟合体积</span>
|
|||
|
|
<span class="v" id="vFit">—</span><span class="u">m³</span>
|
|||
|
|
</div>
|
|||
|
|
<div class="metric big">
|
|||
|
|
<span class="k">体积差异</span>
|
|||
|
|
<span class="v" id="vErr">—</span><span class="u">%</span>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="grid2">
|
|||
|
|
<div class="mini"><span class="k">立方体数量</span><b id="vCount">—</b></div>
|
|||
|
|
<div class="mini"><span class="k">IoU</span><b id="vIou">—</b></div>
|
|||
|
|
<div class="mini"><span class="k">精确率</span><b id="vPrec">—</b></div>
|
|||
|
|
<div class="mini"><span class="k">召回率</span><b id="vRec">—</b></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="divider"></div>
|
|||
|
|
|
|||
|
|
<div class="metric">
|
|||
|
|
<span class="k">包络尺寸</span>
|
|||
|
|
<span class="v small" id="vCubeSide">—</span><span class="u">m</span>
|
|||
|
|
</div>
|
|||
|
|
<div class="metric">
|
|||
|
|
<span class="k">立方体体积</span>
|
|||
|
|
<span class="v small" id="vCubeVol">—</span><span class="u">m³</span>
|
|||
|
|
</div>
|
|||
|
|
<div class="metric">
|
|||
|
|
<span class="k">拟合占用度</span>
|
|||
|
|
<span class="v small" id="vOcc">—</span><span class="u">%</span>
|
|||
|
|
</div>
|
|||
|
|
<div class="metric">
|
|||
|
|
<span class="k">真实占用度</span>
|
|||
|
|
<span class="v small" id="vTrueOcc">—</span><span class="u">%</span>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="segmented" id="cubeMode" role="group" aria-label="包络体类型">
|
|||
|
|
<button data-mode="aabb" class="active">标准立方体</button>
|
|||
|
|
<button data-mode="min">数学最小</button>
|
|||
|
|
<button data-mode="box">最小长方体</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="hint" id="cubeHint">轴对齐立方体;边长 = 车辆最大尺寸</div>
|
|||
|
|
<div class="env-compare" id="envCompare">—</div>
|
|||
|
|
|
|||
|
|
<div class="divider"></div>
|
|||
|
|
<div class="ref-row"><span>真实体积参考</span><b id="vRef">—</b><span>m³</span></div>
|
|||
|
|
<div class="ref-row"><span>CAD 实体体积和</span><b id="vCad">—</b><span>m³</span></div>
|
|||
|
|
<div class="ref-row"><span>候选体素(覆盖)</span><b id="vCover">—</b></div>
|
|||
|
|
<div class="ref-note">参考体积为 4 mm 并集体素;CAD 体积和包含零件重叠,故更大。</div>
|
|||
|
|
</section>
|
|||
|
|
|
|||
|
|
<section class="block toggles">
|
|||
|
|
<label class="switch"><input type="checkbox" id="showCar" checked /><span>半透明车辆</span></label>
|
|||
|
|
<label class="switch"><input type="checkbox" id="showVoxels" checked /><span>立方体拟合</span></label>
|
|||
|
|
<label class="switch"><input type="checkbox" id="showCube" checked /><span>包络立方体</span></label>
|
|||
|
|
<label class="switch"><input type="checkbox" id="showGrid" checked /><span>地面网格</span></label>
|
|||
|
|
<label class="switch"><input type="checkbox" id="autoRotate" /><span>自动旋转</span></label>
|
|||
|
|
</section>
|
|||
|
|
|
|||
|
|
<details class="method">
|
|||
|
|
<summary>方法与 FSD 占用网络类比</summary>
|
|||
|
|
<p>
|
|||
|
|
STEP 通过 OCP 读取并精确计算 B-Rep 体积,再网格化为 90,964 个三角形。
|
|||
|
|
对每个实体分别沿 Y 轴做射线奇偶填充,得到 4 mm 精细占据栅格;
|
|||
|
|
再聚合成 4–40 cm 的立方体,每个立方体带有 0–100% 的占据概率。
|
|||
|
|
</p>
|
|||
|
|
<p>
|
|||
|
|
这与 FSD 类占用网络的关键表示一致:3D voxel grid + occupancy
|
|||
|
|
probability + 阈值化。区别是这里用 CAD 真值代替摄像头感知,因此可以
|
|||
|
|
精确量化体积误差、IoU、精确率与召回率。
|
|||
|
|
</p>
|
|||
|
|
<p class="formula">
|
|||
|
|
V_fit = N · s³ |
|
|||
|
|
error = (V_fit − V_ref) / V_ref<br />
|
|||
|
|
occupancy = V_fit / S_cube³
|
|||
|
|
</p>
|
|||
|
|
<p class="source">
|
|||
|
|
模型来源:
|
|||
|
|
<a href="https://github.com/Sunwood-ai-labs/aurora-a1-freecad" target="_blank" rel="noreferrer">Sunwood-ai-labs / aurora-a1-freecad</a>
|
|||
|
|
· 仅用于本地研究与演示
|
|||
|
|
</p>
|
|||
|
|
</details>
|
|||
|
|
|
|||
|
|
<footer class="foot">
|
|||
|
|
<div>AURORA A1 · 130 solids · 2.059 m³ CAD</div>
|
|||
|
|
<div>OCP 8.0 · three.js · <span id="genAt">—</span></div>
|
|||
|
|
</footer>
|
|||
|
|
</aside>
|
|||
|
|
|
|||
|
|
<main id="viewport">
|
|||
|
|
<div class="viewport-toolbar">
|
|||
|
|
<div class="cam-buttons">
|
|||
|
|
<button data-view="car" class="active">车辆视角</button>
|
|||
|
|
<button data-view="cube">立方体视角</button>
|
|||
|
|
<button data-view="top">俯视</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="legend">
|
|||
|
|
<span class="legend-label">高度</span>
|
|||
|
|
<span class="legend-bar"></span>
|
|||
|
|
<span class="legend-ends">低 / 高</span>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="viewport-hint">拖动旋转 · 滚轮缩放 · 右键平移</div>
|
|||
|
|
<div class="loading" id="loading">正在装配场景…</div>
|
|||
|
|
<div class="error" id="error" hidden></div>
|
|||
|
|
</main>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<script src="vendor/three.min.js?v=20261125b"></script>
|
|||
|
|
<script src="vendor/OrbitControls.js?v=20261125b"></script>
|
|||
|
|
<script src="data.js?v=20261125b"></script>
|
|||
|
|
<script src="app.js?v=20261125g"></script>
|
|||
|
|
</body>
|
|||
|
|
</html>
|