Mitering bug: PathLayer produces uneven strokes if the path has acute angles
See original GitHub issueDeck.gl verson: 46add427dd7d2f132f5699e38edcc90802f3fc30 (dev
branch)
Steps to reproduce
- Create a
PathLayer
as follows:
const path = [[-81.29868341618506,41.1053559416184],[-80.97694,41.10014],[-80.82915,41.10922],[-80.84265,41.11511],[-80.76570077085131,41.05483762281574]]
const layer = new PathLayer({
data: [{path}],
opacity: 1,
miterLimit: 1,
strokeWidth: 6e3
})
- Zoom in on Ohio
Expected result
Smooth path.
Actual result
Uneven-width path. See screenshot above.
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (7 by maintainers)
Top Results From Across the Web
Mitering bug: PathLayer produces uneven strokes if the path ...
It's meant to limit super long corners created by sharp angles. In other words any corner with angle smaller than asin(1 / miterLimit)...
Read more >What's New - deck.gl
Layer instances now expose a new member isLoaded . PathLayer 's joint calculation is improved when using with short line segments and extreme...
Read more >mapdeck: Interactive Maps Using 'Mapbox GL JS' and 'Deck.gl'
Description Provides a mechanism to plot an interactive map using 'Mapbox GL' ... code will error as there will be an uneven number...
Read more >Download the latest Sketch software updates
Find all the latest releases, updates and bug fixes for the Sketch Mac App here. See what's new and download older builds.
Read more >Enhanced Stylized Line Art for Pattern Design in Adobe ...
What I'm finding is that the offset path is too heavy for the line, which tells me that probably these little swirly lines...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dcposch the PathLayer is already using pre-allocated typed arrays.
Unfortunately the current deck.gl layers are designed to be projection-agnostic, which means we do not know which side of the vertex is going to be an acute angle when we generate the attributes. I’m doing some experiments on this.
I can see your third suggestion having cool use cases, though utilizing depth test will disable opacity blending, thus breaking some other scenarios. Seems like this could be done easily by subclassing the layer and overriding the shader.
I think this issue is closed based on fixes from @Pessimistress