Repository navigation
feat(editor): see a lidar tile in the scene, and turn it into ground (p7-s3) (#243) - #493
Merged
Merged
Conversation
…(p7-s3) The editor half of #243. A point cloud becomes the third ReferenceLayerKind, imported with File > Import > Point Cloud... and turned into terrain with Edit > Terrain > Seed from Point Cloud... Everything Layer 2 already guarantees is inherited unchanged: the relative-path contract, re-derivation when the frame changes, the per-entry sidecar tolerance, and the ruling that adding a layer is not an undoable command. Seeding terrain is, and goes through the same edit::set_terrain_field the DEM and elevation-raster paths use, so it is one undo entry. Two things a cloud does NOT inherit from an imagery underlay: - It is not flattened. Vectors and rasters are backdrops drawn at a fixed height; a cloud has real Z and draws depth-sorted with the scene, because its heights are why it was imported at all. - Its vertices stay in the cloud's own frame, with the origin carried as the draw's single instance matrix. Baking the origin into the vertex buffer would put a scene-scale value back into a float and reintroduce the terracing the offset representation exists to prevent -- the same defect the kernel guards, one layer further out. THE PRIMITIVE PATH IS NOW A SWITCH. Drawing points needed a third PrimitiveKind, and the renderer chose its GL primitive with a two-way ternary: `kind == Triangles ? kTriangles : kLines`. A third enumerator added without touching that line would have drawn the cloud as LINE SEGMENTS BETWEEN CONSECUTIVE POINTS -- silently, no warning, no error. Both that site and the two-way branch in the layer bounds are switches now, and a named test pins each. THE SIDECAR'S `kind` STOPS BEING A BOOL. It is the same enum the runtime uses, so a third spelling cannot exist in one and not the other. Older sidecars carry only "vector" and "raster" and load unchanged; an unknown spelling still reads as a raster with a warning rather than dropping the layer. ALSO WIRES UP A PATH THAT SHIPPED DEAD. Document::refit_reference_layers() was added by #242 and called from nowhere: reopening a scene re-derived its layers, but changing the georeference LIVE left them over the wrong ground. GW-2 step 31 asks a hand-runner to check exactly that, and its pass criterion already said a build which mishandles it fails the run -- so the gap was written down before it was closed. #243 would otherwise have added a third layer kind inheriting the same dead path. GW-2 gains steps 34-37 and three pass criteria, the sharpest being that the cloud and the imagery must land on each other: they are read by different parsers but share one CrsTransform, so a visible offset between them is a projection bug and this is the cheapest place in the workflow to notice one. Closes #243.
6 of 18 tasks
Both arrive transitively through libc++ on macOS and not through Linux clang, which is exactly how #492 shipped a green local build that broke CI on the same class of omission.
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.
The editor half of #243 (p7-s3), on top of the kernel that landed in #492.
A point cloud becomes the third
ReferenceLayerKind, imported withFile ▸ Import ▸ Point Cloud… and turned into terrain with
Edit ▸ Terrain ▸ Seed from Point Cloud….
Everything Layer 2 already guarantees is inherited unchanged: the relative-path
contract, re-derivation when the frame changes, the per-entry sidecar tolerance,
and the ruling that adding a layer is not an undoable command. Seeding
terrain is, and goes through the same
edit::set_terrain_fieldthe DEM andelevation-raster paths use — one undo entry, every p5-s2 invariant inherited.
Two things a cloud does not inherit from an imagery underlay
It is not flattened. Vectors and rasters are backdrops drawn at a fixed
height just above the ground. A cloud has real Z and draws depth-sorted with the
scene, because its heights are the reason it was imported at all.
Its vertices stay in the cloud's own frame, with
PointCloud::origintravelling as the draw's single
InstanceDatamodel matrix. Baking the origininto the vertex buffer would put a scene-scale value back into a float and
reintroduce exactly the terracing the offset representation exists to prevent —
the same defect the kernel's own precision test guards, one layer further out.
Per-point colour needed no vertex-format change: each point's normalised height
goes in
uv.xand a generated 256×1 ramp is sampled through the existingMaterial::base_colorpath.The primitive path is now a switch
Drawing points needed a third
PrimitiveKind, and the renderer chose its GLprimitive with a two-way ternary —
kind == Triangles ? kTriangles : kLines.A third enumerator added without touching that line would have drawn the cloud as
line segments between consecutive points: silently, no warning, no error,
just garbage. Both that site and the two-way branch in the layer-bounds
computation are switches now, and a named test pins each.
The sidecar's
kindstops being a boolSceneReferenceLayer::vectorbecomes the sameReferenceLayerKindthe runtimeuses, so a third spelling cannot exist in one and not the other. Sidecars written
before this carry only
"vector"and"raster"and load unchanged; an unknownspelling still reads as a raster with a warning rather than dropping the layer.
★ It also wires up a path that shipped dead
Document::refit_reference_layers()was added by #242 and called fromnowhere. Reopening a scene re-derived its layers, but changing the georeference
live left them wherever the old frame had put them — over the wrong ground,
with no warning.
GW-2 step 31 asks a hand-runner to check exactly this, and its pass criterion
already said a build that mishandles it fails the run. So the gap was written
down before it was closed. #243 would otherwise have added a third layer kind
inheriting the same dead path.
Docs
imagery must land on each other — they are read by different parsers but
share one
CrsTransform, so a visible offset between them is a projection bugin one of the two, and this is the cheapest place in the whole workflow to
notice one.
docs/domain/gis.mdgains the editor half of the point-cloud section.CHANGELOG.mdunder[Unreleased] ### Added, written from the shippedtr()strings.
Verification
cmake --build --preset ci-macos(-Werror) clean;ctest --preset ci-macos2627/2627.
findings.
git ls-files '*.cpp' '*.hpp' | xargs clang-format --dry-run --Werrorclean(CI's exact command).
Sabotage matrix — six neutralisations, each rebuilt and re-run
Runtime neutralisations rather than deletions, each echoing the build's exit code
so a sabotage that failed to compile cannot report green off a stale binary. All
six fired on the first attempt.
ApplyingANewFrameReDerivesTheImportedLayersLines— what the old two-way ternary drewPointsAreNotDrawnAsLinesPositionsStayInTheCloudsOwnFrame"raster"RoundTripsThroughTheSceneContainerImportingALidarTilePlacesItAndReportsWhatItRead,AChangedGeoreferenceReDerivesACloudToo,ApplyingANewFrameReDerivesTheImportedLayersAFlatCloudDoesNotDivideByItsOwnZeroRangeCloses #243. Pillar P7, epic #256.