1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/docs/lib3x-midpt_smooth.md

30 lines
789 B
Markdown
Raw Normal View History

2019-06-03 15:38:01 +08:00
# midpt_smooth
Given a 2D path, this function constructs a mid-point smoothed version by joining the mid-points of the lines of the path.
**Since:** 1.3
## Parameters
- `points` : The path points.
- `n` : Perform mid-point smoothing n times.
- `closed` : Is the points a 2D shape? If it's `true`, the function takes the last point and the first one to calculate a middle point. Default to `false`.
## Examples
2022-06-06 13:11:46 +08:00
use <polyline_join.scad>
use <shape_taiwan.scad>
use <midpt_smooth.scad>
2019-06-03 15:38:01 +08:00
taiwan = shape_taiwan(50);
smoothed = midpt_smooth(taiwan, 20, true);
2022-04-06 17:44:11 +08:00
translate([0, 0, 0])
polyline_join(taiwan)
circle(.125);
#translate([10, 0, 0])
polyline_join(smoothed)
circle(.125);
2019-06-03 15:38:01 +08:00
2021-02-24 21:09:54 +08:00
![midpt_smooth](images/lib3x-midpt_smooth-1.JPG)