Skip to content

Commit 27c6e87

Browse files
committed
added demos to readme
1 parent f187ad1 commit 27c6e87

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ Example usage:
1010
var sphere = CSG.sphere({ radius: 1.3 });
1111
var polygons = cube.subtract(sphere).toPolygons();
1212

13-
## Documentation
13+
# Documentation
1414

1515
[Detailed documentation](http://evanw.github.com/csg.js/docs/) can be automatically generated using [Docco](http://jashkenas.github.com/docco/).
1616

17-
## Implementation Details
17+
# Demos
18+
19+
[CSG example from Wikipedia](http://evanw.github.com/csg.js/tests/wikipedia.html)
20+
[Coplanar polygon test cases](http://evanw.github.com/csg.js/tests/coplanar.html)
21+
22+
# Implementation Details
1823

1924
All CSG operations are implemented in terms of two functions, `clipTo()` and `invert()`, which remove parts of a BSP tree inside another BSP tree and swap solid and empty space, respectively. To find the union of `a` and `b`, we want to remove everything in `a` inside `b` and everything in `b` inside `a`, then combine polygons from `a` and `b` into one solid:
2025

@@ -33,6 +38,6 @@ The only tricky part is handling overlapping coplanar polygons in both trees. Th
3338

3439
Subtraction and intersection naturally follow from set operations. If union is `A | B`, subtraction is `A - B = ~(~A | B)` and intersection is `A & B = ~(~A | ~B)` where `~` is the complement operator.
3540

36-
## License
41+
# License
3742

3843
Copyright (c) 2011 Evan Wallace (http://madebyevan.com/), under the [MIT license](http://www.opensource.org/licenses/mit-license.php).

0 commit comments

Comments
 (0)