Skip to content

feat(extensions): add ColumnShapeExtension for per-instance bevel shapes#10003

Open
charlieforward9 wants to merge 1 commit intovisgl:masterfrom
NEW-HEAT:feat/column-shape-extension
Open

feat(extensions): add ColumnShapeExtension for per-instance bevel shapes#10003
charlieforward9 wants to merge 1 commit intovisgl:masterfrom
NEW-HEAT:feat/column-shape-extension

Conversation

@charlieforward9
Copy link
Collaborator

@charlieforward9 charlieforward9 commented Feb 9, 2026

Summary

Closes #9942

Adds a new ColumnShapeExtension to @deck.gl/extensions that enables per-instance dome, cone, and custom bevel shapes on ColumnLayer, with per-instance radius multipliers.

This is a non-invasive LayerExtension approach — it does not modify ColumnLayer internals. Instead it:

  • Injects shader hooks (DECKGL_FILTER_SIZE, #main-end) for GPU-side vertex transformation
  • Monkey-patches getGeometry to swap in dome-enabled geometry with concentric bevel rings and smooth normals
  • Adds 4 instanced attributes (instanceBevelSegs, instanceBevelHeights, instanceBevelBulge, instanceRadii)

Features

  • getBevel accessor: 'flat' | 'dome' | 'cone' | {segs, height, bulge} per instance
  • getRadius accessor: per-instance radius multiplier
  • Dome geometry with smooth spherical normals
  • Bulge effect for convex/concave dome surfaces
  • Correct Gouraud lighting recomputation for shaped caps

Use cases

  • Tree canopy visualization (dome caps sized by canopy area)
  • Architectural column rendering with styled tops
  • 3D bar charts with per-bar cap styles

Example

import {ColumnLayer} from '@deck.gl/layers';
import {ColumnShapeExtension} from '@deck.gl/extensions';

new ColumnLayer({
  data: TREES,
  extruded: true,
  extensions: [new ColumnShapeExtension()],
  getBevel: d => ({segs: 8, height: d.canopyHeight, bulge: 0.2}),
  getRadius: d => d.canopyRadius,
});
image

Prior art

Test plan

  • Unit tests added (test/modules/extensions/column-shape.spec.ts)
  • API documentation added (docs/api-reference/extensions/column-shape-extension.md)
  • Extension registered in @deck.gl/extensions index with type exports
  • Visual regression tests (render test cases)
  • Manual testing with tree canopy dataset

🤖 Generated with Claude Code

…pes and radius scaling

Adds a new LayerExtension that enables per-instance dome, cone, and custom
bevel shapes on ColumnLayer columns, with per-instance radius multipliers.

Features:
- getBevel accessor: 'flat' | 'dome' | 'cone' | {segs, height, bulge}
- getRadius accessor: per-instance radius multiplier
- Dome geometry with smooth normals via spherical coordinates
- Bulge effect for convex/concave dome surfaces
- Shader-based vertex transformation for correct elevation/lighting

Use cases: tree canopy visualization, architectural columns, styled 3D bar charts.

Includes documentation, type exports, and unit tests.
@charlieforward9
Copy link
Collaborator Author

@chrisgervang @felixpalmer I cannot add reviewers so tagging for visibility.

@felixpalmer
Copy link
Collaborator

I think the sweet spot for the API is as outlined here: #9942 (comment). This adds a general purpose set of styling options, without impacting overall performance and as such I think a good argument can be made why capShape should be added to ColumnLayer. I think this will cover the majority of use-cases out there. For visualizing more complex objects (like tree canopies), ScenegraphLayer is the way to go

While I really like the layer you've made here, I just think it is too specific to be included in the deck.gl package - implementing it via an Extension doesn't change that

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.

[RFC] ColumnLayer: getBevel and getRadius accessors

2 participants

Comments