fabmetheus_utilities.solids.trianglemesh ($Date: 2008/02/05 $)
index
/home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/fabmetheus_utilities/solids/trianglemesh.py

Triangle Mesh holds the faces and edges of a triangular mesh.

It can read from and write to a GNU Triangulated Surface (.gts) file.

The following examples carve the GNU Triangulated Surface file Screw Holder Bottom.stl. The examples are run in a terminal in the folder which contains Screw Holder Bottom.stl and trianglemesh.py.


>python
Python 2.5.1 (r251:54863, Sep 22 2007, 01:43:31)
[GCC 4.2.1 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import carve
>>> carve.main()
File Screw Holder Bottom.stl is being carved.
The carved file is saved as Screw Holder Bottom_carve.gcode
It took 3 seconds to carve the file.


>>> carve.writeOutput( 'Screw Holder Bottom.stl' )
File Screw Holder Bottom.gcode is being carved.
The carved file is saved as Screw Holder Bottom_carve.gcode
It took 3 seconds to carve the file.


>>> carve.getGcode("
54 162 108 Number of Vertices,Number of Edges,Number of Faces
-5.800000000000001 5.341893939393939 4.017841892579603 Vertex Coordinates XYZ
5.800000000000001 5.341893939393939 4.017841892579603
..
many lines of GNU Triangulated Surface vertices, edges and faces
..
")

 
Modules
       
__init__
cmath
fabmetheus_utilities.euclidean
fabmetheus_utilities.solids.solid_tools.face
fabmetheus_utilities.gcodec
fabmetheus_utilities.solids.solid_utilities.geomancer
fabmetheus_utilities.intercircle
math
fabmetheus_utilities.solids.solid_tools.matrix4x4

 
Classes
       
fabmetheus_utilities.solids.group.Group(fabmetheus_utilities.solids.solid_tools.dictionary.Dictionary)
TriangleMesh
EdgePair
LoopArea

 
class EdgePair
     Methods defined here:
__init__(self)
Pair of edges on a face.
__repr__(self)
Get the string representation of this EdgePair.
getFromIndexesEdges(self, edgeIndexes, edges)
Initialize from edge indices.

 
class LoopArea
    Complex loop with an area.
 
  Methods defined here:
__init__(self, loop)
__repr__(self)
Get the string representation of this flat path.

 
class TriangleMesh(fabmetheus_utilities.solids.group.Group)
    A triangle mesh.
 
 
Method resolution order:
TriangleMesh
fabmetheus_utilities.solids.group.Group
fabmetheus_utilities.solids.solid_tools.dictionary.Dictionary

Methods defined here:
__init__(self)
Add empty lists.
addXMLSection(self, depth, output)
Add the xml section for this object.
createShape(self, matrixChain)
Create the shape.
getCarveCornerMaximum(self)
Get the corner maximum of the vertices.
getCarveCornerMinimum(self)
Get the corner minimum of the vertices.
getCarveLayerThickness(self)
Get the layer thickness.
getCarveRotatedBoundaryLayers(self)
Get the rotated boundary layers.
getInterpretationSuffix(self)
Return the suffix for a triangle mesh.
getLoops(self, importRadius, z)
Get loops sliced through shape.
getLoopsFromMesh(self, z)
Get loops from a carve of a mesh.
getVertices(self)
Get all vertices.
getZAddExtruderPaths(self, z)
Get next z and add extruder loops.
setCarveBridgeLayerThickness(self, bridgeLayerThickness)
Set the bridge layer thickness.  If the infill is not in the direction of the bridge, the bridge layer thickness should be given as None or not set at all.
setCarveImportRadius(self, importRadius)
Set the import radius.
setCarveIsCorrectMesh(self, isCorrectMesh)
Set the is correct mesh flag.
setCarveLayerThickness(self, layerThickness)
Set the layer thickness.
setEdgesForAllFaces(self)
Set the face edges of all the faces.
transformSetBottomTopEdges(self, matrixChain)
Create the shape.

Methods inherited from fabmetheus_utilities.solids.group.Group:
addXMLInnerSection(self, depth, output)
Add xml inner section for this object.
getVisible(self)
Get visible.

Methods inherited from fabmetheus_utilities.solids.solid_tools.dictionary.Dictionary:
__repr__(self)
Get the string representation of this object info.
addXML(self, depth, output)
Add xml for this object.
addXMLArchivableObjects(self, depth, output)
Add xml for this object.
getAttributeDictionary(self)
Get attribute table.
getType(self)
Get type.
getXMLClassName(self)
Get xml class name.
setToObjectAttributeDictionary(self)
Set the shape of this carvable object info.

 
Functions
       
addEdgePair(edgePairTable, edges, faceEdgeIndex, remainingEdgeIndex, remainingEdgeTable)
Add edge pair to the edge pair table.
addFacesFromConvex(faces, indexedLoop)
Add faces from a convex polygon.
addFacesFromConvexReversed(faces, indexedLoop)
Add faces from a reversed convex polygon.
addFacesFromLoops(faces, indexedLoops)
Add faces from loops.
addLoopToPointTable(loop, pointTable)
Add the points in the loop to the point table.
addPillarFromConvexLoops(faces, indexedLoops)
Add pillar from convex loops.
addPillarFromConvexLoopsGrids(faces, grids, indexedLoops)
Add pillar from convex loops and grids.
addPointsAtZ(edgePair, points, radius, vertices, z)
Add point complexes on the segment between the edge intersections with z.
addToZoneTable(point, shape)
Add point to the zone table.
addWithLeastLength(loops, point, shortestAdditionalLength)
Insert a point into a loop, at the index at which the loop would be shortest.
compareAreaAscending(loopArea, otherLoopArea)
Get comparison in order to sort loop areas in ascending order of area.
compareAreaDescending(loopArea, otherLoopArea)
Get comparison in order to sort loop areas in descending order of area.
getAddIndexedGrid(grid, vertices, z)
Get and add an indexed grid.
getAddIndexedLoop(loop, vertices, z)
Get and add an indexed loop.
getAddIndexedLoops(loop, vertices, zList)
Get and add indexed loops.
getAdditionalLoopLength(loop, point, pointIndex)
Get the additional length added by inserting a point into a loop.
getBridgeDirection(belowLoops, layerLoops, layerThickness)
Get span direction for the majority of the overhanging extrusion perimeter, if any.
getBridgeLoops(layerThickness, loop)
Get the inset bridge loops from the loop.
getCarveIntersectionFromEdge(edge, vertices, z)
Get the complex where the carve intersects the edge.
getDoubledRoundZ(overhangingSegment, segmentRoundZ)
Get doubled plane angle around z of the overhanging segment.
getEmptyZ(shape, z)
Get the first z which is not in the zone table.
getInclusiveLoops(allPoints, corners, importRadius, isInteriorWanted=True)
Get loops which include most of the points.
getIndexedCellLoopsFromIndexedGrid(grid)
Get indexed cell loops from an indexed grid.
getIndexedLoopFromIndexedGrid(indexedGrid)
Get indexed loop from around the indexed grid.
getInsetPoint(loop, tinyRadius)
Get the inset vertex.
getLoopsFromCorrectMesh(edges, faces, vertices, z)
Get loops from a carve of a correct mesh.
getLoopsFromUnprovenMesh(edges, faces, importRadius, vertices, z)
Get loops from a carve of an unproven mesh.
getLoopsInOrderOfArea(compareAreaFunction, loops)
Get the loops in the order of area according to the compare function.
getLoopsWithCorners(corners, importRadius, loops, pointTable)
Add corners to the loops.
getNextEdgeIndexAroundZ(edge, faces, remainingEdgeTable)
Get the next edge index in the mesh carve.
getNumberOfOddIntersectionsFromLoops(leftPoint, loops)
Get the number of odd intersections with the loops.
getOverhangDirection(belowOutsetLoops, segmentBegin, segmentEnd)
Add to span direction from the endpoint segments which overhang the layer below.
getOverlapRatio(loop, pointTable)
Get the overlap ratio between the loop and the point table.
getPath(edges, pathIndexes, loop, z)
Get the path from the edge intersections.
getRemainingEdgeTable(edges, vertices, z)
Get the remaining edge hashtable.
getSharedFace(firstEdge, faces, secondEdge)
Get the face which is shared by two edges.
getWideAnglePointIndex(loop)
Get a point index which has a wide enough angle, most point indexes have a wide enough angle, this is just to make sure.
initializeZoneIntervalTable(shape, vertices)
Initialize the zone interval and the zZone table
isInline(beginComplex, centerComplex, endComplex)
Determine if the three complex points form a line.
isPathAdded(edges, faces, loops, remainingEdgeTable, vertices, z)
Get the path indexes around a triangle mesh carve and add the path to the flat loops.
processXMLElement(xmlElement)
Process the xml element.

 
Data
        __author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
__credits__ = 'Art of Illusion <http://www.artofillusion.org/>'
__date__ = '$Date: 2008/02/05 $'
__license__ = 'GPL 3.0'
absolute_import = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384)

 
Author
        Enrique Perez (perez_enrique@yahoo.com)

 
Credits
        Art of Illusion <http://www.artofillusion.org/>