예제 #1
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
	'Get equated geometryOutput.'
	flippedGeometryOutput = triangle_mesh.getGeometryOutputCopy(geometryOutput)
	flip.flipPoints(elementNode, matrix.getVertexes(flippedGeometryOutput), prefix)
	if flip.getShouldReverse(elementNode, prefix):
		flippedFaces = face.getFaces(flippedGeometryOutput)
		for flippedFace in flippedFaces:
			flippedFace.vertexIndexes.reverse()
	return {'union' : {'shapes' : [flippedGeometryOutput, geometryOutput]}}
예제 #2
0
파일: mirror.py 프로젝트: Sciumo/SFACT
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement):
	"""Get equated geometryOutput."""
	flippedGeometryOutput = triangle_mesh.getGeometryOutputCopy(geometryOutput)
	flip.flipPoints(matrix.getVertexes(flippedGeometryOutput), prefix, xmlElement)
	if flip.getShouldReverse(prefix, xmlElement):
		flippedFaces = face.getFaces(flippedGeometryOutput)
		for flippedFace in flippedFaces:
			flippedFace.vertexIndexes.reverse()
	return {'union' : {'shapes' : [flippedGeometryOutput, geometryOutput]}}
예제 #3
0
def addNegativeSphere(derivation, negatives, x):
    'Add negative sphere at x.'
    radius = Vector3(derivation.radiusPlusClearance,
                     derivation.radiusPlusClearance,
                     derivation.radiusPlusClearance)
    sphereOutput = sphere.getGeometryOutput(
        radius, derivation.xmlElement.getCopyShallow())
    euclidean.translateVector3Path(matrix.getVertexes(sphereOutput),
                                   Vector3(x, 0.0, derivation.demiheight))
    negatives.append(sphereOutput)
예제 #4
0
파일: cylinder.py 프로젝트: folksjos/RepG
def addCylinderOutputByEndStart(endZ, inradiusComplex, outputs, sides, start, topOverBottom=1.0):
	'Add cylinder triangle mesh by endZ, inradius and start.'
	inradius = Vector3(inradiusComplex.real, inradiusComplex.imag, 0.5 * abs(endZ - start.z))
	cylinderOutput = getGeometryOutput(inradius, sides, topOverBottom)
	vertexes = matrix.getVertexes(cylinderOutput)
	if endZ < start.z:
		for vertex in vertexes:
			vertex.z = -vertex.z
	translation = Vector3(start.x, start.y, inradius.z + min(start.z, endZ))
	euclidean.translateVector3Path(vertexes, translation)
	outputs.append(cylinderOutput)
예제 #5
0
파일: cylinder.py 프로젝트: 3DNogi/SFACT
def addCylinderOutputByEndStart(endZ, inradiusComplex, outputs, sides, start, topOverBottom=1.0):
	'Add cylinder triangle mesh by endZ, inradius and start.'
	inradius = Vector3(inradiusComplex.real, inradiusComplex.imag, 0.5 * abs(endZ - start.z))
	cylinderOutput = getGeometryOutput(inradius, sides, topOverBottom)
	vertexes = matrix.getVertexes(cylinderOutput)
	if endZ < start.z:
		for vertex in vertexes:
			vertex.z = -vertex.z
	translation = Vector3(start.x, start.y, inradius.z + min(start.z, endZ))
	euclidean.translateVector3Path(vertexes, translation)
	outputs.append(cylinderOutput)
예제 #6
0
파일: _bottom.py 프로젝트: zaubara/Curation
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
	'Get bottomed geometryOutput.'
	derivation = BottomDerivation(elementNode, prefix)
	copyShallow = elementNode.getCopyShallow()
	solid.processElementNodeByGeometry(copyShallow, geometryOutput)
	targetMatrix = matrix.getBranchMatrixSetElementNode(elementNode)
	matrix.setElementNodeDictionaryMatrix(copyShallow, targetMatrix)
	minimumZ = boolean_geometry.getMinimumZ(copyShallow.xmlObject)
	copyShallow.parentNode.xmlObject.archivableObjects.remove(copyShallow.xmlObject)
	lift = derivation.altitude - minimumZ
	vertexes = matrix.getVertexes(geometryOutput)
	for vertex in vertexes:
		vertex.z += lift
	return geometryOutput
예제 #7
0
파일: _bottom.py 프로젝트: Ecifircas/SFACT
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
    "Get bottomed geometryOutput."
    derivation = BottomDerivation(elementNode, prefix)
    copyShallow = elementNode.getCopyShallow()
    solid.processElementNodeByGeometry(copyShallow, geometryOutput)
    targetMatrix = matrix.getBranchMatrixSetElementNode(elementNode)
    matrix.setElementNodeDictionaryMatrix(copyShallow, targetMatrix)
    minimumZ = boolean_geometry.getMinimumZ(copyShallow.xmlObject)
    copyShallow.parentNode.xmlObject.archivableObjects.remove(copyShallow.xmlObject)
    lift = derivation.altitude - minimumZ
    vertexes = matrix.getVertexes(geometryOutput)
    for vertex in vertexes:
        vertex.z += lift
    return geometryOutput
예제 #8
0
파일: _bottom.py 프로젝트: Sciumo/SFACT
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement):
	"""Get bottomed geometryOutput."""
	derivation = BottomDerivation(prefix, xmlElement)
	copyShallow = xmlElement.getCopyShallow()
	solid.processXMLElementByGeometry(geometryOutput, copyShallow)
	targetMatrix = matrix.getBranchMatrixSetXMLElement(xmlElement)
	matrix.setXMLElementDictionaryMatrix(targetMatrix, copyShallow)
	minimumZ = boolean_geometry.getMinimumZ(copyShallow.xmlObject)
	copyShallow.parent.xmlObject.archivableObjects.remove(copyShallow.xmlObject)
	lift = derivation.altitude - minimumZ
	vertexes = matrix.getVertexes(geometryOutput)
	for vertex in vertexes:
		vertex.z += lift
	return geometryOutput
예제 #9
0
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement):
    'Get bottomed geometryOutput.'
    derivation = BottomDerivation(prefix, xmlElement)
    copyShallow = xmlElement.getCopyShallow()
    solid.processXMLElementByGeometry(geometryOutput, copyShallow)
    targetMatrix = matrix.getBranchMatrixSetXMLElement(xmlElement)
    matrix.setXMLElementDictionaryMatrix(targetMatrix, copyShallow)
    minimumZ = boolean_geometry.getMinimumZ(copyShallow.xmlObject)
    copyShallow.parent.xmlObject.archivableObjects.remove(
        copyShallow.xmlObject)
    lift = derivation.altitude - minimumZ
    vertexes = matrix.getVertexes(geometryOutput)
    for vertex in vertexes:
        vertex.z += lift
    return geometryOutput
예제 #10
0
def translateNegativesPositives(negatives, positives, translation):
    'Translate the negatives and postives.'
    euclidean.translateVector3Path(matrix.getVertexes(negatives), translation)
    euclidean.translateVector3Path(matrix.getVertexes(positives), translation)
예제 #11
0
파일: transform.py 프로젝트: rkoeppl/SFACT
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement):
    """Get equated geometryOutput."""
    transformPoints(matrix.getVertexes(geometryOutput), prefix, xmlElement)
    return geometryOutput
예제 #12
0
 def transformGeometryOutput(self, geometryOutput):
     'Transform the geometry output by the local matrix4x4.'
     if self.getMatrix4X4() != None:
         matrix.transformVector3sByMatrix(
             self.getMatrix4X4().tetragrid,
             matrix.getVertexes(geometryOutput))
예제 #13
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
    "Get equated geometryOutput."
    equatePoints(elementNode, matrix.getVertexes(geometryOutput), prefix, None)
    return geometryOutput
예제 #14
0
파일: flip.py 프로젝트: 3DNogi/SFACT
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
	'Get equated geometryOutput.'
	flipPoints(elementNode, matrix.getVertexes(geometryOutput), prefix)
	return geometryOutput
예제 #15
0
파일: translate.py 프로젝트: 3DNogi/SFACT
def translateNegativesPositives(negatives, positives, translation):
	'Translate the negatives and postives.'
	euclidean.translateVector3Path(matrix.getVertexes(negatives), translation)
	euclidean.translateVector3Path(matrix.getVertexes(positives), translation)
예제 #16
0
def addNegativeSphere(derivation, negatives, x):
	'Add negative sphere at x.'
	radius = Vector3(derivation.radiusPlusClearance, derivation.radiusPlusClearance, derivation.radiusPlusClearance)
	sphereOutput = sphere.getGeometryOutput(derivation.elementNode.getCopyShallow(), radius)
	euclidean.translateVector3Path(matrix.getVertexes(sphereOutput), Vector3(x, 0.0, derivation.demiheight))
	negatives.append(sphereOutput)
예제 #17
0
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
    'Get equated geometryOutput.'
    flipPoints(elementNode, matrix.getVertexes(geometryOutput), prefix)
    return geometryOutput
예제 #18
0
	def transformGeometryOutput(self, geometryOutput):
		'Transform the geometry output by the local matrix4x4.'
		if self.getMatrix4X4() != None:
			matrix.transformVector3sByMatrix(self.getMatrix4X4().tetragrid, matrix.getVertexes(geometryOutput))
예제 #19
0
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement):
	'Get equated geometryOutput.'
	flipPoints(matrix.getVertexes(geometryOutput), prefix, xmlElement)
	return geometryOutput
예제 #20
0
파일: equation.py 프로젝트: Ademan/Cura
def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
	"Get equated geometryOutput."
	equatePoints(elementNode, matrix.getVertexes(geometryOutput), prefix, None)
	return geometryOutput
예제 #21
0
def getManipulatedGeometryOutput(geometryOutput, prefix, xmlElement):
    "Get equated geometryOutput."
    translatePoints(matrix.getVertexes(geometryOutput), prefix, xmlElement)
    return geometryOutput