Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverse function? #38

Open
SelaO opened this issue Jun 8, 2017 · 6 comments
Open

Inverse function? #38

SelaO opened this issue Jun 8, 2017 · 6 comments

Comments

@SelaO
Copy link

SelaO commented Jun 8, 2017

Where is the inverse function from the original CSG?

http://evanw.github.io/csg.js/docs/

@chandlerprall
Copy link
Owner

invert is present on any ThreeBSP.Node objects, the top-level one is the tree property on a ThreeBSP instance.

@SelaO
Copy link
Author

SelaO commented Jun 9, 2017

What is the difference between the tree and node?

@chandlerprall
Copy link
Owner

The tree property is a node, it just happens to be the top-level node and provides access to the entire BSP tree.

@SelaO
Copy link
Author

SelaO commented Jun 11, 2017

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.

@chandlerprall
Copy link
Owner

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?

@makc
Copy link

makc commented Dec 1, 2019

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants