コード例 #1
0
ファイル: inset.py プロジェクト: chriskyfung/MakerDroid
	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
ファイル: widen.py プロジェクト: weeberp/MakerDroid
 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
ファイル: inset.py プロジェクト: weeberp/MakerDroid
 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
ファイル: widen.py プロジェクト: chriskyfung/MakerDroid
	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
ファイル: outset.py プロジェクト: chriskyfung/MakerDroid
	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 )