ThreeCSG
ThreeCSG copied to clipboard
Inverse function?
Where is the inverse function from the original CSG?
http://evanw.github.io/csg.js/docs/
invert
is present on any ThreeBSP.Node objects, the top-level one is the tree
property on a ThreeBSP instance.
What is the difference between the tree and node?
The tree
property is a node, it just happens to be the top-level node and provides access to the entire BSP tree.
So how do you properly invert a geometry?
Doing:
const geometryCsg = new ThreeBSP(geometryThree);
geometryCsg..tree.invert(); // or geometryCsg..tree = geometryCsg..tree.invert();
geometryCsg.toGeometry();
or
let inv = geometryCsg.tree.invert();
let binv = new ThreeBSP(inv):
binv.toGeometry();
Just returns the same shape as before.
I'd expect your first code block (invert, convert to geometry) to work. Are you sure the material you're rendering with doesn't render both sides?
@SelaO
how do you properly invert a geometry?
isnt it simply flipping normals? or, in terms of buffer geometry, swapping vertices 3n and 3n+1