Add cap prop to ColumnLayer for dome and cone top geometry#10038
Draft
Add cap prop to ColumnLayer for dome and cone top geometry#10038
cap prop to ColumnLayer for dome and cone top geometry#10038Conversation
Co-authored-by: charlieforward9 <62311337+charlieforward9@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add variable radius feature to columns in tree visualization
Add Feb 25, 2026
cap prop to ColumnLayer for dome and cone top geometry
Collaborator
|
Code looks reasonable at first blush... Something that could help motivate this:
|
Collaborator
|
@ibgreen This has been a evolving feature ive worked on across various branches and both this and the community repo - i decided to split it into the TreeLayer as per @felixpalmer feedback and keep the cap idea in the ColumnLayer |
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.
Adds a geometry-only
capprop toColumnLayerthat shapes the top of each column. No per-instance attributes — zero rendering overhead on instances.Change List
ColumnGeometry: Addedcap?: 'flat' | 'dome' | 'cone'toColumnGeometryProps. Whencapis not'flat'andextruded: true, replaces the flat top tessellation with a cap built from interleaved ring triangle strips:'cone'— 1 ring sweep to a single apex; degenerate apex vertices produce clean cone faces'dome'—max(2, round(diskResolution / 4))rings along a quarter-circle arc; smooth normals transition from outward at the base to(0,0,1)at the apexColumnLayer: Addedcapprop (default'flat') to_ColumnLayerPropsanddefaultProps; forwarded throughgetGeometry→ColumnGeometry; wired intoupdateStategeometry-regeneration checkTests: Added
ColumnGeometry#capspec covering vertex counts, apex position, side geometry preservation, andheight=0passthroughDocs: Added
capentry tocolumn-layer.mdOriginal prompt
This section details on the original issue you should resolve
<issue_title>[RFC] Trees</issue_title>
<issue_description>### Target Use Case
We started simply: in Leaflet, a CircleMarker was enough to show where each tree was. As we began extracting more structure—height, canopy area, density, fruit count, leaf color, and other derived metrics—we needed to communicate more than just location. We moved to deck.gl and adopted ColumnLayer, mapping height to a selected metric to give farmers an at-a-glance 3D view of their fields.
But a tree is more than a single scalar. It has a trunk and a canopy, a footprint and a volume, and a set of physical and biological traits that could all be visually encoded. I initially only wanted to add a dome-like bevel to the “gaps” in the field (viable row space with no tree), but while iterating on the bevel logic it became clear that there is no way today to vary the radius per column. Without per-instance radius, it’s hard to represent organic structure—canopy vs. trunk size, domed ground patches, tapered forms—and in practice the cap shape and the column radius need to be controlled together.
Proposal
I have #9933 as a functional prototype.
Yet, for discussion, I propose two opt-in accessors:
getRadius: per-instance base radius of the columngetBevel: per-instance cap profile (flat, dome, cone, or custom bevel parameters).The existing
radius, which I propose be renamed toradiusScale- consistent with theScatterplotLayer- remains as a global multiplier applied on top ofgetRadius.The effective radius becomes:
For backwards compatibility and zero-cost default behavior:
If
getRadiusis not provided, the layer follows the currentColumnLayerpath:getRadius(d) = 1radiusScale = 1000If
getRadiusis provided, the layer switches to an opt-in shader/attribute path that uses the supplied base radius and applies radiusScale as a multiplier.column-layer.tscolumn-layer-vertex.glsl.tsThis Gemini creation should help portray the bevel concept:
Finally, I want to thank @felixpalmer for challenging me to think thoroughly though this proposal. I understand its a big change, and these things have gotten easy to do with agentic yes-men, but I know true learning happens in discussions like this, with real human feedback and disagreement.
As a little plus, it would answer this 2020 discussion question: #4324</issue_description>
<agent_instructions>Take the original idea I made in #9933 and Felix's feedback for a simple cap shape modifier on the columnlayer and make that simple addition rather than making the complex tree shape - just a column cap.</agent_instructions>
Comments on the Issue (you are @copilot in this section)
@felixpalmer For your use case, could you not use `ScenegraphLayer` with a custom tree model and then vary the radius using `getScale`?My view on this proposal is that we should not add any new accessors - the
ColumnLayeris used by other layers for rendering and often many columns are drawn. Adding accessors would slow this down even if people we not to use the feature.I think the scope should be limited to adding a dome or cap purely by modifying the geometry as this will not impact performance but will give users a way to apply a different style to the columns.
@chrisgervang @Pessimistress @ibgreen for comment</comment_new>...
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.