evanw / csg.js

Constructive solid geometry on meshes using BSP trees in JavaScript

Home Page:http://evanw.github.com/csg.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

There is stuff still left in the middle.

treeform opened this issue · comments

var a = CSG.cube();
var b = CSG.sphere({ radius: .4, stacks: 12 });
var c = CSG.cylinder({ radius: 0.9, start: [-1, 0, 0], end: [1, 0, 0] });
var d = CSG.cylinder({ radius: 0.3, start: [0, -1, 0], end: [0, 1, 0] });
var e = CSG.cylinder({ radius: 0.3, start: [0, 0, -1], end: [0, 0, 1] });
return a.subtract(b).subtract(c).subtract(d).subtract(e);

Thanks for finding this bug. Here's a simpler test case, which may be the root of the problem:

var a = CSG.cube();
var b = CSG.cylinder();
return a.subtract(b).union(b).subtract(b);