Scribble JS presents a collection of sophisticated tools for creating 2D topologies from sets of polylines. It can be used to implement things like vector paintbrushes and geometric collision detection and representation for games.
Click on the links or the pictures to see the example working on the internet. I invite you to have as much fun as possible with these examples.
You may find the source code on Github at: https://github.com/Bryce-Summers/ScribbleJS For your own, projects please look at the source code for the example projects. To use Scribble.JS in your own project, you will only need the latest build file, which may be found here, along with a knowledge of the functionalities provided by this project.
git submodule init git submodule updateRunning these commands fetches the Bryce Data Structures code.
Please visit the following link to see a comprehensive development schedule for this project.
Bounding Volume Hierarchy Formation
Polyline Additive Drawing Tool
Cubic Curves - Bezier and Hermite
- Discretize them into polylines.
- Embed their associated discretized polylines using the polyline graph embedder.
- Convert Embedding faces back into curves.
- Draw them using the canvas or by drawing their discretized polylines.
- Automatically Embed complemented faces within the correct non-complemented face.
- Even - odd SVG path drawing.
Vector Graphics Editor
- Line Drawing
- Line Erasing
Self Intersecting Lines
- Supports non-crazy line drawing where the intersections are not close to each other.
- Numerical instabilities are still present. I really should get on to those...
- In a future update, nearby points will be combined into single points.
Drag Line Tool
- Points are created by dragging the mouse along a path, rather than by clicking.
- I now see that my topological update functions are non-optimized for large faces of the type that may be easily formed with this tool.
- I would like to test the performance of my BVH's now.
This will be a deeper dive into the capabilities of Scribble.JS, which will be written in the future, when I have some more free time.
- Polyline Sets to HalfedgeMesh
- Halfedge Erasing, with deletion of lonely vertices.
- Not yet fully ported and tested: The removal of trivial area tails.
- Not yet fully tested and ported: Shallow Merging of faces.
- Automatic Coloring of Faces.
- Proper Handling of Interior continents.
- TODO: Proper handling of incredibly degenerate geometric positionings.