1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-04-20 22:21:52 +02:00
This commit is contained in:
Justin Lin 2019-06-03 15:38:01 +08:00
parent d904a0b629
commit ea39db6ca2
4 changed files with 26 additions and 17 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

26
docs/lib-midpt_smooth.md Normal file
View File

@ -0,0 +1,26 @@
# 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
include <hull_polyline2d.scad>;
include <shape_taiwan.scad>;
include <bijection_offset.scad>;
include <midpt_smooth.scad>;
taiwan = shape_taiwan(50);
smoothed = midpt_smooth(taiwan, 20, true);
translate([0, 0, 0]) hull_polyline2d(taiwan, .25);
#translate([10, 0, 0]) hull_polyline2d(smoothed, .25);
![midpt_smooth](images/lib-midpt_smooth-1.JPG)

View File

@ -1,14 +0,0 @@
include <hull_polyline2d.scad>;
include <shape_taiwan.scad>;
include <bijection_offset.scad>;
include <midpt_smooth.scad>;
taiwan = shape_taiwan(100, .5);
sm = midpt_smooth(taiwan, 1, true);
*translate([10, 0, 0]) hull_polyline2d(shape_taiwan(100), .1);
translate([10, 0, 0]) hull_polyline2d(sm, .1);
echo(len(taiwan));

View File

@ -1,6 +1,3 @@
midpt_smooth
midpt_smooth.scad
trim_shape
trim_shape_demo.scad