JustinSDK / dotSCAD

Reduce the burden of mathematics when playing OpenSCAD
https://openhome.cc/zh-tw/openscad/
GNU Lesser General Public License v3.0
784 stars 107 forks source link

shape_elipse is sometimes one point short because of floating point error #29

Closed jmpreuss closed 2 years ago

jmpreuss commented 2 years ago

For example if $fn=21 only 20 points are created.

I fixed with this hack, I'm sure there is a more graceful way. Original code line 19 for(a = 0; a <= a_end; a = a + step_a) quick fix for(a = 0; a <= a_end+0.0001; a = a + step_a) Thanks, Jason (@patterntoprint)

JustinSDK commented 2 years ago

fixed:

        for(i = [0:frags - 1]) 
        let(a = i * step_a)