Esempio n. 1
0
def getLoopsFromCorrectMesh(edges, faces, vertexes, z):
    "Get loops from a carve of a correct mesh."
    remainingEdgeTable = getRemainingEdgeTable(edges, vertexes, z)
    remainingValues = remainingEdgeTable.values()
    for edge in remainingValues:
        if len(edge.faceIndexes) < 2:
            print(
                'This should never happen, there is a hole in the triangle mesh, each edge should have two faces.'
            )
            print(edge)
            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)
            return []
    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 trianglemesh.'
        )
        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)
        return []
    return loops
Esempio n. 2
0
	def getExtruderPaths( self, shouldPrintWarning, z ):
		"Get extruder loops."
		rotatedBoundaryLayer = euclidean.RotatedLoopLayer( z )
		visibleObjectLoopsList = booleansolid.getVisibleObjectLoopsList( self.importRadius, evaluate.getVisibleObjects( self.archivableObjects ), z )
		rotatedBoundaryLayer.loops = euclidean.getConcatenatedList( visibleObjectLoopsList )
		if euclidean.isLoopListIntersecting( rotatedBoundaryLayer.loops, z ):
			rotatedBoundaryLayer.loops = booleansolid.getLoopsUnified( self.importRadius, visibleObjectLoopsList )
			if shouldPrintWarning:
				print('Warning, the triangle mesh slice intersects itself.')
				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 )
		return rotatedBoundaryLayer
Esempio n. 3
0
def getEmptyZLoops(archivableObjects, importRadius, shouldPrintWarning, z, zoneArrangement):
	'Get loops at empty z level.'
	emptyZ = zoneArrangement.getEmptyZ(z)
	visibleObjects = evaluate.getVisibleObjects(archivableObjects)
	visibleObjectLoopsList = boolean_solid.getVisibleObjectLoopsList(importRadius, visibleObjects, emptyZ)
	loops = euclidean.getConcatenatedList(visibleObjectLoopsList)
	if euclidean.isLoopListIntersecting(loops):
		loops = boolean_solid.getLoopsUnion(importRadius, visibleObjectLoopsList)
		if shouldPrintWarning:
			print('Warning, the triangle mesh slice intersects itself in getExtruderPaths in boolean_geometry.')
			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)
	return loops
Esempio n. 4
0
def getEmptyZLoops(archivableObjects, importRadius, shouldPrintWarning, z, zoneArrangement):
	'Get loops at empty z level.'
	emptyZ = zoneArrangement.getEmptyZ(z)
	visibleObjects = evaluate.getVisibleObjects(archivableObjects)
	visibleObjectLoopsList = boolean_solid.getVisibleObjectLoopsList(importRadius, visibleObjects, emptyZ)
	loops = euclidean.getConcatenatedList(visibleObjectLoopsList)
	if euclidean.isLoopListIntersecting(loops):
		loops = boolean_solid.getLoopsUnion(importRadius, visibleObjectLoopsList)
		if shouldPrintWarning:
			print('Warning, the triangle mesh slice intersects itself in getExtruderPaths in boolean_geometry.')
			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)
	return loops
Esempio n. 5
0
	def getEmptyZExtruderPaths( self, shouldPrintWarning, z ):
		"Get extruder loops."
		z = trianglemesh.getEmptyZ(self, z)
		rotatedBoundaryLayer = euclidean.RotatedLoopLayer(z)
		visibleObjectLoopsList = booleansolid.getVisibleObjectLoopsList( self.importRadius, evaluate.getVisibleObjects(self.archivableObjects), z )
		rotatedBoundaryLayer.loops = euclidean.getConcatenatedList( visibleObjectLoopsList )
		if euclidean.isLoopListIntersecting(rotatedBoundaryLayer.loops):
			rotatedBoundaryLayer.loops = booleansolid.getLoopsUnified(self.importRadius, visibleObjectLoopsList)
			if shouldPrintWarning:
				print('Warning, the triangle mesh slice intersects itself in getExtruderPaths in boolean_geometry.')
				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)
		return rotatedBoundaryLayer
Esempio n. 6
0
def getLoopsFromCorrectMesh( edges, faces, vertices, z ):
	"Get loops from a carve of a correct mesh."
	remainingEdgeTable = getRemainingEdgeTable( edges, vertices, z )
	remainingValues = remainingEdgeTable.values()
	for edge in remainingValues:
		if len( edge.faceIndexes ) < 2:
			print( 'This should never happen, there is a hole in the triangle mesh, each edge should have two faces.' )
			print( edge )
			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 )
			return []
	loops = []
	while isPathAdded( edges, faces, loops, remainingEdgeTable, vertices, z ):
		pass
	if euclidean.isLoopListIntersecting( loops, z ):
		print( 'Warning, the triangle mesh slice intersects itself.' )
		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 )
		return []
	return loops