block by enjalot 638ad00cdc053b35461f

3D Pie: god help my soul

Full Screen

I wanted to troll the datavis community by making a 3D pie chart from d3.svg.arc using the new d3.shape stuff. Unfortunately the THREE.js shape context isn’t similar enough to the canvas API to just work.

I used this tutorial to get my THREE extruding situation setup. I found transformSVGPath in this old gist but I’m not sure the original source.

In the end the paths generated by the arc function aren’t parsed properly if you use innerRadius and the whole thing stopped being fun anyway. Oh well.

Built with blockbuilder.org

index.html

svg2three.js