Permalink
Browse files

Changed division to fixed float 0.785

  • Loading branch information...
1 parent b54512f commit 8cd4d670f5fb8f53d5f9269b51a8d4ba3af5d13e @ahmetcemturan committed Aug 13, 2011
@@ -195,10 +195,10 @@ def getCraftedGcode(self, gcodeText, repository):
self.delay = (repository.realPrintTime.value - repository.calculatedPrintTime.value) / self.totalCommandcount
self.estimatedBuildTime = self.delay * self.totalCommandcount + self.totalBuildTime
machineTimeCost = repository.machineTime.value * self.estimatedBuildTime / 3600.0
- self.filamentInOutRatio = filamentCrossSectionArea / ((self.extrusionHeight/2)*(self.extrusionHeight/2)*math.pi)+self.extrusionHeight*(self.extrusionWidth-self.extrusionHeight)
- self.totalDistanceFilament = self.totalDistanceExtruded * self.filamentInOutRatio
+ self.filamentInOutRatio = filamentCrossSectionArea / ((((self.extrusionHeight+self.extrusionWidth)/4)*((self.extrusionHeight+self.extrusionWidth)/4)*math.pi))
+ self.totalDistanceFilament = self.totalDistanceExtruded / self.filamentInOutRatio
averageFeedRate = self.totalDistanceTraveled / self.estimatedBuildTime
- totalDistanceExtruded = self.extrusion
+
materialCost = repository.material.value * mass
self.addLine(' ')
self.addLine('Cost')
@@ -215,7 +215,7 @@ def getCraftedGcode(self, gcodeText, repository):
self.addLine( "Calculated Build time is %s." % euclidean.getDurationString(self.totalBuildTime))
self.addLine( "Estimated Build time is %s." % euclidean.getDurationString( self.estimatedBuildTime))
self.addLine( "Delay is %s seconds per command ." % self.delay )
- self.addLine( "Filament used is %s cm." % euclidean.getThreeSignificantFigures( self.totalDistanceFilament /1000 ))
+ self.addLine( "Filament used is %s cm." % euclidean.getThreeSignificantFigures( self.totalDistanceFilament /10 ))
self.addLine( "Distance traveled is %s m." % euclidean.getThreeSignificantFigures( self.totalDistanceTraveled/1000 ) )
self.addLine( "Distance extruded is %s m." % euclidean.getThreeSignificantFigures( self.totalDistanceExtruded/1000 ) )
if self.extruderSpeed is not None:
@@ -259,16 +259,16 @@ def addToPath(self, location):
"""Add a point to travel and maybe extrusion."""
if self.oldLocation is not None:
travel = location.distance( self.oldLocation )
- self.extrusion = self.getLineWithE( line, splitLine, 0 )
+# self.extrusion = self.getLineWithE( line, splitLine, 0 )
if self.feedRateMinute > 0.0:
# delay = self.delay
self.totalBuildTime += (60.0 * ((travel / self.feedRateMinute) ))
self.totalDistanceTraveled += travel
self.totalCommandcount += 1
-# if self.extruderActive:
-# self.totalDistanceExtruded += travel
-# self.cornerMaximum.maximize(location)
-# self.cornerMinimum.minimize(location)
+ if self.extruderActive:
+ self.totalDistanceExtruded += travel
+ self.cornerMaximum.maximize(location)
+ self.cornerMinimum.minimize(location)
self.oldLocation = location
def extruderSet( self, active ):
@@ -203,7 +203,7 @@ def getCraftedGcode(self, gcodeText, repository):
if repository.activateCalibration.value:
self.calibrationFactor = (((self.extrusionHeight/2)*(self.extrusionHeight/2)*math.pi)+self.extrusionHeight*(xSectionCorrector -self.extrusionHeight))/(((self.extrusionHeight/2)*(self.extrusionHeight/2)*math.pi)+self.extrusionHeight *(self.extrusionWidth-self.extrusionHeight))
self.newfilamentPackingDensity = repository.filamentPackingDensity.value * self.calibrationFactor
- print('Filament Packing Density (if using this make sure extrusion width = measured width) :')
+ print('****************Filament Packing Density (For Calibration)**********************:')
print( self.newfilamentPackingDensity )
self.flowScaleSixty = 60.0 * ((((self.extrusionHeight+self.extrusionWidth)/4)*((self.extrusionHeight+self.extrusionWidth)/4)*math.pi)/filamentPackingArea) / self.calibrationFactor
if self.operatingFlowRate is None:
@@ -240,7 +240,7 @@
-def addAroundGridPoint( arounds, gridPoint, gridPointInsetX, gridPointInsetY, gridPoints, isBothOrNone, isDoubleJunction, isJunctionWide, paths, pixelTable, width ):
+def addAroundGridPoint( arounds, gridPoint, gridPointInsetX, gridPointInsetY, gridPoints, gridRadius, isBothOrNone, isDoubleJunction, isJunctionWide, paths, pixelTable, width ):
"""Add the path around the grid point."""
closestPathIndex = None
aroundIntersectionPaths = []
@@ -1213,11 +1213,11 @@ def getCraftedGcode( self, repository, gcodeText ):
if self.extrusionWidth is None:
print('Warning, nothing will be done because self.extrusionWidth in getCraftedGcode in FillSkein was None.')
return ''
- #self.infillSpacing = ((self.extrusionHeight/2) * (math.pi/4) *2)+(self.extrusionWidth - self.extrusionHeight)
- self.infillSpacing = (self.extrusionWidth * (math.pi/4))
+ #self.infillSpacing = ((self.extrusionHeight/2) * (((0.785))) *2)+(self.extrusionWidth - self.extrusionHeight)
+ self.infillSpacing = (self.extrusionWidth * (((0.785))))
print('Spacing between parallel lines in fill (mm):', (self.infillSpacing))
- #self.fillInset = self.extrusionHeight/2 *(math.pi/4)*2+(self.extrusionWidth - self.extrusionHeight)/2
- self.fillInset = (self.extrusionWidth+self.extrusionHeight)/2*(math.pi/4)
+ #self.fillInset = self.extrusionHeight/2 *(((0.785)))*2+(self.extrusionWidth - self.extrusionHeight)/2
+ self.fillInset = (self.extrusionWidth+self.extrusionHeight)/2*(((0.785)))
print('Fill Overlap over Perimeter (mm):', self.fillInset)
self.infillSolidity = repository.infillSolidity.value
if self.isGridToBeExtruded():
@@ -1327,7 +1327,7 @@ def parseInitialization(self):
self.extrusionWidth = float(splitLine[1])
threadSequenceString = ' '.join( self.threadSequence )
self.distanceFeedRate.addTagBracketedLine('threadSequenceString', threadSequenceString )
- self.infillSpacing = self.extrusionWidth * (math.pi/4)
+ self.infillSpacing = self.extrusionWidth * (((0.785)))
self.distanceFeedRate.addTagRoundedLine('infillSpacing', self.infillSpacing)
elif firstWord == '(</extruderInitialization>)':
self.distanceFeedRate.addLine('(<procedureName> fill </procedureName>)')
@@ -372,8 +372,8 @@ def parseInitialization(self):
elif firstWord == '(<extrusionWidth>':
self.extrusionWidth = float(splitLine[1])
self.halfExtrusionWidth = 0.5 * self.extrusionWidth
- self.overlapRemovalWidth = self.extrusionWidth * (math.pi/4)* self.repository.overlapRemovalWidthScaler.value
- #self.overlapRemovalWidth = (self.extrusionHeight/2*(math.pi/4)*2)+(self.extrusionWidth-self.extrusionHeight)
+ self.overlapRemovalWidth = self.extrusionWidth * (((0.785)))* self.repository.overlapRemovalWidthScaler.value
+ #self.overlapRemovalWidth = (self.extrusionHeight/2*(((0.785)))*2)+(self.extrusionWidth-self.extrusionHeight)
self.distanceFeedRate.addLine(line)
def parseLine(self, line):
@@ -744,7 +744,7 @@ def addSupportLayerTemperature(self, endpoints, z):
paths = euclidean.getPathsFromEndpoints(endpoints, 1.5 * self.interfaceStep, aroundPixelTable, aroundWidth)
feedRateMinuteMultiplied = (self.supportFeedRate *60)
supportFlowRateMultiplied = self.supportFlowRate
- travelFeedRateMultiplied = self.repository.objectFirstLayerTravelSpeed * 60
+ travelFeedRateMultiplied = self.repository.objectFirstLayerTravelSpeed.value * 60
if not self.layerIndex:
supportFlowRateMultiplied = self.repository.objectFirstLayerFlowRateInfillMultiplier.value * self.repository.objectFirstLayerFeedRateInfillMultiplier.value
self.addFlowRateValueIfDifferent(supportFlowRateMultiplied)
@@ -165,8 +165,8 @@ def parseInitialization(self):
extrusionWidth = float(splitLine[1])
self.halfPerimeterWidth = 0.5 * extrusionWidth
self.quarterPerimeterWidth = 0.25 * extrusionWidth
- #self.clipLength = (self.quarterLayerThickness - (self.repository.clipOverPerimeterWidth.value * self.quarterLayerThickness * (math.pi/4)))*4
- self.clipLength = (self.quarterLayerThickness - (clipRepository.clipOverPerimeterWidth.value * self.quarterLayerThickness * (math.pi/4)))*4
+ #self.clipLength = (self.quarterLayerThickness - (self.repository.clipOverPerimeterWidth.value * self.quarterLayerThickness * (((0.785)))))*4
+ self.clipLength = (self.quarterLayerThickness - (clipRepository.clipOverPerimeterWidth.value * self.quarterLayerThickness * (((0.785)))))*4
elif firstWord == '(<travelFeedRatePerSecond>':
self.travelFeedRateMinute = 60.0 * float(splitLine[1])
self.distanceFeedRate.addLine(line)

0 comments on commit 8cd4d67

Please sign in to comment.