Closed arpruss closed 9 years ago
Does it leave the gaps in between the lines or in the middle of lines?
Looks like the middle of the lines to me.
In that case we need a better 3d bresenham line algorithm (its the MinecraftDrawing.getLine function).
Yeah. I haven't seen the issue (yet) with the one I use in my Turtle class: https://github.com/arpruss/raspberryjammod/blob/master/python2-scripts/mcpipy/turtle.py Feel free to use it. It's just a direct Python translation of some public domain C++ code I found.
The drawLine function uses the same 3d version of the bresenham line algorithm that is in my turtle code. I believe that the algorithm has the potential to leave gaps but this is considered acceptable because it is fast. I'm going to leave it as it is for the time being.
I've seen some gaps in a line. See the attached screenshot (which also includes the code that makes for the gappy line). (For the record, that's running on raspberryjammod, but I hope that doesn't make a difference.)