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
Contributor

@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
Contributor Author

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

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

1 participant

Comments