metafizzy / zdog

Flat, round, designer-friendly pseudo-3D engine for canvas & SVG

Home Page:https://zzz.dog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Line across inside cylinder when fill is false

Coehill opened this issue · comments

Test case: https://codepen.io/coehill/pen/OJRGavP

When a cylinder is created that has fill: false, there is a line across the centre. It can be removed by setting the color to be the same as the background, however this turns the model into an ellipse.

Thanks for reporting this issue. I imagine you're looking for a hollow cylinder, which the Cylinder shape does not support 😢. Zdog's Cylinder works as a hack by rendering a the curved surface as a rectangle. Setting fill breaks this illusion.

If you do need to render a hollow cylinder, the closest solution would be to render multiple Rects rotated around a center point.

I appreciate the suggestion @desandro!. I decided to render multiple Ellipses stacked on the z-axis which worked for my purposes.