A constraint-based 2D Sketching tool - View on Github Pages
Functionality is planned to match basic Solidworks sketches containing Points, Lines, Circles, and Arcs. Most of Solidworks' relations are currently supported, with the remaining to be implemented soon.
Examples:
Supported relations
- Horizontal
- Vertical
- Colinear
- Tangent Line
- Tangent Circle
- Concentric
- Midpoint
- Intersection
- Coincident on Point
- Coincident on Line
- Coincident on Circle
- Radius Equal
- Line Length Equal
Missing relations
- Perpendicular
- Parallel
- Fix / Lock Entity
Protractr is composed of two main modules:
gcs
is used to describe and solve geometric sketches, which are composed of figures and relations.ui
displays the current sketch and allows a user to modify it
To get started:
-
Clone this repo, and
cd
into it -
Run
npm install
-
Make changes to the TypeScript source. This should be done under the
scripts
directory. -
To test your changes, run:
npm run build
You should then see that the file
dist/bundle.js
has been created/updated. This is a single JavaScript file combining all the compiled TypeScript. To view your changes, openindex.html
in a browser. -
To make a new release on Github Pages, first commit all local changes. Then run
release.sh
. This will recompiledist/bundle.js
, as well as generate the docs. Then, the changes will be moved to thegh-pages
branch and pushed to Github.