bezierSpline
描述
¥Description
Takes a line and returns a curved version by applying a 贝塞尔曲线样条函数 algorithm.
¥Takes a line and returns a curved version by applying a Bezier spline algorithm.
The bezier spline implementation is by Leszek Rybicki.
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
line | 特性<LineString> | 输入线串 |
options? | 对象 | 可选参数(默认 ) |
options.properties? | 对象 | Translate properties to output (default ) |
options.resolution? | number | time in milliseconds between points (default 10000) |
options.sharpness? | number | a measure of how curvy the path should be between splines (default 0.85) |
返回
¥Returns
特性<LineString> 曲线
¥Feature<LineString> curved line
示例
¥Examples
var line = turf.lineString([
[-76.091308, 18.427501],
[-76.695556, 18.729501],
[-76.552734, 19.40443],
[-74.61914, 19.134789],
[-73.652343, 20.07657],
[-73.157958, 20.210656],
]);
var curved = turf.bezierSpline(line);
安装
¥Installation
$ npm install @turf/bezier-spline
import { bezierSpline } from "@turf/bezier-spline";
const result = bezierSpline(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.bezierSpline(...);