Beispiel #1
0
	def addInset( self, rotatedBoundaryLayer ):
		"Add inset to the layer."
		alreadyFilledArounds = []
		halfWidth = self.halfPerimeterWidth
		if rotatedBoundaryLayer.rotation != None:
			halfWidth *= self.repository.bridgeWidthMultiplier.value
			self.distanceFeedRate.addTagBracketedLine('bridgeRotation', rotatedBoundaryLayer.rotation )
		extrudateLoops = intercircle.getInsetLoopsFromLoops( halfWidth, rotatedBoundaryLayer.loops )
		if self.repository.loopOrderAscendingArea.value:
			extrudateLoops = trianglemesh.getLoopsInOrderOfArea( trianglemesh.compareAreaAscending, extrudateLoops )
		else:
			extrudateLoops = trianglemesh.getLoopsInOrderOfArea( trianglemesh.compareAreaDescending, extrudateLoops )
		for extrudateLoop in extrudateLoops:
			self.addGcodeFromRemainingLoop( extrudateLoop, alreadyFilledArounds, halfWidth, rotatedBoundaryLayer.z )
Beispiel #2
0
 def addWiden(self, rotatedBoundaryLayer):
     "Add widen to the layer."
     loops = trianglemesh.getLoopsInOrderOfArea(
         trianglemesh.compareAreaAscending, rotatedBoundaryLayer.loops)
     widdershinsLoops = []
     clockwiseInsetLoops = []
     for loopIndex in xrange(len(loops)):
         loop = loops[loopIndex]
         if euclidean.isWiddershins(loop):
             otherLoops = loops[:loopIndex] + loops[loopIndex + 1:]
             leftPoint = euclidean.getLeftPoint(loop)
             if getIsPointInsideALoop(otherLoops, leftPoint):
                 self.distanceFeedRate.addGcodeFromLoop(
                     loop, rotatedBoundaryLayer.z)
             else:
                 widdershinsLoops.append(loop)
         else:
             clockwiseInsetLoops += intercircle.getInsetLoopsFromLoop(
                 self.doublePerimeterWidth, loop)
             self.distanceFeedRate.addGcodeFromLoop(loop,
                                                    rotatedBoundaryLayer.z)
     for widdershinsLoop in widdershinsLoops:
         outsetLoop = intercircle.getLargestInsetLoopFromLoop(
             widdershinsLoop, -self.doublePerimeterWidth)
         widenedLoop = getWidenedLoop(widdershinsLoop, clockwiseInsetLoops,
                                      outsetLoop, self.perimeterWidth)
         self.distanceFeedRate.addGcodeFromLoop(widenedLoop,
                                                rotatedBoundaryLayer.z)
Beispiel #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)
		rotatedLoopLayer.loops = trianglemesh.getLoopsInOrderOfArea(trianglemesh.compareAreaDescending, rotatedLoopLayer.loops)
		for loopIndex, loop in enumerate(rotatedLoopLayer.loops):
			isInsideLoops = euclidean.getIsInFilledRegion(rotatedLoopLayer.loops[: loopIndex], euclidean.getLeftPoint(loop))
			intercircle.directLoop((not isInsideLoops), loop)
	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)
		rotatedLoopLayer.loops = trianglemesh.getLoopsInOrderOfArea(trianglemesh.compareAreaDescending, rotatedLoopLayer.loops)
		for loopIndex, loop in enumerate(rotatedLoopLayer.loops):
			isInsideLoops = euclidean.getIsInFilledRegion(rotatedLoopLayer.loops[: loopIndex], euclidean.getLeftPoint(loop))
			intercircle.directLoop((not isInsideLoops), loop)
Beispiel #5
0
 def addOutset(self, rotatedBoundaryLayer):
     "Add outset to the layer."
     extrudateLoops = intercircle.getInsetLoopsFromLoops(
         -self.absoluteHalfPerimeterWidth, rotatedBoundaryLayer.loops)
     sortedLoops = trianglemesh.getLoopsInOrderOfArea(
         trianglemesh.compareAreaAscending, extrudateLoops)
     for sortedLoop in sortedLoops:
         self.addGcodeFromRemainingLoop(sortedLoop,
                                        self.absoluteHalfPerimeterWidth,
                                        rotatedBoundaryLayer.z)
Beispiel #6
0
 def addInset(self, rotatedBoundaryLayer):
     "Add inset to the layer."
     alreadyFilledArounds = []
     halfWidth = self.halfPerimeterWidth
     if rotatedBoundaryLayer.rotation != None:
         halfWidth *= self.repository.bridgeWidthMultiplier.value
         self.distanceFeedRate.addTagBracketedLine(
             'bridgeRotation', rotatedBoundaryLayer.rotation)
     extrudateLoops = intercircle.getInsetLoopsFromLoops(
         halfWidth, rotatedBoundaryLayer.loops)
     if self.repository.loopOrderAscendingArea.value:
         extrudateLoops = trianglemesh.getLoopsInOrderOfArea(
             trianglemesh.compareAreaAscending, extrudateLoops)
     else:
         extrudateLoops = trianglemesh.getLoopsInOrderOfArea(
             trianglemesh.compareAreaDescending, extrudateLoops)
     for extrudateLoop in extrudateLoops:
         self.addGcodeFromRemainingLoop(extrudateLoop, alreadyFilledArounds,
                                        halfWidth, rotatedBoundaryLayer.z)
Beispiel #7
0
	def addWiden( self, rotatedBoundaryLayer ):
		"Add widen to the layer."
		loops = trianglemesh.getLoopsInOrderOfArea( trianglemesh.compareAreaAscending, rotatedBoundaryLayer.loops )
		widdershinsLoops = []
		clockwiseInsetLoops = []
		for loopIndex in xrange( len(loops) ):
			loop = loops[loopIndex]
			if euclidean.isWiddershins(loop):
				otherLoops = loops[ : loopIndex ] + loops[loopIndex + 1 :]
				leftPoint = euclidean.getLeftPoint(loop)
				if getIsPointInsideALoop( otherLoops, leftPoint ):
					self.distanceFeedRate.addGcodeFromLoop( loop, rotatedBoundaryLayer.z )
				else:
					widdershinsLoops.append(loop)
			else:
				clockwiseInsetLoops += intercircle.getInsetLoopsFromLoop( self.doublePerimeterWidth, loop )
				self.distanceFeedRate.addGcodeFromLoop( loop, rotatedBoundaryLayer.z )
		for widdershinsLoop in widdershinsLoops:
			outsetLoop = intercircle.getLargestInsetLoopFromLoop( widdershinsLoop, - self.doublePerimeterWidth )
			widenedLoop = getWidenedLoop( widdershinsLoop, clockwiseInsetLoops, outsetLoop, self.perimeterWidth )
			self.distanceFeedRate.addGcodeFromLoop( widenedLoop, rotatedBoundaryLayer.z )
Beispiel #8
0
	def addOutset( self, rotatedBoundaryLayer ):
		"Add outset to the layer."
		extrudateLoops = intercircle.getInsetLoopsFromLoops( - self.absoluteHalfPerimeterWidth, rotatedBoundaryLayer.loops )
		sortedLoops = trianglemesh.getLoopsInOrderOfArea( trianglemesh.compareAreaAscending, extrudateLoops )
		for sortedLoop in sortedLoops:
			self.addGcodeFromRemainingLoop( sortedLoop, self.absoluteHalfPerimeterWidth, rotatedBoundaryLayer.z )