Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1# points-on-curve2 3This package calculate the points on a curve with a certain tolerance. It can also simplify the shape to use fewer points. 4This can really be useful when estimating lines/polygons for curves in WebGL or for Hit/Collision detections. 5 6## Install7 8From npm9 10```11npm install --save points-on-curve12```13 14The package is distributed as an ES6 module. 15 16## API17 18### pointsOnBezierCurves(points: Point[], tolerance?: number, distance?: number): Point[]19 20You pass in the points representing a bezier curve. Each point is an array of two numbers e.g. `[100, 123]`.21 22The points can also be a set of continuous curves where the last poing on the `Nth` curve acts as the first point of the next. 23 24```javascript25import { pointsOnBezierCurves } from 'points-on-curve';26 27const curve = [[70,240],[145,60],[275,90],[300,230]];28const points = pointsOnBezierCurves(curve);29// plotPoints(points);30```31 3233 34Same can be rendered with more **tolerance** (default value is 0.15):35 36```javascript37const points = pointsOnBezierCurves(curve, 0.7);38```3940 41Note that this method does not accept the number of points to render, but takes in a tolerance level which allows for better distribution of points. 42 43The value of **tolerance** can be between 0 and 1. It is used to decide how many points are needed in a section of the curve. The algorithm determined the *flatness* of a section of the curve and compares it to the *tolerance* level, if less flat, the segment gets further divided into 2 segments. 44 45 46#### Simplifying path47 48Based on the tolerance alone, this algorithm nicely provides enough points to represent a curve. It does not, however, efficiently get rid of unneeded points. The second *optional* argument in function, **distance** helps with that. If a `distance` value is provided, the method uses the [Ramer–Douglas–Peucker algorithm](https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm) to reduce the points. 49 50```javascript51const points = pointsOnBezierCurves(curve, 0.2, 0.15);52```53 54Following are the points generated with distance values of `0.15`, `0.75`, `1.5`, and `3.0`55 5657585960 61### curveToBezier(pointsIn: Point[]): Point[]62 63Sometimes it's hard to think of shape as a set of cubic bezier curves, each curve with 2 controls points. It is simple to just think of them as a curve passing through a set of points. 64 65This method turns those set of points to a set of points representing bezier curves.66 67```javascript68import { curveToBezier } from 'points-on-curve/lib/curve-to-bezier.js';69 70const curvePoints = [71 [20, 240],72 [95, 69],73 [225, 90],74 [250, 180],75 [290, 220],76 [380, 80],77];78const bcurve = curveToBezier(curvePoints);79// .. Plot bcurve80```8182 83Now that we have bezier points, these could be passed to `pointsOnBezierCurves` function to get the points on the curve84 8586 87 88## License89[MIT License](https://github.com/pshihn/bezier-points/blob/master/LICENSE)90 91 