A constraint-based 2D Sketching tool - Hosted 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
scripts
directory. Note that thedist
directory is the product ofbrowserify
andtsc
, and you should not directly edit files there. -
To test your changes, run:
npm run recompile-typescript npm run browserify
You should then see that the file
dist/bundle.js
has been modified.
This is the final JavaScript file that the running application actually uses: a combination of all the JavaScript in the application, together with the node modules on which the application depends. -
When you are ready to commit a change, regenerate the docs:
npm run gen-docs
Then, commit the changes under
src
anddocs
, and plus the changes todist/bundle.js
. We commitdocs
anddist/bundle.js
because they are used by the GitHub Pages hosted production version of the site.