Skip to content

Commit bdbf2bd

Browse files
LimHyungTaeclaude
andcommitted
Bigger default points (slider stays at 1×) · normal-vector lines · pair lines whitened
- Lec07/08/09/10 now bake the larger default size into the layers' ptSize (0.05 → 0.25 of scale) instead of starting the slider at 5×. The on-screen result is the same, but the slider opens at "1.00×" so reading and shrinking are intuitive. - Lec10 (Normal) now draws each estimated normal as a short white-ish line segment (slate-200, 0.55 opacity), length = 2 × voxel size, on top of the colored points. Easier to visually verify the orientation. - Lec11 (ICP) correspondence lines switched from yellow to slate-200 for a cleaner contrast against red src + green tgt. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 80192a0 commit bdbf2bd

5 files changed

Lines changed: 35 additions & 10 deletions

File tree

web/src/pages/Lec07Sor.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default function Lec07Sor() {
3737
}, [raw, scale]);
3838

3939
const result = useMemo(() => sor(src, meanK, stddev), [src, meanK, stddev]);
40-
const ptSize = 0.05 * scale;
40+
const ptSize = 0.25 * scale;
4141

4242
return (
4343
<div className="mx-auto max-w-7xl px-8 py-10">
@@ -57,7 +57,6 @@ export default function Lec07Sor() {
5757
</div>
5858
<div className="aspect-[16/10] w-full">
5959
<PointCloudViewer
60-
defaultSizeMult={5}
6160
layers={[
6261
{ cloud: result.inliers, color: "#34d399", size: ptSize },
6362
{ cloud: result.outliers, color: "#f87171", size: ptSize * 1.4 },

web/src/pages/Lec08RadiusSearch.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function Lec08RadiusSearch() {
5252
() => cloudFromPositions(new Float32Array([qx, qy, qz])),
5353
[qx, qy, qz],
5454
);
55-
const ptSize = 0.05 * scale;
55+
const ptSize = 0.25 * scale;
5656

5757
return (
5858
<div className="mx-auto max-w-7xl px-8 py-10">
@@ -70,7 +70,6 @@ export default function Lec08RadiusSearch() {
7070
</div>
7171
<div className="aspect-[16/10] w-full">
7272
<PointCloudViewer
73-
defaultSizeMult={5}
7473
layers={[
7574
{ cloud: src, color: "#475569", size: ptSize, opacity: 0.55 },
7675
{ cloud: neighbors, color: "#34d399", size: ptSize * 1.3 },

web/src/pages/Lec09Knn.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default function Lec09Knn() {
5252
() => cloudFromPositions(new Float32Array([qx, qy, qz])),
5353
[qx, qy, qz],
5454
);
55-
const ptSize = 0.05 * scale;
55+
const ptSize = 0.25 * scale;
5656

5757
return (
5858
<div className="mx-auto max-w-7xl px-8 py-10">
@@ -70,7 +70,6 @@ export default function Lec09Knn() {
7070
</div>
7171
<div className="aspect-[16/10] w-full">
7272
<PointCloudViewer
73-
defaultSizeMult={5}
7473
layers={[
7574
{ cloud: src, color: "#475569", size: ptSize, opacity: 0.55 },
7675
{ cloud: neighbors, color: "#34d399", size: ptSize * 1.3 },

web/src/pages/Lec10Normal.tsx

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,31 @@ export default function Lec10Normal() {
3838
return out;
3939
}, [normals, src.count]);
4040

41-
const ptSize = 0.05 * scale;
41+
// Build line segments for the normal vectors — each starts at a point and
42+
// extends along its normal by a small fraction of the voxel scale so the
43+
// arrows stay visible without overwhelming the cloud.
44+
const normalLines = useMemo(() => {
45+
if (src.count === 0) return new Float32Array(0);
46+
const len = voxel * 2;
47+
const out = new Float32Array(src.count * 6);
48+
for (let i = 0; i < src.count; i++) {
49+
const x = src.positions[i * 3];
50+
const y = src.positions[i * 3 + 1];
51+
const z = src.positions[i * 3 + 2];
52+
const nx = normals[i * 3];
53+
const ny = normals[i * 3 + 1];
54+
const nz = normals[i * 3 + 2];
55+
out[i * 6] = x;
56+
out[i * 6 + 1] = y;
57+
out[i * 6 + 2] = z;
58+
out[i * 6 + 3] = x + nx * len;
59+
out[i * 6 + 4] = y + ny * len;
60+
out[i * 6 + 5] = z + nz * len;
61+
}
62+
return out;
63+
}, [src, normals, voxel]);
64+
65+
const ptSize = 0.25 * scale;
4266

4367
return (
4468
<div className="mx-auto max-w-7xl px-8 py-10">
@@ -55,14 +79,18 @@ export default function Lec10Normal() {
5579
</div>
5680
<div className="aspect-[16/10] w-full">
5781
<PointCloudViewer
58-
defaultSizeMult={5}
5982
layers={[
6083
{
6184
cloud: src,
6285
color: coloring === "normal" ? colors : "#94a3b8",
6386
size: ptSize,
6487
},
6588
]}
89+
lines={
90+
normalLines.length > 0
91+
? [{ positions: normalLines, color: "#e2e8f0", opacity: 0.55 }]
92+
: undefined
93+
}
6694
/>
6795
</div>
6896
</div>

web/src/pages/Lec11Icp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default function Lec11Icp() {
111111
<div className="flex items-center gap-3">
112112
<Dot color="#f87171" /> {t.lec11.legendSrc}
113113
<Dot color="#00d4aa" /> {t.lec11.legendTgt}
114-
<Dot color="#facc15" /> pairs
114+
<Dot color="#e2e8f0" /> pairs
115115
</div>
116116
<div className="code-font flex items-center gap-3 text-[var(--dim)]">
117117
<span>iter {iter}</span>
@@ -137,7 +137,7 @@ export default function Lec11Icp() {
137137
]}
138138
lines={
139139
pairCoords.length > 0
140-
? [{ positions: pairCoords, color: "#facc15", opacity: 0.55 }]
140+
? [{ positions: pairCoords, color: "#e2e8f0", opacity: 0.6 }]
141141
: undefined
142142
}
143143
/>

0 commit comments

Comments
 (0)