1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-09 08:16:50 +02:00

Add the point at the end for fractional number of segments

This commit is contained in:
Dmitry Frolov
2018-05-01 22:56:43 +07:00
parent 2a3596895f
commit 736b63a0aa

View File

@@ -54,8 +54,9 @@ function _bezier_curve_point(t, points) =
function bezier_curve(t_step, points) =
let(
pts = [ for(t = [0: t_step: 1])
_bezier_curve_point(t, points)
]
pts = concat([
for(t = [0: ceil(1 / t_step) - 1])
_bezier_curve_point(t * t_step, points)
], [_bezier_curve_point(1, points)])
)
len(points[0]) == 3 ? pts : [for(pt = pts) __to2d(pt)];