Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skarab42/lw.svg-curves
SVG curves for LaserWeb
https://github.com/skarab42/lw.svg-curves
Last synced: 15 days ago
JSON representation
SVG curves for LaserWeb
- Host: GitHub
- URL: https://github.com/skarab42/lw.svg-curves
- Owner: skarab42
- License: mit
- Created: 2016-12-16T10:57:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-16T10:59:25.000Z (almost 8 years ago)
- Last Synced: 2024-10-07T09:04:48.350Z (about 1 month ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# lw.svg-curves
SVG curves for [LaserWeb/CNCWeb](https://github.com/LaserWeb/LaserWeb4).## Installation
Using NPM
```
npm install lw.svg-curves
```Using GIT
```
git clone https://github.com/lautr3k/lw.svg-curves.git
cd svg-curves
npm install
```Or download the last build from https://raw.githubusercontent.com/lautr3k/lw.svg-curves/master/dist/lw.svg-curves.js
```htmlvar curves = SVGCurves.Curves();
```
## Settings (all are optional)
```javascript
let settings = {
linear : true, // Linear trace mode
step : 0.01, // Step resolution if linear mode = false
resolution : 500, // Number of segments we use to approximate arc length
segmentLength: 0.1 // Segment length
}
```## Usages
```javascript
import curves from 'svg-curves'let tracer = new curves.Arc(settings) // Set settings for this instance
let coords = tracer.trace({ p1, rx, ry, angle, large, sweep, p2 })// Or mix settings in constructor
let tracer = new curves.CubicBezier({ p1, p2, p3, p4, linear: false })
let coords1 = tracer.trace({ step: 0.1 })
let coords2 = tracer.trace({ step: 0.2 })// new curves.QuadricBezier({ p1, p2, p3 })
```