โ0โ width for box renders as โ1โ width
Describe the bug or feature request in detail.
When creating a box
new THREE.BoxGeometry(opening.geometry.xLength, opening.geometry.yLength, opening.geometry.zLength)
when you make a 0 width box.
new THREE.BoxGeometry(0, 1, 1)
It renders on the screen with 1 as width. I think it should not render anything. Is this a bug of three.js?.
r106
The dimensions passed to the constructor of BoxGeometry
or BoxBufferGeometry
must be non-negative (EDIT) positive.
three.js does not validate function, or constructor, arguments.
function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments, depthSegments ) {
...
width = width || 1;
height = height || 1;
depth = depth || 1;
}
Seems intentional to me
@WestLangley 0 is a non-negative value. However, my question is as @samipe says. Is it really intentional?. Who can confirm that?.
@sebasecheverry Oops. Sorry, I meant _positive_.
If zeros are allowed as a dimension, the normals will be incorrect. So, additional changes would be required.
Degenerate triangles would also occur, unless there were further modifications to the code.
Cube with 0 width makes no sense. Use a rectangle instead.
Use a rectangle instead.
In our case THREE.PlaneBufferGeometry.
Most helpful comment
In our case THREE.PlaneBufferGeometry.