1 | # @jscad/svg-deserializer
|
2 |
|
3 | > Deserializer of SVG data to JSCAD scripts or geometries
|
4 |
|
5 | [![NPM version](https://badge.fury.io/js/%40jscad%2Fsvg-deserializer.svg)](https://badge.fury.io/js/%40jscad%2Fsvg-deserializer)
|
6 | [![Build Status](https://travis-ci.org/jscad/io.svg)](https://travis-ci.org/jscad/svg-deserializer)
|
7 |
|
8 | ## Overview
|
9 |
|
10 | This deserializer converts raw SVG formatted data (files) to JSCAD scripts or geometries.
|
11 |
|
12 | ## Table of Contents
|
13 |
|
14 | - [Installation](#installation)
|
15 | - [Usage](#usage)
|
16 | - [Contributing](#contributing)
|
17 | - [License](#license)
|
18 |
|
19 | ## Installation
|
20 |
|
21 | ```
|
22 | npm install @jscad/svg-deserializer
|
23 | ```
|
24 |
|
25 | ## Usage
|
26 |
|
27 | ```javascript
|
28 | const svgDeserializer = require('@jscad/svg-deserializer').deserialize
|
29 |
|
30 | const rawData = fs.readFileSync('PATH/TO/file.svg')
|
31 | const geometry = svgDeserializer.deserialize(rawData, 'file.svg', {output: 'geometry'})
|
32 |
|
33 | ```
|
34 |
|
35 | ## Contributing
|
36 |
|
37 | The various JSCAD packages and all source code are part of the JSCAD Organization, and maintained by a group of volunteers.
|
38 | We welcome and encourage anyone to pitch in but please take a moment to read the following guidelines.
|
39 |
|
40 | * If you want to submit a bug report please make sure to follow the [Reporting Issues](https://github.com/jscad/OpenJSCAD.org/wiki/Reporting-Issues) guide. Bug reports are accepted as [Issues](https://github.com/jscad/OpenJSCAD.org/issues/) via GitHub.
|
41 |
|
42 | * If you want to submit a change or a patch, please read the [Contributing Guide](../../CONTRIBUTING.md) . New contributions are accepted as [Pull Requests](https://github.com/jscad/OpenJSCAD.org/pulls/) via GithHub.
|
43 |
|
44 | * We only accept bug reports and pull requests on **GitHub**.
|
45 |
|
46 | * If you have a question about how to use JSCAD, then please start a conversation at the [JSCAD User Group](https://jscad.xyz/forum). You might find the answer in the [JSCAD.org User Guide](https://www.jscad.xyz/dokuwiki/doku.php).
|
47 |
|
48 | * If you have a change or new feature in mind, please start a conversation with the [Core Developers](https://jscad.xyz/forum) and start contributing changes.
|
49 |
|
50 | Small Note: If editing this README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
|
51 |
|
52 | ## License
|
53 |
|
54 | [The MIT License (MIT)](../../LICENSE)
|
55 | (unless specified otherwise)
|