예제 #1
0
파일: clip.py 프로젝트: folksjos/RepG
    def addTailoredLoopPath(self, line):
        "Add a clipped loop path."
        if self.clipLength > 0.0:
            removeTable = {}
            euclidean.addLoopToPixelTable(self.loopPath.path, removeTable,
                                          self.layerPixelWidth)
            euclidean.removePixelTableFromPixelTable(removeTable,
                                                     self.layerPixelTable)
            self.loopPath.path = euclidean.getClippedLoopPath(
                self.clipLength, self.loopPath.path)
            self.loopPath.path = euclidean.getSimplifiedPath(
                self.loopPath.path, self.perimeterWidth)
            euclidean.addLoopToPixelTable(self.loopPath.path,
                                          self.layerPixelTable,
                                          self.layerPixelWidth)
        if self.oldWiddershins == None:
            self.addGcodeFromThreadZ(self.loopPath.path, self.loopPath.z)
        else:
            if self.oldWiddershins != euclidean.isWiddershins(
                    self.loopPath.path):
                self.loopPath.path.reverse()
#			self.addGcodeFromThreadZ( self.loopPath.path, self.loopPath.z )
            for point in self.loopPath.path:
                self.distanceFeedRate.addGcodeMovementZWithFeedRate(
                    self.feedRateMinute, point, self.loopPath.z)
        if self.getNextThreadIsACloseLoop(
                self.loopPath.path) and self.maximumConnectionDistance > 0.0:
            self.oldWiddershins = euclidean.isWiddershins(self.loopPath.path)
        else:
            self.oldWiddershins = None
            self.distanceFeedRate.addLine(line)
        self.loopPath = None
def addPathToInfillPaths(infillWidth, infillPaths, path, rotationPlaneAngle):
    'Add simplified path to fill.'
    simplifiedPath = euclidean.getSimplifiedPath(path, infillWidth)
    if len(simplifiedPath) < 2:
        return
    planeRotated = euclidean.getPointsRoundZAxis(rotationPlaneAngle, simplifiedPath)
    infillPaths.append(planeRotated)
예제 #3
0
def getAroundsFromPathPoints(points, radius, thresholdRatio=0.9):
	'Get the arounds from the path.'
	centers = getCentersFromPoints(points, 0.8 * radius)
	arounds = []
	for center in centers:
		if euclidean.isWiddershins(center):
			arounds.append(euclidean.getSimplifiedPath(center, radius))
	return arounds
예제 #4
0
def addPathToInfillPaths(infillWidth, infillPaths, path, rotationPlaneAngle):
    'Add simplified path to fill.'
    simplifiedPath = euclidean.getSimplifiedPath(path, infillWidth)
    if len(simplifiedPath) < 2:
        return
    planeRotated = euclidean.getPointsRoundZAxis(rotationPlaneAngle,
                                                 simplifiedPath)
    infillPaths.append(planeRotated)
예제 #5
0
파일: mill.py 프로젝트: ghagen01/SkeinPyPy
	def addMillThreads(self):
		'Add the mill threads to the skein.'
		boundaryLayer = self.boundaryLayers[self.layerIndex]
		endpoints = euclidean.getEndpointsFromSegmentTable( boundaryLayer.segmentTable )
		if len(endpoints) < 1:
			return
		paths = euclidean.getPathsFromEndpoints(endpoints, 5.0 * self.millWidth, self.aroundPixelTable, self.aroundWidth)
		averageZ = self.average.getAverage()
		if self.repository.addInnerLoops.value:
			self.addGcodeFromLoops( boundaryLayer.innerLoops, averageZ )
		if self.repository.addOuterLoops.value:
			self.addGcodeFromLoops( boundaryLayer.outerLoops, averageZ )
		for path in paths:
			simplifiedPath = euclidean.getSimplifiedPath( path, self.millWidth )
			self.distanceFeedRate.addGcodeFromThreadZ( simplifiedPath, averageZ )
예제 #6
0
파일: mill.py 프로젝트: maestroflema/asimov
	def addMillThreads(self):
		'Add the mill threads to the skein.'
		boundaryLayer = self.boundaryLayers[self.layerIndex]
		endpoints = euclidean.getEndpointsFromSegmentTable( boundaryLayer.segmentTable )
		if len(endpoints) < 1:
			return
		paths = euclidean.getPathsFromEndpoints(endpoints, 5.0 * self.millWidth, self.aroundPixelTable, 1.0, self.aroundWidth)
		averageZ = self.average.getAverage()
		if self.repository.addInnerLoops.value:
			self.addGcodeFromLoops( boundaryLayer.innerLoops, averageZ )
		if self.repository.addOuterLoops.value:
			self.addGcodeFromLoops( boundaryLayer.outerLoops, averageZ )
		for path in paths:
			simplifiedPath = euclidean.getSimplifiedPath( path, self.millWidth )
			self.distanceFeedRate.addGcodeFromThreadZ( simplifiedPath, averageZ )
예제 #7
0
	def addTailoredLoopPath( self, line ):
		"Add a clipped loop path."
		if self.clipLength > 0.0:
			removeTable = {}
			euclidean.addLoopToPixelTable( self.loopPath.path, removeTable, self.layerPixelWidth )
			euclidean.removePixelTableFromPixelTable( removeTable, self.layerPixelTable )
			self.loopPath.path = euclidean.getClippedLoopPath( self.clipLength, self.loopPath.path )
			self.loopPath.path = euclidean.getSimplifiedPath( self.loopPath.path, self.perimeterWidth )
			euclidean.addLoopToPixelTable( self.loopPath.path, self.layerPixelTable, self.layerPixelWidth )
		if self.oldWiddershins == None:
			self.addGcodeFromThreadZ( self.loopPath.path, self.loopPath.z )
		else:
			if self.oldWiddershins != euclidean.isWiddershins( self.loopPath.path ):
				self.loopPath.path.reverse()
#			self.addGcodeFromThreadZ( self.loopPath.path, self.loopPath.z )
			for point in self.loopPath.path:
				self.distanceFeedRate.addGcodeMovementZWithFeedRate( self.feedRateMinute, point, self.loopPath.z )
		if self.getNextThreadIsACloseLoop( self.loopPath.path ) and self.maximumConnectionDistance > 0.0:
			self.oldWiddershins = euclidean.isWiddershins( self.loopPath.path )
		else:
			self.oldWiddershins = None
			self.distanceFeedRate.addLine(line)
		self.loopPath = None