/ src / ptf / ptf_bend.scad
ptf_bend.scad
 1  /**
 2  * ptf_bend.scad
 3  *
 4  * @copyright Justin Lin, 2020
 5  * @license https://opensource.org/licenses/lgpl-3.0.html
 6  *
 7  * @see https://openhome.cc/eGossip/OpenSCAD/lib3x-ptf_bend.html
 8  *
 9  **/ 
10  
11  function ptf_bend(size, point, radius, angle) = 
12      let(
13          // ignored: size.y,
14          x = is_undef(point.z) ? 0 : point.z,
15          a = angle / size.x * point.x,
16          r = radius + x
17      )
18      [r * cos(a), r * sin(a), point.y];