Change the way intersection warnings are reported, so we actually know where they happened and so we can show them.

This commit is contained in:
daid 2012-03-20 18:00:53 +01:00
parent e9c7135f5c
commit 3ca5462fb8

View File

@ -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 = []