Beispiel #1
0
 def addPathBetween(self, betweenFirst, betweenSecond, loopFirst):
     "Add a path between the perimeter and the fill."
     clockwisePath = [betweenFirst]
     widdershinsPath = [betweenFirst]
     nearestFirstDistanceIndex = euclidean.getNearestDistanceSquaredIndex(
         betweenFirst, loopFirst)
     nearestSecondDistanceIndex = euclidean.getNearestDistanceSquaredIndex(
         betweenSecond, loopFirst)
     firstBeginIndex = (int(nearestFirstDistanceIndex.imag) +
                        1) % len(loopFirst)
     secondBeginIndex = (int(nearestSecondDistanceIndex.imag) +
                         1) % len(loopFirst)
     widdershinsLoop = euclidean.getAroundLoop(firstBeginIndex,
                                               secondBeginIndex, loopFirst)
     widdershinsPath += widdershinsLoop
     clockwiseLoop = euclidean.getAroundLoop(secondBeginIndex,
                                             firstBeginIndex, loopFirst)
     clockwiseLoop.reverse()
     clockwisePath += clockwiseLoop
     clockwisePath.append(betweenSecond)
     widdershinsPath.append(betweenSecond)
     if euclidean.getPathLength(widdershinsPath) > euclidean.getPathLength(
             clockwisePath):
         widdershinsPath = clockwisePath
     widdershinsPath = euclidean.getAwayPath(widdershinsPath,
                                             0.2 * self.layerFillInset)
     for point in widdershinsPath:
         self.addGcodeMovement(point)
Beispiel #2
0
def getLoopsFromUnprovenMesh( edges, extrusionWidth, faces, vertices, slicePreferences, z ):
	"Get loops from a slice of an unproven mesh."
	edgePairTable = {}
	importRadius = slicePreferences.importCoarseness.value * extrusionWidth
	points = []
	remainingEdgeTable = getRemainingEdgeTable( edges, vertices, z )
	remainingEdgeTableKeys = remainingEdgeTable.keys()
	for remainingEdgeIndexKey in remainingEdgeTable:
		edge = remainingEdgeTable[ remainingEdgeIndexKey ]
		sliceIntersection = getSliceIntersectionFromEdge( edge, vertices, z )
		points.append( sliceIntersection )
		if edge.faceIndexFirst != None:
			faceOne = faces[ edge.faceIndexFirst ]
			addEdgePair( edgePairTable, edges, faceOne.edgeIndexFirst, remainingEdgeIndexKey, remainingEdgeTable )
			addEdgePair( edgePairTable, edges, faceOne.edgeIndexSecond, remainingEdgeIndexKey, remainingEdgeTable )
			addEdgePair( edgePairTable, edges, faceOne.edgeIndexThird, remainingEdgeIndexKey, remainingEdgeTable )
		if edge.faceIndexSecond != None:
			faceTwo = faces[ edge.faceIndexSecond ]
			addEdgePair( edgePairTable, edges, faceTwo.edgeIndexFirst, remainingEdgeIndexKey, remainingEdgeTable )
			addEdgePair( edgePairTable, edges, faceTwo.edgeIndexSecond, remainingEdgeIndexKey, remainingEdgeTable )
			addEdgePair( edgePairTable, edges, faceTwo.edgeIndexThird, remainingEdgeIndexKey, remainingEdgeTable )
	for edgePairValue in edgePairTable.values():
		edgePairValue.addPointsAtZ( points, importRadius, vertices, z )
	path = euclidean.getAwayPath( points, importRadius )
	circleNodes = intercircle.getCircleNodesFromPath( path, importRadius )
	centers = intercircle.getCentersFromCircleNodes( circleNodes )
	return intercircle.getLoopsFromLoopsDirection( slicePreferences.importTinyDetails.value, centers )
Beispiel #3
0
	def addPathBetween( self, betweenFirst, betweenSecond, loopFirst ):
		"Add a path between the perimeter and the fill."
		clockwisePath = [ betweenFirst ]
		widdershinsPath = [ betweenFirst ]
		nearestFirstDistanceIndex = euclidean.getNearestDistanceSquaredIndex( betweenFirst, loopFirst )
		nearestSecondDistanceIndex = euclidean.getNearestDistanceSquaredIndex( betweenSecond, loopFirst )
		firstBeginIndex = ( int( nearestFirstDistanceIndex.imag ) + 1 ) % len( loopFirst )
		secondBeginIndex = ( int( nearestSecondDistanceIndex.imag ) + 1 ) % len( loopFirst )
		widdershinsLoop = euclidean.getAroundLoop( firstBeginIndex, secondBeginIndex, loopFirst )
		widdershinsPath += widdershinsLoop
		clockwiseLoop = euclidean.getAroundLoop( secondBeginIndex, firstBeginIndex, loopFirst )
		clockwiseLoop.reverse()
		clockwisePath += clockwiseLoop
		clockwisePath.append( betweenSecond )
		widdershinsPath.append( betweenSecond )
		if euclidean.getPathLength( widdershinsPath ) > euclidean.getPathLength( clockwisePath ):
			widdershinsPath = clockwisePath
		widdershinsPath = euclidean.getAwayPath( widdershinsPath, 0.2 * self.layerFillInset )
		for point in widdershinsPath:
			self.addGcodeMovement( point )