示例#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 = triangle_mesh.getLoopsInOrderOfArea( triangle_mesh.compareAreaAscending, extrudateLoops )
		else:
			extrudateLoops = triangle_mesh.getLoopsInOrderOfArea( triangle_mesh.compareAreaDescending, extrudateLoops )
		for extrudateLoop in extrudateLoops:
			self.addGcodeFromRemainingLoop( extrudateLoop, alreadyFilledArounds, halfWidth, rotatedBoundaryLayer.z )
示例#2
0
 def addWiden(self, rotatedBoundaryLayer):
     "Add widen to the layer."
     loops = triangle_mesh.getLoopsInOrderOfArea(
         triangle_mesh.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 euclidean.isPointInsideLoops(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.tinyRadius)
         self.distanceFeedRate.addGcodeFromLoop(widenedLoop,
                                                rotatedBoundaryLayer.z)
示例#3
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 = triangle_mesh.getLoopsInOrderOfArea(
             triangle_mesh.compareAreaAscending, extrudateLoops)
     else:
         extrudateLoops = triangle_mesh.getLoopsInOrderOfArea(
             triangle_mesh.compareAreaDescending, extrudateLoops)
     for extrudateLoop in extrudateLoops:
         self.addGcodeFromRemainingLoop(extrudateLoop, alreadyFilledArounds,
                                        halfWidth, rotatedBoundaryLayer.z)
示例#4
0
 def addOutset(self, rotatedBoundaryLayer):
     "Add outset to the layer."
     extrudateLoops = intercircle.getInsetLoopsFromLoops(
         -self.absoluteHalfPerimeterWidth, rotatedBoundaryLayer.loops)
     sortedLoops = triangle_mesh.getLoopsInOrderOfArea(
         triangle_mesh.compareAreaAscending, extrudateLoops)
     for sortedLoop in sortedLoops:
         self.addGcodeFromRemainingLoop(sortedLoop,
                                        self.absoluteHalfPerimeterWidth,
                                        rotatedBoundaryLayer.z)
示例#5
0
	def addWiden( self, rotatedBoundaryLayer ):
		"Add widen to the layer."
		loops = triangle_mesh.getLoopsInOrderOfArea( triangle_mesh.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 euclidean.isPointInsideLoops( 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.tinyRadius )
			self.distanceFeedRate.addGcodeFromLoop( widenedLoop, rotatedBoundaryLayer.z )
示例#6
0
	def addOutset( self, rotatedBoundaryLayer ):
		"Add outset to the layer."
		extrudateLoops = intercircle.getInsetLoopsFromLoops( - self.absoluteHalfPerimeterWidth, rotatedBoundaryLayer.loops )
		sortedLoops = triangle_mesh.getLoopsInOrderOfArea( triangle_mesh.compareAreaAscending, extrudateLoops )
		for sortedLoop in sortedLoops:
			self.addGcodeFromRemainingLoop( sortedLoop, self.absoluteHalfPerimeterWidth, rotatedBoundaryLayer.z )