Ejemplo n.º 1
0
 def addWiden(self, rotatedLoopLayer):
     "Add widen to the layer."
     trianglemesh.sortLoopsInOrderOfArea(False, rotatedLoopLayer.loops)
     widdershinsLoops = []
     clockwiseInsetLoops = []
     for loopIndex in xrange(len(rotatedLoopLayer.loops)):
         loop = rotatedLoopLayer.loops[loopIndex]
         if euclidean.isWiddershins(loop):
             otherLoops = rotatedLoopLayer.loops[:
                                                 loopIndex] + rotatedLoopLayer.loops[
                                                     loopIndex + 1:]
             leftPoint = euclidean.getLeftPoint(loop)
             if getIsPointInsideALoop(otherLoops, leftPoint):
                 self.distanceFeedRate.addGcodeFromLoop(
                     loop, rotatedLoopLayer.z)
             else:
                 widdershinsLoops.append(loop)
         else:
             #				clockwiseInsetLoop = intercircle.getLargestInsetLoopFromLoop(loop, self.doublePerimeterWidth)
             #				clockwiseInsetLoop.reverse()
             #				clockwiseInsetLoops.append(clockwiseInsetLoop)
             clockwiseInsetLoops += intercircle.getInsetLoopsFromLoop(
                 loop, self.doublePerimeterWidth)
             self.distanceFeedRate.addGcodeFromLoop(loop,
                                                    rotatedLoopLayer.z)
     for widdershinsLoop in widdershinsLoops:
         outsetLoop = intercircle.getLargestInsetLoopFromLoop(
             widdershinsLoop, -self.doublePerimeterWidth)
         widenedLoop = getWidenedLoop(widdershinsLoop, clockwiseInsetLoops,
                                      outsetLoop, self.perimeterWidth)
         self.distanceFeedRate.addGcodeFromLoop(widenedLoop,
                                                rotatedLoopLayer.z)
Ejemplo n.º 2
0
	def flipDirectLayer(self, rotatedLoopLayer):
		"Flip the y coordinate of the layer and direct the loops."
		for loop in rotatedLoopLayer.loops:
			for pointIndex, point in enumerate(loop):
				loop[pointIndex] = complex(point.real, -point.imag)
		trianglemesh.sortLoopsInOrderOfArea(True, rotatedLoopLayer.loops)
		for loopIndex, loop in enumerate(rotatedLoopLayer.loops):
			isInsideLoops = euclidean.getIsInFilledRegion(rotatedLoopLayer.loops[: loopIndex], euclidean.getLeftPoint(loop))
			intercircle.directLoop((not isInsideLoops), loop)
Ejemplo n.º 3
0
 def flipDirectLayer(self, rotatedLoopLayer):
     "Flip the y coordinate of the layer and direct the loops."
     for loop in rotatedLoopLayer.loops:
         for pointIndex, point in enumerate(loop):
             loop[pointIndex] = complex(point.real, -point.imag)
     trianglemesh.sortLoopsInOrderOfArea(True, rotatedLoopLayer.loops)
     for loopIndex, loop in enumerate(rotatedLoopLayer.loops):
         isInsideLoops = euclidean.getIsInFilledRegion(
             rotatedLoopLayer.loops[:loopIndex],
             euclidean.getLeftPoint(loop))
         intercircle.directLoop((not isInsideLoops), loop)
Ejemplo n.º 4
0
	def addInset( self, rotatedLoopLayer ):
		"Add inset to the layer."
		alreadyFilledArounds = []
		halfWidth = self.halfPerimeterWidth
		if rotatedLoopLayer.rotation != None:
			halfWidth *= self.repository.bridgeWidthMultiplier.value
			self.distanceFeedRate.addTagBracketedLine('bridgeRotation', rotatedLoopLayer.rotation )
		extrudateLoops = intercircle.getInsetLoopsFromLoops( halfWidth, rotatedLoopLayer.loops )
		trianglemesh.sortLoopsInOrderOfArea(not self.repository.loopOrderAscendingArea.value, extrudateLoops)
		for extrudateLoop in extrudateLoops:
			self.addGcodeFromRemainingLoop( extrudateLoop, alreadyFilledArounds, halfWidth, rotatedLoopLayer.z )
Ejemplo n.º 5
0
 def addInset(self, rotatedLoopLayer):
     "Add inset to the layer."
     alreadyFilledArounds = []
     halfWidth = self.halfPerimeterWidth
     if rotatedLoopLayer.rotation != None:
         halfWidth *= self.repository.bridgeWidthMultiplier.value
         self.distanceFeedRate.addTagBracketedLine(
             'bridgeRotation', rotatedLoopLayer.rotation)
     extrudateLoops = intercircle.getInsetLoopsFromLoops(
         halfWidth, rotatedLoopLayer.loops)
     trianglemesh.sortLoopsInOrderOfArea(
         not self.repository.loopOrderAscendingArea.value, extrudateLoops)
     for extrudateLoop in extrudateLoops:
         self.addGcodeFromRemainingLoop(extrudateLoop, alreadyFilledArounds,
                                        halfWidth, rotatedLoopLayer.z)
Ejemplo n.º 6
0
 def addOutset(self, rotatedLoopLayer):
     "Add outset to the layer."
     extrudateLoops = intercircle.getInsetLoopsFromLoops(
         -self.absoluteHalfPerimeterWidth, rotatedLoopLayer.loops)
     sortedLoops = trianglemesh.sortLoopsInOrderOfArea(
         False, extrudateLoops)
     for sortedLoop in sortedLoops:
         self.addGcodeFromRemainingLoop(sortedLoop,
                                        self.absoluteHalfPerimeterWidth,
                                        rotatedLoopLayer.z)
Ejemplo n.º 7
0
	def addWiden(self, rotatedLoopLayer):
		"Add widen to the layer."
		trianglemesh.sortLoopsInOrderOfArea(False, rotatedLoopLayer.loops)
		widdershinsLoops = []
		clockwiseInsetLoops = []
		for loopIndex in xrange(len(rotatedLoopLayer.loops)):
			loop = rotatedLoopLayer.loops[loopIndex]
			if euclidean.isWiddershins(loop):
				otherLoops = rotatedLoopLayer.loops[: loopIndex] + rotatedLoopLayer.loops[loopIndex + 1 :]
				leftPoint = euclidean.getLeftPoint(loop)
				if getIsPointInsideALoop(otherLoops, leftPoint):
					self.distanceFeedRate.addGcodeFromLoop(loop, rotatedLoopLayer.z)
				else:
					widdershinsLoops.append(loop)
			else:
#				clockwiseInsetLoop = intercircle.getLargestInsetLoopFromLoop(loop, self.doublePerimeterWidth)
#				clockwiseInsetLoop.reverse()
#				clockwiseInsetLoops.append(clockwiseInsetLoop)
				clockwiseInsetLoops += intercircle.getInsetLoopsFromLoop(loop, self.doublePerimeterWidth)
				self.distanceFeedRate.addGcodeFromLoop(loop, rotatedLoopLayer.z)
		for widdershinsLoop in widdershinsLoops:
			outsetLoop = intercircle.getLargestInsetLoopFromLoop(widdershinsLoop, -self.doublePerimeterWidth)
			widenedLoop = getWidenedLoop(widdershinsLoop, clockwiseInsetLoops, outsetLoop, self.perimeterWidth)
			self.distanceFeedRate.addGcodeFromLoop(widenedLoop, rotatedLoopLayer.z)
Ejemplo n.º 8
0
	def addOutset(self, rotatedLoopLayer):
		"Add outset to the layer."
		extrudateLoops = intercircle.getInsetLoopsFromLoops(-self.absoluteHalfPerimeterWidth, rotatedLoopLayer.loops)
		sortedLoops = trianglemesh.sortLoopsInOrderOfArea(False, extrudateLoops)
		for sortedLoop in sortedLoops:
			self.addGcodeFromRemainingLoop(sortedLoop, self.absoluteHalfPerimeterWidth, rotatedLoopLayer.z)