So I have a list of points in a 3D space, and I have a list triangles that show how each of them connect. I input both of these into BufferGeometry as attributes and it displays the shape just fine. In three.js it looks normal, and has all faces closed.
However, when I try to use it with three-bvh-csg I get nothing, and i have no idea why. I assume it could be because for some reason csg sees it as a non-manifold geometry, but I am not sure how to tell if that is the case, and if so how to fix that. Has anyone faced this issue before? Is there a solution?
Here is how I create this geometry:
export const CustomGeometry = () => {
return (
<bufferGeometry>
<bufferAttribute
attach='attributes-position'
array={new Float32Array([-17.696252822875977, 0, 19.3864688873291, -6.360003471374512, 0, -16.741426467895508, 21.877092361450195, 0, -9.136500358581543, 10.539518356323242, 0, 26.87751579284668, 0.8028643727302551, 14.598217010498047, 9.191112518310547, 3.376246452331543, 14.602235794067383, 1.003333330154419])}
count={6}
itemSize={3}
/>
<bufferAttribute
attach="index"
array={new Uint16Array([2, 3, 0, 0, 1, 2, 4, 3, 0, 4, 0, 1, 1, 5, 4, 5, 1, 2, 5, 2, 3, 3, 4, 5])}
count={24}
itemSize={1}
/>
</bufferGeometry>
)
}
And this is the very basic usage of three-bvh-csg, with the react wrapper react-three-csg:
const CsgGeometry= (props) => {
return (
<Geometry>
<Base scale={[20, 20, 20]}>
<boxGeometry/>
</Base>
<Addition>
<CustomGeometry/>
</Addition>
</Geometry>
)
}
And the error I get is this, which is what leads me to suspect it might be a manifold problem
Error: CSG Operations: Attribute uv not available on geometry.