Repository navigation
Ariadne scene: type: ribbon and type: draped_link, lines drawn from data - #1232
Merged
Merged
Conversation
Two custom scene node types over cvcGL's streaming RibbonNode and DrapedLinkNode
(ribbon_nodes.h, registered by register_cvcgl_extensions), so a document draws tracks that grow
every tick, routes replaced on each re-plan and links between moving nodes with no host C++.
- type: ribbon takes its points from source: { state: <key> } (data() floats, doubles, float32
bytes or a mesh's points, else the value's numbers as text), { data: <name>, item: <output> }
(a dataset of the document's data: block), { stream: <token> } (float32 frames, each appended,
or each the whole line with replace: true), or literal points:. fields: says what a point's
numbers are: x, y and any of z, w (its width) and v (its value).
- A key is read again only when it was written. A list that grew appends, one whose tail changed
is written from the first point that differs, and only those centres are uploaded: one quad
(48 bytes) an appended point, never the whole node.
- window: { from, to, tail, units: point | m } moves what is drawn with no upload (each a number
or a state key read each frame).
- Width per node (width:) or per point (w); colour per node (color: [r, g, b], "#rrggbb", or the
chart's style slots c0..c7), or per point by value through ramp: (quality, heat, or up to eight
stops; range:). ground: drapes the points on a heightfield or generated_world node, and a ground
made again re-drapes them.
- type: draped_link hugs a ground's heights in the vertex shader: between: [a, b] follows two
nodes (world entities' vehicle_<id> too), or from:/to: or a source: of x0, y0, x1, y1. value: +
ramp: colour it by a quality read each frame. Moving and recolouring it upload nothing; its
ground's heights are one texture shared by its links.
cvcGL:
- RibbonNode::replaceFrom(first, xyz, n, halfWidths, values): rewrite centres from `first` on,
uploading only those (append and assign go through it). Per-centre half widths (a segment
tapers between them).
- RibbonNode::setValueRamp: colour by each centre's value, interpolated along the segment and
drawn flat. The values sit in an R32F texture uploaded by sub-image (a write uploads its own
texels, at most three calls); valueStats() counts them.
- DrapedLinkNode::setHeightField: drape over another height texture (a ground on a new grid).
Scene core:
- The loader keeps a source: the built-ins have no field for ({ state }, { stream }) in a custom
node's props, as written.
- register_scene_node_type takes NodeTypeOptions; reads_data hands a source: { data } node to its
realizer instead of drawing it as a data node.
Test cvcgl_ariadne_ribbons (55 checks, rendered for real): per-append uploads counted by the node
and at the driver (one quad, nothing created), a moved last point rewrites two centres, windows
and links moved with no upload, pixels for the track, route window, values, widths and links,
value colours on both VTK mapper families, the dataset and stream sources, draping, and a ground
regenerated in place and on a new grid. Documented in docs/ARIADNE.md §5.4.
transfix
enabled auto-merge (squash)
November 14, 2026 19:32
…mestamp A state source was read again only when the key's lastMod() changed. lastMod comes from boost's microsec_clock, which on Windows ticks coarsely. Two writes within one tick (a track growing a point a frame) then had the same stamp, and the second was never read. cvcgl_ariadne_ribbons' append, tail and data() checks failed on package-windows for that reason. The source now listens to the node's valueChanged and dataChanged signals. The slot only bumps a shared atomic counter, so it is safe from any writer thread and outlives nothing. It reconnects when the key resolves to another node or the old node's signal has gone.
…-ribbon-nodes # Conflicts: # docs/ARIADNE.md
transfix
added a commit
that referenced
this pull request
Nov 16, 2026
Conflicts (includes in ariadne.h, ariadne.cpp and ariadne_runtime_test.cpp; three hunks of #1241's menubar tray in ariadne.cpp) keep both sides. #1241's code meets this branch's groups: - An action's context keeps master's scope (a quit application's actions stop) and is built by this branch's finish_context. - The notify verbs bind by kind with the backend's (install_backend_verbs is now install_host_verbs): host_proxied in an `any` group, as cvc::notify mirrors the feed into the app's notify.* subtree raw on the caller's thread. - What they capture (scope, source, a copy of mount_names) is taken on the host thread when a context is made (NotifyScope); a spawned child, made on the thread that pumps its group, binds from its parent's copy through its spawn context instead of reading mount_names there. - quit_app kills the application's actions on current_sched() (the document's group), not only on group 0 when this Runtime used it. - drain_begin runs builtin_event before the handler seam, through this branch's `m`. Tests: AriadneIsolatedDocs.TheNotifyVerbsRunOnTheFramesThread (the feed is written on the frame's thread while a worker pumps the program; a spawned child posts as its parent's scope) and AriadneIsolatedDocs.QuitKillsALoadedDocumentsActionsInItsGroup. STATE_EXEC_THREADED.md: the notify verbs' row, Quit among the kills that go to the group, and the spawned child's notify scope.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two custom scene node types over cvcGL's streaming
RibbonNodeandDrapedLinkNode, so a document can draw these with no host C++:Each line is its own node, updated only when its data changes. Data that grows or moves uploads only what changed. Documented in docs/ARIADNE.md §5.4 ("Lines from data").
type: ribbonPoints. A ribbon takes its points from one of these:
data()(floats, doubles, float32 bytes or a mesh's points) or the numbers in its value;replace: true);points:.fields:lists each point's numbers:x,y, and any ofz,w(width) andv(value).Reads and uploads. A key is read only when it was written. Then:
Window.
window:moves what is drawn with no upload.Width. Per node (
width:) or per point (w).Colour. Per node (
color:) or per point by value (ramp::quality,heat, or up to 8 stops;range:).Ground.
ground:drapes the points. When the ground is made again, the ribbon is re-draped.type: draped_linkbetween:follows two nodes, world entities'vehicle_<id>included.value:+ramp:colours the link by a quality read each frame.Changes in cvcGL
RibbonNode::replaceFrom(first, xyz, n, halfWidths, values)rewrites centres fromfirston and uploads only those; append and assign go through it.RibbonNodetakes per-centre half widths.RibbonNode::setValueRampcolours by value. The values are an R32F texture updated by sub-image, at most 3 calls a write;valueStats()counts them.DrapedLinkNode::setHeightFielddrapes over another texture, for a ground on a new grid.Changes in the scene core
source:the built-ins have no field for ({ state },{ stream }) into a custom node's props.register_scene_node_typetakesNodeTypeOptions. Withreads_data, a type'ssource: { data }nodes go to its realizer instead of becoming data nodes.Tests
New
cvcgl_ariadne_ribbons(55 checks, rendered for real; it skips where nothing rasterises unlessCVC_REQUIRE_RENDER=1). It checks:Run locally on Linux (GCC 13, Release, Mesa) with
CVC_REQUIRE_RENDER=1; all pass:cvcgl_ariadne_ribbons;cvcgl_streaming_geometry,cvcgl_streaming_overlaysandcvcgl_streaming_races(RibbonNodeandDrapedLinkNodechanged);cvcgl_stream_node;cvcgl_ariadne_{data,physics,pick,realize,scenes,views};cvcgl_ari_switch,cvcgl_camera_idleandcvcgl_shadow_casters;ariadne_loader_test(230 tests).clang++-18 -Wall -Wextrais clean on the new and changed sources.Not run locally: Windows, macOS and the wasm lanes (CI covers them).