gkjohnson / three-bvh-csg

A flexible, memory compact, fast and dynamic CSG implementation on top of three-mesh-bvh
MIT License
548 stars 45 forks source link

Bounding box of csg geometry sometimes does not match the geometry (is much more bigger) #182

Closed btjacker closed 7 months ago

btjacker commented 7 months ago

Hi, the title says everything. If you visit the sandbox and display the console, you will see inputs for the geometry and the bounding box dimensions as three sees it:

0.45 0.45 0.3 w 1.0399999618530273 h 0.6951998419106007 l 1.2901498079299927 1 1 1 w 1.0001001192212104 h 1.0001001192212104 l 1.0001001192212104

Second line is ok, component with inputs 1,1,1 has bounding box with all dimensions 1 But component with inputs 0.45 0.45 0.3 has bigger bounding box which is wrong. This happens only for some inputs and for example if you change "const e" value, this also affects the bounding box.

I use react-three-csg with csg 0.0.10, but even if I update to 0.0.13 it seems to produce similar error. codesandbox

probably similar issue

gkjohnson commented 7 months ago

Can you please produce an example without react so it's easier to understand and investigate.

btjacker commented 7 months ago

I have never used bare threejs, could you please provide link to some sandbox with just simple addition or subtraction I could adapt. I have found only too complex examples.

gkjohnson commented 7 months ago

Sorry just the examples in this project and setup snippets in the README are what's easily available at the moment.

gkjohnson commented 7 months ago

This seems to have been fixed with v0.0.15 - though I cannot test with your react variant demo. Closing unless it looks like there's still an issue with this case.