예제 #1
0
파일: widen.py 프로젝트: Spacexula/SFACT
def getWidenedLoop(loop, loopList, outsetLoop, radius):
	'Get the widened loop.'
	intersectingWithinLoops = getIntersectingWithinLoops(loop, loopList, outsetLoop)
	if len(intersectingWithinLoops) < 1:
		return loop
	loopsUnified = boolean_solid.getLoopsUnified(radius, [[loop], intersectingWithinLoops])
	if len(loopsUnified) < 1:
		return loop
	return euclidean.getLargestLoop(loopsUnified)
예제 #2
0
def getWidenedLoop(loop, loopList, outsetLoop, radius):
    "Get the widened loop."
    intersectingWithinLoops = getIntersectingWithinLoops(
        loop, loopList, outsetLoop)
    if len(intersectingWithinLoops) < 1:
        return loop
    loopsUnified = boolean_solid.getLoopsUnified(
        radius, [[loop], intersectingWithinLoops])
    if len(loopsUnified) < 1:
        return loop
    return euclidean.getLargestLoop(loopsUnified)
예제 #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.getLoopsUnified(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
예제 #4
0
	def getEmptyZExtruderPaths( self, shouldPrintWarning, z ):
		'Get extruder loops.'
		z = triangle_mesh.getEmptyZ(self, z)
		rotatedLoopLayer = euclidean.RotatedLoopLayer(z)
		visibleObjectLoopsList = boolean_solid.getVisibleObjectLoopsList( self.importRadius, evaluate.getVisibleObjects(self.archivableObjects), z )
		rotatedLoopLayer.loops = euclidean.getConcatenatedList( visibleObjectLoopsList )
		if euclidean.isLoopListIntersecting(rotatedLoopLayer.loops):
			rotatedLoopLayer.loops = boolean_solid.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 rotatedLoopLayer
예제 #5
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.getLoopsUnified(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