Exemplo n.º 1
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
	'Get outset geometryOutput.'
	derivation = OutsetDerivation(elementNode, prefix)
	if derivation.radius == 0.0:
		return geometryOutput
	halfLayerHeight = 0.5 * derivation.radius
	importRadius = 0.5 * derivation.radius * setting.getImportCoarseness(elementNode)
	loopLayers = solid.getLoopLayersSetCopy(elementNode, geometryOutput, importRadius, derivation.radius)
	if len(loopLayers) == 0:
		return triangle_mesh.getMeldedPillarOutput([])
	triangleAltitude = math.sqrt(0.75) * derivation.radius
	loops = []
	vertexes = []
	for loopLayerIndex in xrange(1, len(loopLayers), 2):
		loopLayer = loopLayers[loopLayerIndex]
		loopLayer.loops[0] = intercircle.getLargestInsetLoopFromLoop(loopLayer.loops[0], triangleAltitude)
	z = loopLayers[0].z - derivation.radius
	for loopIndex in xrange(-2, len(loopLayers) + 2, 2):
		loopLists = [[solid.getLoopOrEmpty(loopIndex - 2, loopLayers)]]
		loopLists.append([solid.getLoopOrEmpty(loopIndex - 1, loopLayers)])
		loopLists.append([intercircle.getLargestInsetLoopFromLoop(solid.getLoopOrEmpty(loopIndex, loopLayers), -derivation.radius)])
		loopLists.append([solid.getLoopOrEmpty(loopIndex + 1, loopLayers)])
		loopLists.append([solid.getLoopOrEmpty(loopIndex + 2, loopLayers)])
		largestLoop = euclidean.getLargestLoop(boolean_solid.getLoopsUnion(importRadius, loopLists))
		triangle_mesh.addVector3Loop(largestLoop, loops, vertexes, z)
		z += derivation.radius
	return triangle_mesh.getMeldedPillarOutput(loops)
Exemplo n.º 2
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
    'Get outset geometryOutput.'
    derivation = OutsetDerivation(elementNode, prefix)
    if derivation.radius == 0.0:
        return geometryOutput
    halfLayerHeight = 0.5 * derivation.radius
    importRadius = 0.5 * derivation.radius * setting.getImportCoarseness(
        elementNode)
    loopLayers = solid.getLoopLayersSetCopy(elementNode, geometryOutput,
                                            importRadius, derivation.radius)
    if len(loopLayers) == 0:
        return triangle_mesh.getMeldedPillarOutput([])
    triangleAltitude = math.sqrt(0.75) * derivation.radius
    loops = []
    vertexes = []
    for loopLayerIndex in xrange(1, len(loopLayers), 2):
        loopLayer = loopLayers[loopLayerIndex]
        loopLayer.loops[0] = intercircle.getLargestInsetLoopFromLoop(
            loopLayer.loops[0], triangleAltitude)
    z = loopLayers[0].z - derivation.radius
    for loopIndex in xrange(-2, len(loopLayers) + 2, 2):
        loopLists = [[solid.getLoopOrEmpty(loopIndex - 2, loopLayers)]]
        loopLists.append([solid.getLoopOrEmpty(loopIndex - 1, loopLayers)])
        loopLists.append([
            intercircle.getLargestInsetLoopFromLoop(
                solid.getLoopOrEmpty(loopIndex, loopLayers),
                -derivation.radius)
        ])
        loopLists.append([solid.getLoopOrEmpty(loopIndex + 1, loopLayers)])
        loopLists.append([solid.getLoopOrEmpty(loopIndex + 2, loopLayers)])
        largestLoop = euclidean.getLargestLoop(
            boolean_solid.getLoopsUnion(importRadius, loopLists))
        triangle_mesh.addVector3Loop(largestLoop, loops, vertexes, z)
        z += derivation.radius
    return triangle_mesh.getMeldedPillarOutput(loops)
Exemplo n.º 3
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.getLoopsUnion(radius, [[loop], intersectingWithinLoops])
	if len(loopsUnified) < 1:
		return loop
	return euclidean.getLargestLoop(loopsUnified)
Exemplo n.º 4
0
def getWidenedLoops(loop, loopList, outsetLoop, radius):
	'Get the widened loop.'
	intersectingWithinLoops = getIntersectingWithinLoops(loop, loopList, outsetLoop)
	if len(intersectingWithinLoops) < 1:
		return [loop]
	loopsUnified = boolean_solid.getLoopsUnion(radius, [[loop], intersectingWithinLoops])
	if len(loopsUnified) < 1:
		return [loop]
	return loopsUnified
Exemplo n.º 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.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
Exemplo n.º 6
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