# difference of 2 polyhedrons returns 2 planar shape - is this a bug?

2 messages
Open this post in threaded view
|
Report Content as Inappropriate

## difference of 2 polyhedrons returns 2 planar shape - is this a bug?

 This post has NOT been accepted by the mailing list yet. I have the following OpenSCAD code: difference(){ polyhedron(         points = [                 //0, 1, 2, 3,                 [000.0, 000.0, 000.0], [100.0, 000.0, 000.0], [100.0, 100.0, 000.0], [000.0, 100.0, 000.0],                 //4, 5, 6, 7                 [000.0-020.5, 000.0-020.5, 050.0], [100.0+020.5, 000.0-020.5, 050.0], [100.0+020.5, 100.0+020.5, 050.0], [000.0-020.5, 100.0+020.5, 050]                 ],         faces = [                 [0,1,2,3],                 [0,1,5,4], [1,2,6,5],                 [2,3,7,6], [3,0,4,7],                 [4,5,6,7]                 ],         convexity = 1); translate([000.0, 000.0, 010.0]) { polyhedron(         points = [                 //0, 1, 2, 3,                 [000.0, 000.0, 000.0], [100.0, 000.0, 000.0], [100.0, 100.0, 000.0], [000.0, 100.0, 000.0],                 //4, 5, 6, 7                 [000.0-000.0, 000.0-000.0, 050.0], [100.0+000.0, 000.0-000.0, 050.0], [100.0+000.0, 100.0+000.0, 050.0], [000.0-000.0, 100.0+000.0, 050]                 ],         faces = [                 [0,1,2,3],                 [0,1,5,4], [1,2,6,5],                 [2,3,7,6], [3,0,4,7],                 [4,5,6,7]                 ],         convexity = 1); }; } I expect an indent into the first polyhedron.   But I got the following planar shapes.   Is this a bug or there is a mistake in my code? If I do a sum, the result is as expected.