shapesmith.deprecated icon indicating copy to clipboard operation
shapesmith.deprecated copied to clipboard

edge line has different tessellation to face

Open splace opened this issue 13 years ago • 4 comments

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 avatar Feb 15 '12 00:02 splace

image on user news group

splace avatar Feb 15 '12 00:02 splace

Screenshot

bjnortier avatar Feb 15 '12 09:02 bjnortier

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.

bjnortier avatar Feb 15 '12 10:02 bjnortier

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.

splace avatar Feb 15 '12 18:02 splace