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

+6
View File
@@ -178,6 +178,12 @@ test('members added to version 0 later are optional, each behind its capability'
// A renderer written before an addition still conforms without it.
assert.equal(PORTS.globe.isGlobeVisible, 'globeVisibility');
assert.equal(PORTS.camera.followFrame, 'followFrame');
// Item fields added later are optional too.
const optional = (shape, field) =>
Object.fromEntries(
members(checker.getTypeAtLocation(declared(shape).name)),
)[field];
assert.equal(optional('LineItem', 'depthFailDash'), true);
});
test('the shape check names what is missing and what a capability does not allow', () => {
+7
View File
@@ -229,6 +229,13 @@ export interface LineItem {
style: LineStyle;
/** Colour where the line is behind the surface; `null` hides those parts. */
depthFailColor?: Color | null;
/**
* Dash the parts behind the surface, in `depthFailColor`, as a `dash`
* style's `length` and `pattern16` dash a line. Omitted, they are solid; a
* renderer that predates it draws them solid too. Ignored without a
* `depthFailColor`, and on draped lines, which are never behind it.
*/
depthFailDash?: { length: number; pattern16?: number };
/** Per-segment colours; changing them does not rebuild the line. */
segmentColors?: Color[];
segmentShow?: boolean[];