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

refactor: use util/lerp.scad

This commit is contained in:
Justin Lin
2022-04-16 12:05:07 +08:00
parent 8dff911ab0
commit 2c7442a76a

View File

@@ -1,7 +1,7 @@
function _lerp(v1, v2, amt) = v1 + (v2 - v1) * amt;
use <../util/lerp.scad>;
function interpolated_pt(p0, p1, threshold) =
let(p = _lerp(p0, p1, (threshold - p0.z) / (p1.z - p0.z)))
let(p = lerp(p0, p1, (threshold - p0.z) / (p1.z - p0.z)))
[p.x, p.y, p.z];
/*