Cesium shapes: clamped outlines, clamped extrusions and walls, image fills without draping

Clamped outlines were refused; they are now draped lines, a ground polyline
a ring (a polygon's rings, an ellipse cut in 64, a rectangle's turned
corners) under the shape's pick id. Clamped extruded shapes, clamped walls,
and clamped image fills where the scene has no depth textures were refused;
they now stand on the surface unclamped, the surface height read when the
set is built (an extrusion from the lowest point under it, a wall's foot
under each position). The new conformance check draw.shapes.clamped draws
each kind; Cesium runs it.
This commit is contained in:
Sameh Khamis committed 2026-11-11 16:17:28 -08:00
1 parent 19055b2b8b
commit d497435b61
5 files changed
+443 -12

No files matched your search

+84
View File
@@ -1973,6 +1973,90 @@ export function portChecks() {
ok(!mine(at(0)), 'gone with its set');
},
),
check(
'draw.shapes.clamped',
'clamped shapes of every kind draw: outlined, outline only, extruded and walls, and the filled ones are picked',
async (h, r) => {
await overAustin(h, r, 3000);
const shapes = r.draw.shapes({ id: 'conf:clamped-shapes' });
const box = (dLon, dLat, d = 0.0012) => ({
west: AUSTIN.lon + dLon - d,
south: AUSTIN.lat + dLat - d,
east: AUSTIN.lon + dLon + d,
north: AUSTIN.lat + dLat + d,
});
shapes.set([
{
id: 'outlined',
geometry: { kind: 'rectangle', rect: box(-0.004, 0.002) },
fill: [1, 0, 0, 0.6],
outline: '#ffffff',
outlineWidth: 3,
height: 'clampGround',
},
{
id: 'rim',
geometry: { kind: 'rectangle', rect: box(0.004, 0.002) },
outline: '#00ff00',
outlineWidth: 3,
outlineOnly: true,
height: 'clampGround',
},
{
id: 'tower',
geometry: {
kind: 'ellipse',
center: { lon: AUSTIN.lon - 0.004, lat: AUSTIN.lat - 0.003 },
semiMajor: 120,
semiMinor: 120,
},
fill: '#0000ff',
outline: '#ffffff',
extrudeHeight: 300,
height: 'clampGround',
},
{
id: 'fence',
geometry: {
kind: 'wall',
positions: [
{
lon: AUSTIN.lon + 0.003,
lat: AUSTIN.lat - 0.003,
height: 40,
},
{
lon: AUSTIN.lon + 0.005,
lat: AUSTIN.lat - 0.003,
height: 40,
},
],
},
fill: '#ffff00',
height: 'clampGround',
},
]);
equal(shapes.size(), 4, 'every kind is taken');
await settled(r);
await drawn(h, r);
for (const [id, lon, lat, height] of [
['outlined', AUSTIN.lon - 0.004, AUSTIN.lat + 0.002, 0],
['tower', AUSTIN.lon - 0.004, AUSTIN.lat - 0.003, 300],
]) {
const s = r.query.project(h.toEcef({ lon, lat, height }));
ok(s, `${id} projects`);
ok(
r.query
.drillPick(s.x, s.y)
.some(
(hit) => hit.set === 'conf:clamped-shapes' && hit.id === id,
),
`${id} drawn and picked`,
);
}
shapes.dispose();
},
),
check(
'draw.shapes.resize',
'a clamped ellipse whose radius alone is upserted draws at the new radius, growing and shrinking',