bjnortier / shapesmith.deprecated

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

edge line has different tessellation to face #27

Open splace opened 12 years ago

splace commented 12 years ago

when cut a cylinder from a cube, the edge and faces don't match.

on inspection the cylinder hole has 24 sides, while the edge 'highlight' line has 20 sides

splace commented 12 years ago

image on user news group

bjnortier commented 12 years ago

Screenshot

bjnortier commented 12 years ago

I'll explain how this works. The faces and edges are tesselated separately. In OpenCASCADE, you can mesh faces using a standard algorithm, then you can traverse the triangles in the mesh. To tesselate 1D wires, e.g. if you create a Bezier curve, there are no faces and it uses a deflection algorithm to discretize the wire.

I've use the same algorithm that is aimed at 1D objects to tesselate the edges of the solids for visualisation. It should be possible to re-use the face mesh for the edge tesselation by finding the triangles that are connected to the wire and using those.

splace commented 12 years ago

thanks, i did come to think it was just a visualisation effect more than anything fundamental, but posted just in case it wasn't.

i think it could just be marked as closed.