Dash a line's parts behind the surface, and the Draw tool's rubber band there

A line item gains an optional depthFailDash ({ length, pattern16? }): the
parts behind the surface are dashed in depthFailColor, as a dash style
dashes a line. Without a depthFailColor, and on draped lines, it is
ignored; a renderer that predates it draws those parts solid. The Cesium
draw port gives the depth-fail appearance a PolylineDash material, and a
change of dash is a new look. The Draw tool's rubber band uses
{ length: 16 }, the dash its old entity asked for (that entity, a dynamic
polyline, never drew its depth-fail material, so the parts behind the
surface were hidden before the tool moved onto the draw port).
This commit is contained in:
Sameh Khamis committed 2026-11-07 21:49:25 -08:00
1 parent 90e73f2ef2
commit 7ad65b2e87
10 files changed
+115 -2

No files matched your search

+30
View File
@@ -1348,6 +1348,36 @@ export function portChecks() {
set.dispose();
},
),
check(
'draw.lines.depthFailDash',
'a line dashed behind the surface draws, moves in place and changes back to solid',
async (h, r) => {
await overAustin(h, r);
const lines = r.draw.lines({ id: 'conf:line-dash' });
const at = (dLon, height) =>
h.toEcef({ lon: AUSTIN.lon + dLon, lat: AUSTIN.lat, height });
const band = (height, extra = {}) => ({
id: 'band',
positions: [at(-0.002, 50), at(0.002, height)],
widthPx: 3,
mode: 'geodesic',
style: { kind: 'dash', color: [1, 1, 0, 0.9], length: 16 },
depthFailColor: [0, 1, 1, 0.35],
depthFailDash: { length: 16 },
...extra,
});
lines.set([band(-200)]);
await drawn(h, r);
equal(lines.size(), 1, 'held');
lines.upsert([band(-100)]);
await drawn(h, r);
equal(lines.size(), 1, 'moved in place, not added');
lines.upsert([band(-100, { depthFailDash: undefined })]);
await drawn(h, r);
equal(lines.size(), 1, 'solid behind the surface again');
lines.dispose();
},
),
check(
'draw.lines.styles',
'flow lines draw draped and in space, and a line with a depth-fail colour moves every frame, without stopping the frame or picks',