Repository navigation
Ariadne data: a document's datasets (files, https, cvcpkg packages) loaded into the state tree and drawn - #998
Merged
Merged
Conversation
A document's data: block names its datasets by URI: a file or directory, https://, a cvcpkg package (cvcpkg://ORG/NAME[@Version]) or state://. The host loads each off the frame thread into one shared store at the app root (data.<key>, one node per request), and the document's data.<name> is a transparent link to it, so widgets, programs, the scene and Python hosts read the same load. - cvc/utility/archive.h: tar (plain, gzip, zstd) and zip from memory, recognized by their bytes, with safe paths and caps; gzip and deflate decoded here (no zlib link). - cvc/ariadne/data.h: the store, its sources (cvcpkg: the registry's noarch build, checked against its sha256 and cached by it), decoders (files, bytes, text, json, mesh, volume, heightfield, city_bundle) and register_data_decoder. It lives as long as the app. - The loader's data: block and source: { data, item }; AppRuntime binds the block before init: and adds (data-load), (data-reload), (data-status), (data-files) and (data-file). - cvcGL: a data node is an empty group until its dataset is ready; tick_scene (sync_scene_data) draws it then and again on each new rev or re-pointed link, a world's terrain as the node's height field and, with body:, its static bodies. - pycvc: data_load, data_wait, data_status, data_files, data_file, data_world, data_height_field, data_geometry, data_allow_network; AriRuntime.enable_net_allow. - examples/ariadne/documents/austin_data.ari draws the Austin scene from cvcpkg.org. - The curl clients verify TLS against the Windows certificate store: native Windows builds reached no https URL before. Design and later phases: docs/roadmap/ARIADNE_DATA_ROADMAP.md; reference: docs/ARIADNE.md 5.17.
…ured casters' shadows
- The city_bundle decoder decodes satellite.png (in memory, off the frame thread) onto
data.<key>.satellite, and a source: { data } node drapes it over the terrain it draws: UVs over
the terrain's extent, north up (UV (0, 0) is the image's bottom-left, GeometryNode's
convention).
- material: { uv: { rotate, flip_u, flip_v, scale, offset } } orients a node's texture in texture
space (the draped image and material: texture alike); apply_uv_transform.
- GeometryNode::hasTexture / textureWidth / textureHeight (pycvc_gl: has_texture, texture_size).
- Shadows: a textured caster's bake no longer takes its texture's colour. VTK's texture code ran
after the bake wrote 1 + exp(c * depth) and multiplied it by each texel's colour, so a
textured ground read back nearer the light than itself and shadowed itself (a dark band over the
Austin city, darker where the image is). The texture now only contributes alpha to the bake, so
cut-outs still cast nothing where clear; terrain still shadows its own valleys and craters.
- A dataset's terrain is drawn opaque (no per-texel alpha scan of its image).
transfix
added a commit
to CVC-Lab/GRL-SNAM
that referenced
this pull request
Nov 3, 2026
…load (#153) docs/live.ari names the Austin city in a data: block (libcvc's Ariadne data, transfix/libcvc#998): the scene-austin-south-small package on cvcpkg.org, downloaded once (later runs read the cache), unpacked into the state tree and decoded. Its city node draws the terrain, the package's aerial image draped over it, and the buildings. - _host: load_document (the store may reach the registry; --bundle / GRL_SNAM_SCENE_BUNDLE point data.city at a local bundle instead, nothing downloaded), document_city (the loaded world as a City; the installed bundle stands in when the package cannot load), city_file (a package file a path-based reader needs: the Humvee), DemoHost.city. - demos._common: City (sample, bounds, occupancy) and open_city: the host's city when it has one, else the installed bundle drawn into the lab as before (loaded once for every occupancy grid); world_occupancy, shared with bundle_occupancy. - austin_freedrive / austin_learned / austin_patrol take their terrain sampler, bounds, occupancy and SDF from open_city, so under the live port no bundle file is read twice. - live: --bundle; headless is refused before the document loads (no download for nothing); the planner never loads the city; the Humvee comes from the city's package when it carries one.
…ode from memory
frame: true | first | always on a source: { data } node frames the main view's camera on what its
dataset drew (once, or on every redraw), through a new camera state request: <camera>.frame =
"min_x min_y min_z max_x max_y max_z" makes CameraController frame those bounds as frameBounds
does, so a document shows the city it named with no host code (austin_data.ari does).
In-memory readers, so a decoder no longer writes its files to a temporary directory:
- cvc::read_model_from_memory / can_read_model_from_memory (Assimp's ReadFileFromMemory), the
model built by the same scene conversion as read_model.
- cvc::world::load_city_bundle(reader, label): a bundle's files from a reader (the data store's
bytes); the directory form is now that loader over the directory's files.
- The city_bundle and heightfield decoders read the store's bytes; the mesh decoder too for every
Assimp format. Only libcvc's own path-based formats (.off, .raw* meshes, volumes) still take a
file, briefly.
…valleys casts_shadow: false on the world's ground worked around the textured-caster bake bug (a textured ground shadowed itself everywhere), fixed in 0d7687e. With it gone the ground casts like any other node; the header comment and docs/ARIADNE.md's fast-render-path example say so.
…data # Conflicts: # src/cvcGL/test/cvcgl_camera.cpp
…st (macOS < 13.3 has no to_chars for doubles)
…data # Conflicts: # src/cvcGL/GeometryNode.cpp
…data # Conflicts: # docs/ARIADNE.md # src/cvc/ariadne/loader.cpp
…data # Conflicts: # docs/ARIADNE.md
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.
A document can now name its datasets by URI in a
data:block. The host loads each one off the frame thread into one shared place in the state tree, and the scene draws from there. Python hosts read the same objects, so nothing is loaded twice. The motivating case is GRL-SNAM's live demos, which find the Austin bundle on disk themselves, load it into the scene, then read it again for the navigator.The design, with the later phases, is in
docs/roadmap/ARIADNE_DATA_ROADMAP.md. The reference for documents isdocs/ARIADNE.md§5.17.What's in it
Archive reader (
cvc/utility/archive.h).tar.zst, but its data packages are gzip tars...paths and skips links and devices. File count and unpacked bytes are capped.cvcConfig.cmake.inalready has to work around zlib for consumers). zstd is the libzstd libcvc already links.Store (
cvc/ariadne/data.h)data.<key>: its status, progress, error,rev, the source's hash and size, its files (bytes ondata()), and what its decoder made.data.<name>is a transparent link to that node. Widget binds andstate-getread through it.Sources
https://, through the host's network policy.cvcpkg://ORG/NAME[@VERSION]:/v1/packages/NAME/latest?org=…&platform=any&arch=noarch&build_type=none&link=none);CVC_DATA_CACHE, else the user's cache dir).state://, where the host registered that scheme.Decoders
files,bytes,text,json,mesh,volume,heightfield, andcity_bundle(aworld_geometry, its terrainheight_field, its buildingsgeometry, and the bounds).register_data_decoder.Scene (
source: { data: NAME, item: X })tick_scenedraws the dataset into it once it is ready, and again whenever itsrevchanges or the link is re-pointed. What it drew before is removed, bodies included.add_world_geometry). Its terrain becomes the node's height field, soground:works. Withbody:, its static bodies go into the scene's physics world.Verbs:
(data-load NAME URI [AS [PATH]])re-pointsdata.NAMEand starts the load. Also(data-reload NAME),(data-status NAME),(data-files NAME)and(data-file NAME PATH).Python
pycvc.data_load,data_wait,data_status,data_files,data_file(bytes).pycvc.data_world,data_height_fieldanddata_geometry. These are the objects the scene draws, sharing their arrays.pycvc.data_allow_network, andAriRuntime.enable_net_allow([...])(what--net-allowdoes).Example:
examples/ariadne/documents/austin_data.aridraws the Austin scene from cvcpkg.org. Its two buttons swap the small and full cities from the document alone.Windows TLS fix: the curl client and WebSocket client now verify against the Windows certificate store (
CURLSSLOPT_NATIVE_CA). Without it, a native Windows build reached no https URL at all: libcurl/OpenSSL there has no CA bundle to find. Tests didn't catch this because they use fake HTTP clients.Tested (Windows, Release, cvcpkg prefix)
New tests
ariadne_data_test, 13 tests:path:with the city and JSON decoders;data:block.cvcgl_ariadne_data(headless): the city and mesh draw once ready, the terrain body lands in the physics world, and re-pointing the link redraws with the old body gone.pycvc_data.Existing suites:
ariadne_loader_test(215),ariadne_runtime_test,ariadne_host_test,ariadne_requires_test,cvcgl_ariadne_realize,cvcgl_ariadne_physics,pycvc_world_geometry,pycvc_state.Live against cvcpkg.org
pycvc.data_load("cvcpkg://cy-pca/scene-austin-south-small", path=…, decoder="city_bundle")resolved 1.0.0+cvc.2 and downloaded 10,108,265 bytes (sha256 d96b19d7…).austin_data.ariran offscreen throughpycvc_gl.AriRuntimewithenable_net_allow(["https://cvcpkg.org"]). The city node drewcity_terrainandcity_buildingsonce the data was in, and the City panel showed the resolved package,readyand 100%.Not in this PR
live.ariand reading it back instead of loading the bundle.Since opening
0d7687e: the satellite image, its orientation, and textured shadows
satellite.pngis decoded with the bundle and draped over its terrain, north up. UV (0, 0) is the image's bottom-left, cvcGL's convention.material: { uv: { rotate, flip_u, flip_v, scale, offset } }orients a node's texture in texture space, for both the draped image andmaterial: texture.GeometryNode::hasTexture/textureWidth/textureHeight, and in Pythonhas_texture/texture_size.terrain_lab.ari'scasts_shadow: falseon its ground was a workaround for this bug; only its re-bake cost argument remains.cvcgl_ariadne_datachecks the draped image's UVs and the texture query, and covers the UV transform. The cvcGL shadow suites,cvcgl_texture*andcvcgl_ari_goldenpass locally.a2ed211: a document frames its data; in-memory readers
frame: true | first | alwayson asource: { data }node frames the main view's camera on what the dataset drew, once or on every redraw.<camera>.frame = "min_x min_y min_z max_x max_y max_z", whichCameraControllerframes asframeBoundsdoes.austin_data.ariuses it, so the document shows its city with no host code.cvc::read_model_from_memory(AssimpReadFileFromMemory), andcvc::world::load_city_bundle(reader, label)over a file reader; the directory form is that loader over the directory's files..off,.raw*meshes, volumes) still pass through a temporary file.ariadne_data_test14 (an.objdecoded from an archive in memory), loader 215, runtime 250;world_geometry_test,world_bundle_test,world_buildings_testandnav_world_planes_test, which cover the directory loader through the reader;cvcgl_camera(the frame request),cvcgl_ariadne_data(a frame of the city's bounds, once),cvcgl_ari_golden, and the shadow and texture suites;austin_data.arioffscreen, framed by the document itself, withbuildings.glbread from memory.