Skip to content

feat: isolate selection with adjustable context opacity - #797

Draft
maxkrut wants to merge 1 commit into
ThatOpen:mainfrom
maxkrut:codex/feat-selection-context-opacity
Draft

feat: isolate selection with adjustable context opacity#797
maxkrut wants to merge 1 commit into
ThatOpen:mainfrom
maxkrut:codex/feat-selection-context-opacity

Conversation

@maxkrut

@maxkrut maxkrut commented Sep 9, 2026

Copy link
Copy Markdown

Add Highlighter.isolation to isolate the select style while showing its surrounding model with adjustable opacity:

await highlighter.isolation.isolate(0.15);
await highlighter.isolation.setOpacity(0.37);
await highlighter.isolation.reset();

Zero hides context; positive values multiply the original material opacity and preserve context colors. Selected materials retain their highlight. Newly streamed materials receive the same factor, and positive slider changes reuse graphics materials without enumerating all IFC item IDs or creating worker highlight definitions. The example slider has a 1% step; the API accepts finite values from 0 to 1.

Selection changes follow active isolation; clearing selection or resetting shows all items. Call refresh() after loading another model. Isolation owns item visibility while active, like Hider; it does not restore an earlier arbitrary visibility filter.

A null select material, or selected items painted by a higher-priority overlapping style, causes an explicit rejection for translucent isolation. An overlap introduced while active resets isolation and reports the error; style membership and priorities are preserved. Disposal cancels updates and restores materials synchronously; call reset() first when keeping the scene and restoring item visibility.

Validation: Node regression tests (yarn test:isolation) cover streamed materials, glass opacity, 100 slider changes, selection/clear, invalid values, worker rejection, request settlement races, in-flight disposal and integration with Highlighter. TypeScript and library builds pass; the standalone example uses the existing public school model. No new dependencies or core-package API changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant