2 Add material to support overhang or remove material at the overhang angle.
6 from __future__ import absolute_import
7 #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
10 from fabmetheus_utilities.geometry.creation import solid
11 from fabmetheus_utilities.geometry.geometry_tools import face
12 from fabmetheus_utilities.geometry.geometry_utilities import evaluate
13 from fabmetheus_utilities.geometry.geometry_utilities import matrix
14 from fabmetheus_utilities.geometry.manipulation_shapes import flip
15 from fabmetheus_utilities.geometry.solids import triangle_mesh
16 from fabmetheus_utilities.vector3 import Vector3
17 from fabmetheus_utilities import euclidean
20 __author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
21 __credits__ = 'Art of Illusion <http://www.artofillusion.org/>'
22 __date__ = '$Date: 2008/02/05 $'
23 __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
26 globalExecutionOrder = 200
29 def getManipulatedGeometryOutput(elementNode, geometryOutput, prefix):
30 'Get equated geometryOutput.'
31 flippedGeometryOutput = triangle_mesh.getGeometryOutputCopy(geometryOutput)
32 flip.flipPoints(elementNode, matrix.getVertexes(flippedGeometryOutput), prefix)
33 if flip.getShouldReverse(elementNode, prefix):
34 flippedFaces = face.getFaces(flippedGeometryOutput)
35 for flippedFace in flippedFaces:
36 flippedFace.vertexIndexes.reverse()
37 return {'union' : {'shapes' : [flippedGeometryOutput, geometryOutput]}}
39 def getManipulatedPaths(close, elementNode, loop, prefix, sideLength):
41 return [loop + flip.getFlippedLoop(elementNode, euclidean.getPathCopy(loop), prefix)]
43 def getNewDerivation(elementNode, prefix, sideLength):
45 return evaluate.EmptyObject()
47 def processElementNode(elementNode):
48 'Process the xml element.'
49 solid.processElementNodeByFunctionPair(elementNode, getManipulatedGeometryOutput, getManipulatedPaths)