Esempio n. 1
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
	'Get inset geometryOutput.'
	derivation = InsetDerivation(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)
	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)
	for loopLayerIndex in xrange(0, len(loopLayers), 2):
		loopLayer = loopLayers[loopLayerIndex]
		loopLists = [[solid.getLoopOrEmpty(loopLayerIndex - 2, loopLayers)]]
		loopLists.append([solid.getLoopOrEmpty(loopLayerIndex - 1, loopLayers)])
		loopLists.append([intercircle.getLargestInsetLoopFromLoop(loopLayer.loops[0], derivation.radius)])
		if evaluate.getEvaluatedBoolean(True, elementNode, prefix + 'insetTop'):
			loopLists.append([solid.getLoopOrEmpty(loopLayerIndex + 1, loopLayers)])
			loopLists.append([solid.getLoopOrEmpty(loopLayerIndex + 2, loopLayers)])
		largestLoop = euclidean.getLargestLoop(boolean_solid.getLoopsIntersection(importRadius, loopLists))
		triangle_mesh.addVector3Loop(largestLoop, loops, vertexes, loopLayer.z)
	if evaluate.getEvaluatedBoolean(False, elementNode, prefix + 'addExtraTopLayer') and len(loops) > 0:
		topLoop = loops[-1]
		vector3Loop = []
		loops.append(vector3Loop)
		z = topLoop[0].z + derivation.radius
		for point in topLoop:
			vector3Index = Vector3Index(len(vertexes), point.x, point.y, z)
			vector3Loop.append(vector3Index)
			vertexes.append(vector3Index)
	return triangle_mesh.getMeldedPillarOutput(loops)
Esempio 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)
Esempio n. 3
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)
Esempio n. 4
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
	'Get inset geometryOutput.'
	derivation = InsetDerivation(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)
	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)
	for loopLayerIndex in xrange(0, len(loopLayers), 2):
		loopLayer = loopLayers[loopLayerIndex]
		loopLists = [[solid.getLoopOrEmpty(loopLayerIndex - 2, loopLayers)]]
		loopLists.append([solid.getLoopOrEmpty(loopLayerIndex - 1, loopLayers)])
		loopLists.append([intercircle.getLargestInsetLoopFromLoop(loopLayer.loops[0], derivation.radius)])
		if evaluate.getEvaluatedBoolean(True, elementNode, prefix + 'insetTop'):
			loopLists.append([solid.getLoopOrEmpty(loopLayerIndex + 1, loopLayers)])
			loopLists.append([solid.getLoopOrEmpty(loopLayerIndex + 2, loopLayers)])
		largestLoop = euclidean.getLargestLoop(boolean_solid.getLoopsIntersection(importRadius, loopLists))
		triangle_mesh.addVector3Loop(largestLoop, loops, vertexes, loopLayer.z)
	if evaluate.getEvaluatedBoolean(False, elementNode, prefix + 'addExtraTopLayer') and len(loops) > 0:
		topLoop = loops[-1]
		vector3Loop = []
		loops.append(vector3Loop)
		z = topLoop[0].z + derivation.radius
		for point in topLoop:
			vector3Index = Vector3Index(len(vertexes), point.x, point.y, z)
			vector3Loop.append(vector3Index)
			vertexes.append(vector3Index)
	return triangle_mesh.getMeldedPillarOutput(loops)