bjnortier / shapesmith.deprecated

Open source HTML5 3D modelling
http://www.shapesmith.net
Other
160 stars 25 forks source link

internal surfaces missing from nested subtraction #48

Open splace opened 12 years ago

splace commented 12 years ago

this json ;

[{"type":"subtract","children":[{"type":"cylinder","parameters":{"r":3,"h":14},"children":[],"transforms":[{"type":"rotate","origin":{"x":8,"y":13,"z":7},"parameters":{"u":0,"v":1,"w":0,"angle":90,"n":0}},{"type":"translate","origin":{"x":8,"y":13,"z":0},"parameters":{"u":-8,"v":-13,"w":-1,"n":0}}],"origin":{"x":8,"y":13,"z":0}},{"type":"subtract","children":[{"type":"sphere","parameters":{"r":4},"children":[],"transforms":[],"origin":{"x":0,"y":0,"z":7}},{"type":"cuboid","parameters":{"u":10,"v":10,"w":10},"origin":{"x":-5,"y":-5,"z":0}}]}]}]

produces this for me;

missing inside faces

bjnortier commented 12 years ago

The STL is also wrong so it doesn't look like a rendering issue. Could be a OpenCASCADE issue

splace commented 12 years ago

changing sphere radius to 4.0001 fixes problem. (or 3.9999)

seems like someone didn't consider what to do with an exact equality somewhere.

whats wrong with the STL?

bjnortier commented 12 years ago

The STL only had the triangles of the outside cube, as per the rendered image.