From: daid Date: Tue, 20 Mar 2012 17:00:53 +0000 (+0100) Subject: Change the way intersection warnings are reported, so we actually know where they... X-Git-Tag: RC1~44 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3ca5462fb8877710059aa4bb26dbd87c706de903;p=cura.git Change the way intersection warnings are reported, so we actually know where they happened and so we can show them. --- diff --git a/SkeinPyPy/fabmetheus_utilities/geometry/solids/triangle_mesh.py b/SkeinPyPy/fabmetheus_utilities/geometry/solids/triangle_mesh.py index a738c41f..9bf210d4 100644 --- a/SkeinPyPy/fabmetheus_utilities/geometry/solids/triangle_mesh.py +++ b/SkeinPyPy/fabmetheus_utilities/geometry/solids/triangle_mesh.py @@ -441,11 +441,18 @@ def getLoopsFromCorrectMesh( edges, faces, vertexes, z ): loops = [] while isPathAdded( edges, faces, loops, remainingEdgeTable, vertexes, z ): pass - if euclidean.isLoopListIntersecting(loops): - print('Warning, the triangle mesh slice intersects itself in getLoopsFromCorrectMesh in triangle_mesh.') - print('Something will still be printed, but there is no guarantee that it will be the correct shape.') - print('Once the gcode is saved, you should check over the layer with a z of:') - print(z) + + warning = False + for idx in xrange(0, len(loops)-1): + loop = loops[idx] + p0 = loop[-1] + for p1 in loop: + if euclidean.isLineIntersectingLoops(loops[idx+1:], p0, p1): + print('Warning, the triangle mesh slice intersects itself in getLoopsFromCorrectMesh in triangle_mesh.') + print('Model error(intersect): (%f, %f, %f) (%f, %f, %f)' % (p0.real, p0.imag, z, p1.real, p1.imag, z)) + warning = True + p0 = p1 + if warning: return [] return loops # untouchables = []