Permalink
Browse files

made some calculation corrections.

Skin:Changed to a different working, faster and more precise skin plugin.
Cool: A minimum speed can be specified when cool is active..
  • Loading branch information...
1 parent 028fcde commit 43071b55fded6d18fa13f3bd7e6824d12b7d5c65 @ahmetcemturan committed Aug 25, 2011
@@ -399,7 +399,7 @@
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
-<td width="100%"><dl><dt><a name="-addAroundGridPoint"><strong>addAroundGridPoint</strong></a>(arounds, gridPoint, gridPointInsetX, gridPointInsetY, gridPoints, gridSearchRadius, isBothOrNone, isDoubleJunction, isJunctionWide, paths, pixelTable, width)</dt><dd><tt>Add&nbsp;the&nbsp;path&nbsp;around&nbsp;the&nbsp;grid&nbsp;point.</tt></dd></dl>
+<td width="100%"><dl><dt><a name="-addAroundGridPoint"><strong>addAroundGridPoint</strong></a>(arounds, gridPoint, gridPointInsetX, gridPointInsetY, gridPoints, gridRadius, isBothOrNone, isDoubleJunction, isJunctionWide, paths, pixelTable, width)</dt><dd><tt>Add&nbsp;the&nbsp;path&nbsp;around&nbsp;the&nbsp;grid&nbsp;point.</tt></dd></dl>
<dl><dt><a name="-addLoop"><strong>addLoop</strong></a>(infillWidth, infillPaths, loop, rotationPlaneAngle)</dt><dd><tt>Add&nbsp;simplified&nbsp;path&nbsp;to&nbsp;fill.</tt></dd></dl>
<dl><dt><a name="-addPath"><strong>addPath</strong></a>(infillWidth, infillPaths, path, rotationPlaneAngle)</dt><dd><tt>Add&nbsp;simplified&nbsp;path&nbsp;to&nbsp;fill.</tt></dd></dl>
<dl><dt><a name="-addPathIndexFirstSegment"><strong>addPathIndexFirstSegment</strong></a>(gridPixel, pathIndexTable, pixelTable, segmentFirstPixel)</dt><dd><tt>Add&nbsp;the&nbsp;path&nbsp;index&nbsp;of&nbsp;the&nbsp;closest&nbsp;segment&nbsp;found&nbsp;toward&nbsp;the&nbsp;second&nbsp;segment.</tt></dd></dl>
@@ -275,13 +275,13 @@ def getBridgeDirection( belowLoops, layerLoops, extrusionHeight ):
def getBridgeLoops( extrusionHeight, loop ):
"""Get the inset bridge loops from the loop."""
- halfWidth = 1.5 * extrusionHeight
- slightlyGreaterThanHalfWidth = 1.1 * halfWidth
+ extrusionSpacingHalfWidth = 1.5 * extrusionHeight #todo 1.5 * extrusionHeight
+ slightlyGreaterThanHalfWidth = 1.1 * extrusionSpacingHalfWidth
extrudateLoops = []
centers = intercircle.getCentersFromLoop( loop, slightlyGreaterThanHalfWidth )
for center in centers:
- extrudateLoop = intercircle.getSimplifiedInsetFromClockwiseLoop( center, halfWidth )
- if intercircle.isLargeSameDirection( extrudateLoop, center, halfWidth ):
+ extrudateLoop = intercircle.getSimplifiedInsetFromClockwiseLoop( center, extrusionSpacingHalfWidth )
+ if intercircle.isLargeSameDirection( extrudateLoop, center, extrusionSpacingHalfWidth ):
if euclidean.isPathInsideLoop( loop, extrudateLoop ) == euclidean.isWiddershins(loop):
extrudateLoop.reverse()
extrudateLoops.append( extrudateLoop )
@@ -1,4 +1,4 @@
Format is tab separated cutting settings.
_Name Value
WindowPosition 0+400
-Profile Selection: end_mill
+Profile Selection: End_Mill
@@ -1,4 +1,4 @@
Format is tab separated extrusion settings.
_Name Value
WindowPosition 0+400
-Profile Selection: PLA
+Profile Selection: 0.33x0.33
@@ -1,4 +1,4 @@
Format is tab separated milling settings.
_Name Value
WindowPosition 0+400
-Profile Selection: end_mill
+Profile Selection: End_Mill
@@ -235,7 +235,7 @@ def getCraftedGcode(self, gcodeText, repository):
self.addLine( "Extrusion Cross section area is %s mm2." % euclidean.getThreeSignificantFigures( extrusionXSection))
self.addLine( "Mass extruded is %s grams." % euclidean.getThreeSignificantFigures( mass ) )
self.addLine( "Volume extruded is %s cc." % euclidean.getThreeSignificantFigures( volumeExtruded) )
- self.addLine( "Filament used is %s m." % euclidean.getThreeSignificantFigures( self.totalDistanceFilament /10000 ))
+ self.addLine( "Filament used is %s m." % euclidean.getThreeSignificantFigures( self.totalDistanceFilament /100000 ))
self.addLine(' ')
self.addLine('Cost')
@@ -202,6 +202,7 @@ def getCarvedSVG(self, carving, fileName, repository):
return ''
extrusionHeight = carving.getCarveLayerThickness()
decimalPlacesCarried = euclidean.getDecimalPlacesCarried(repository.extraDecimalPlaces.value, extrusionHeight)
+ extrusionWidth = repository.extrusionWidth.value #todo add extrusionwidth for later use
svgWriter = svg_writer.SVGWriter(
repository.addLayerTemplateToSVG.value,
carving.getCarveCornerMaximum(),
@@ -269,7 +269,7 @@ def parseInitialization( self, clipRepository ):
elif firstWord == '(<extrusionWidth>':
self.extrusionWidth = float(splitLine[1])
absolutePerimeterWidth = abs( self.extrusionWidth )
- self.clipLength = (self.extrusionHeight - (self.extrusionHeight * (0.7853)))*2
+ self.clipLength = (self.extrusionHeight - (clipRepository.clipOverPerimeterWidth.value*self.extrusionHeight * (0.7853)))*2
self.connectingStepLength = 0.5 * absolutePerimeterWidth
self.layerPixelWidth = 0.1 * absolutePerimeterWidth
self.maximumConnectionDistance = clipRepository.maximumConnectionDistanceOverPerimeterWidth.value * absolutePerimeterWidth
@@ -140,6 +140,7 @@ def __init__(self):
settings.LabelDisplay().getFromName('- When To use Cool?-', self )
self.minimumLayerTime = settings.FloatSpin().getFromValue(0.0, 'Use Cool if layer takes shorter than(seconds):', self, 120.0, 10.0)
+ self.minimumLayerFeedrate = settings.FloatSpin().getFromValue(5.0, 'Do not go slower than (mm/s):', self, 50.0, 15.0)
settings.LabelSeparator().getFromRepository(self)
settings.LabelDisplay().getFromName('- What to do if Cool is necessary? -', self )
self.turnFanOnAtBeginning = settings.BooleanSetting().getFromValue('Turn Fan On at Beginning', self, True)
@@ -257,7 +258,15 @@ def getCoolMove(self, line, location, splitLine):
self.feedRateMinute = gcodec.getFeedRateMinute(self.feedRateMinute, splitLine)
self.highestZ = max(location.z, self.highestZ)
self.addFlowRateMultipliedLineIfNecessary(self.oldFlowRate)
- return self.distanceFeedRate.getLineWithFeedRate(self.multiplier * self.feedRateMinute, line, splitLine)
+ coolFeedRate = self.multiplier * self.feedRateMinute
+# print('0',coolFeedRate)
+ if coolFeedRate > self.repository.minimumLayerFeedrate.value *60 :
+ coolFeedRate = coolFeedRate
+# print('1',coolFeedRate)
+ else:
+ coolFeedRate = self.repository.minimumLayerFeedrate.value *60
+# print('2',coolFeedRate)
+ return self.distanceFeedRate.getLineWithFeedRate(coolFeedRate, line, splitLine)
def getCraftedGcode(self, gcodeText, repository):
"""Parse gcode text and store the cool gcode."""
@@ -201,7 +201,7 @@ def getCraftedGcode(self, gcodeText, repository):
self.parseBoundaries()
self.calibrationFactor = 1
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.calibrationFactor = (((self.extrusionHeight**2/4)*math.pi)+self.extrusionHeight*(xSectionCorrector -self.extrusionHeight))/(((self.extrusionHeight**2/4)*math.pi)+self.extrusionHeight *(self.extrusionWidth-self.extrusionHeight))
self.newfilamentPackingDensity = repository.filamentPackingDensity.value * self.calibrationFactor
print('****************Filament Packing Density (For Calibration)**********************:')
print( self.newfilamentPackingDensity )
@@ -280,7 +280,7 @@ def getExtrusionDistanceString( self, distance, splitLine ):
if distance <= 0.0:
return ''
scaledFlowRate = self.flowRate * self.flowScaleSixty
- return self.getExtrusionDistanceStringFromExtrusionDistance(scaledFlowRate / self.feedRateMinute * distance)
+ return self.getExtrusionDistanceStringFromExtrusionDistance((scaledFlowRate / self.feedRateMinute) * distance)
def getExtrusionDistanceStringFromExtrusionDistance( self, extrusionDistance ):
"""Get the extrusion distance string from the extrusion distance."""
if self.repository.relativeExtrusionDistance.value:
@@ -235,11 +235,10 @@
-def addAroundGridPoint( arounds, gridPoint, gridPointInsetX, gridPointInsetY, gridPoints, gridSearchRadius, 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 = []
- gridSearchRadius = self.infillSpacing / self.infillSolidity #todo ACT fix it is it gridRadius
for aroundIndex in xrange( len(arounds) ):
loop = arounds[ aroundIndex ]
for pointIndex in xrange(len(loop)):
@@ -375,7 +374,7 @@ def addSparseEndpointsFromSegment( doubleExtrusionSpacing, endpoints, fillLine,
if not isSegmentAround( horizontalSegmentLists[ fillLine + 1 ], segment ):
endpoints += segment
return
- if solidSurfaceThickness is 0:
+ if not solidSurfaceThickness:
removedEndpoints += segment
return
if isSegmentCompletelyInAnIntersection( segment, surroundingXIntersections ):
@@ -392,8 +391,7 @@ def addYIntersectionPathToList( pathIndex, pointIndex, y, yIntersection, yInters
yIntersectionPaths.append( yIntersectionPath )
def compareDistanceFromCenter(self, other):
- """Get comparison in order to sort y intersections in ascending order of distance from the center. ACT"""
-
+ """Get comparison in order to sort y intersections in ascending order of distance from the center."""
distanceFromCenter = abs( self.yMinusCenter )
distanceFromCenterOther = abs( other.yMinusCenter )
if distanceFromCenter > distanceFromCenterOther:
@@ -429,7 +427,7 @@ def createFillForSurroundings(nestedRings, radius, shouldExtraLoopsBeAdded):
def getAdditionalLength( path, point, pointIndex ):
"""Get the additional length added by inserting a point into a path."""
- if pointIndex is 0:
+ if not pointIndex:
return abs( point - path[0] )
if pointIndex == len(path):
return abs( point - path[-1] )
@@ -463,7 +461,7 @@ def getClosestOppositeIntersectionPaths( yIntersectionPaths ):
def getExtraFillLoops(loops, radius):
"""Get extra loops between inside and outside loops. Extra perimeters"""
- greaterThanRadius = radius / 0.7853 #todo was *1.4 ACT (radius /0.7853) how much the tight spots are covered by the extra loops
+ greaterThanRadius = radius /0.7853 #todo was *1.4 ACT (radius /0.7853) how much the tight spots are covered by the extra loops
extraFillLoops = []
centers = intercircle.getCentersFromPoints(intercircle.getPointsFromLoops(loops, greaterThanRadius), greaterThanRadius)
for center in centers:
@@ -936,7 +934,7 @@ def addFill(self, layerIndex):
extraShells = self.repository.extraShellsBase.value
if rotatedLayer.rotation is not None:
extraShells = 0
- self.infillSpacing *= self.bridgeWidthMultiplier
+ betweenWidth *= self.bridgeWidthMultiplier/0.7853 #todo check what is better with or without the normalizer
self.layerExtrusionSpacing *= self.bridgeWidthMultiplier
layerFillInset *= self.bridgeWidthMultiplier
self.distanceFeedRate.addLine('(<bridgeRotation> %s )' % rotatedLayer.rotation)
@@ -968,7 +966,7 @@ def addFill(self, layerIndex):
for extraShellIndex in xrange(extraShells):
createFillForSurroundings(nestedRings, self.layerExtrusionSpacing, True)
fillLoops = euclidean.getFillOfSurroundings(nestedRings, None)
- slightlyGreaterThanFill = 0.95 * layerFillInset #todo was 1.01 ACT 0.95 How much the parallel fill is filled
+ slightlyGreaterThanFill = 1.01 * layerFillInset #todo was 1.01 ACT 0.95 How much the parallel fill is filled
for loop in fillLoops:
alreadyFilledLoop = []
alreadyFilledArounds.append(alreadyFilledLoop)
@@ -1139,12 +1137,11 @@ def addGridLinePoints( self, begin, end, gridPoints, gridRotationAngle, offset,
gridXStep = self.getNextGripXStep(gridXStep)
gridXOffset = offset + self.gridXStepSize * float(gridXStep)
- def addRemainingGridPoints(
- self, arounds, gridPointInsetX, gridPointInsetY, gridPoints, isBothOrNone, paths, pixelTable, width):
+ def addRemainingGridPoints(self, arounds, gridPointInsetX, gridPointInsetY, gridPoints, isBothOrNone, paths, pixelTable, width):
"""Add the remaining grid points to the grid point list."""
for gridPointIndex in xrange( len( gridPoints ) - 1, - 1, - 1 ):
gridPoint = gridPoints[ gridPointIndex ]
- addAroundGridPoint( arounds, gridPoint, gridPointInsetX, gridPointInsetY, gridPoints, self.gridSearchRadius, isBothOrNone, self.isDoubleJunction, self.isJunctionWide, paths, pixelTable, width )
+ addAroundGridPoint( arounds, gridPoint, gridPointInsetX, gridPointInsetY, gridPoints, self.gridRadius, isBothOrNone, self.isDoubleJunction, self.isJunctionWide, paths, pixelTable, width )
def addRotatedCarve(self, currentLayer, layerDelta, reverseRotation, surroundingCarves):
"""Add a rotated carve to the surrounding carves."""
@@ -1231,7 +1228,7 @@ def getGridPoints(self, fillLoops, reverseRotation):
rotationBaseAngle = euclidean.getWiddershinsUnitPolar(self.infillBeginRotation)
reverseRotationBaseAngle = complex(rotationBaseAngle.real, - rotationBaseAngle.imag)
gridRotationAngle = reverseRotation * rotationBaseAngle
- slightlyGreaterThanFill = 1.01 * self.gridInset
+ slightlyGreaterThanFill = 1.01 * self.gridInset #todo 1.01 or 0.99
rotatedLoops = []
triangle_mesh.sortLoopsInOrderOfArea(True, fillLoops)
for fillLoop in fillLoops:
@@ -243,7 +243,7 @@ def __init__(self):
skeinforge_profile.addListsToCraftTypeRepository('skeinforge_application.skeinforge_plugins.craft_plugins.inset.html', self )
self.fileNameInput = settings.FileNameInput().getFromFileName( fabmetheus_interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Inset', self, '')
self.openWikiManualHelpPage = settings.HelpPage().getOpenFromAbsolute('http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Inset')
- self.bridgeWidthMultiplier = settings.FloatSpin().getFromValue( 0.7, 'Bridge Width Multiplier (ratio):', self, 2.0, 1.4 )
+ self.bridgeWidthMultiplier = settings.FloatSpin().getFromValue( 0.7, 'Bridge Width Multiplier (ratio):', self, 2.0, 1.4 )
self.loopOrderChoice = settings.MenuButtonDisplay().getFromName('In case of Conflict Solve:', self )
self.loopOrderAscendingArea = settings.MenuRadio().getFromMenuButtonDisplay( self.loopOrderChoice, 'Prefer Loops', self, False )
self.loopOrderDescendingArea = settings.MenuRadio().getFromMenuButtonDisplay( self.loopOrderChoice, 'Prefer Perimeter', self, True )
@@ -333,14 +333,14 @@ def addInitializationToOutput(self):
def addInset(self, rotatedLoopLayer):
"""Add inset to the layer."""
alreadyFilledArounds = []
- halfWidth = self.halfExtrusionWidth
+ extrusionSpacingHalfWidth = self.halfExtrusionWidth
if rotatedLoopLayer.rotation is not None:
- halfWidth *= self.repository.bridgeWidthMultiplier.value
+ extrusionSpacingHalfWidth *= self.repository.bridgeWidthMultiplier.value
self.distanceFeedRate.addTagBracketedLine('bridgeRotation', rotatedLoopLayer.rotation)
- extrudateLoops = intercircle.getInsetLoopsFromLoops(halfWidth, rotatedLoopLayer.loops)
+ extrudateLoops = intercircle.getInsetLoopsFromLoops(extrusionSpacingHalfWidth, rotatedLoopLayer.loops)
triangle_mesh.sortLoopsInOrderOfArea(not self.repository.loopOrderAscendingArea.value, extrudateLoops)
for extrudateLoop in extrudateLoops:
- self.addGcodeFromRemainingLoop(extrudateLoop, alreadyFilledArounds, halfWidth, rotatedLoopLayer)
+ self.addGcodeFromRemainingLoop(extrudateLoop, alreadyFilledArounds, extrusionSpacingHalfWidth, rotatedLoopLayer)
def getCraftedGcode(self, gcodeText, repository):
"""Parse gcode text and store the bevel gcode."""
@@ -373,7 +373,6 @@ def parseInitialization(self):
self.extrusionWidth = float(splitLine[1])
self.halfExtrusionWidth = 0.5 * self.extrusionWidth
self.overlapRemovalWidth = self.extrusionWidth * (0.7853) * self.repository.overlapRemovalWidthScaler.value
-
self.distanceFeedRate.addLine(line)
def parseLine(self, line):
@@ -79,7 +79,7 @@ def __init__(self):
skeinforge_profile.addListsToCraftTypeRepository('skeinforge_application.skeinforge_plugins.craft_plugins.skin.html', self )
self.fileNameInput = settings.FileNameInput().getFromFileName( fabmetheus_interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Skin', self, '')
self.openWikiManualHelpPage = settings.HelpPage().getOpenFromAbsolute('http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Skin')
- self.activateSkin = settings.BooleanSetting().getFromValue('Activate Skin: this is experimental', self, False )
+ self.activateSkin = settings.BooleanSetting().getFromValue('Activate Skin:', self, False )
self.clipOverPerimeterWidth = settings.FloatSpin().getFromValue(0.50, 'Clip Over Perimeter Width (scaler):', self, 1.50, 1.00)
self.layersFrom = settings.IntSpin().getSingleIncrementFromValue(0, 'Do Not Skin the first ... Layers:', self, 912345678, 3)
self.executeTitle = 'Skin'
@@ -103,7 +103,7 @@ def __init__(self):
self.oldFlowRate = None
self.oldLocation = None
self.perimeter = None
- self.travelFeedRateMinute = 957.0
+ self.travelFeedRateMinute = 999.0
def addFlowRateLine(self, flowRate):
"""Add a flow rate line."""
@@ -118,19 +118,17 @@ def addSkinnedPerimeter(self):
if self.perimeter is None:
return
self.perimeter = self.perimeter[: -1]
- innerPerimeter = intercircle.getLargestInsetLoopFromLoop(self.perimeter, self.quarterPerimeterWidth)
- innerPerimeter = self.getClippedSimplifiedLoopPathByLoop(innerPerimeter)
- outerPerimeter = intercircle.getLargestInsetLoopFromLoop(self.perimeter, -self.quarterPerimeterWidth)
+ outerPerimeter = self.perimeter
outerPerimeter = self.getClippedSimplifiedLoopPathByLoop(outerPerimeter)
- lowerZ = self.oldLocation.z - self.quarterLayerThickness
- higherZ = self.oldLocation.z + self.quarterLayerThickness
- self.addFlowRateLine(0.25 * self.oldFlowRate)
- self.addPerimeterLoop(innerPerimeter, lowerZ)
+
+
+ lowerZ = self.oldLocation.z - self.halfLayerThickness
+ higherZ = self.oldLocation.z
+ skinFlowRate=self.oldFlowRate*(((self.LayerThickness/2/0.7853 + self.PerimeterWidth)/4)**2*math.pi)/(((self.LayerThickness + self.PerimeterWidth)/4)**2*math.pi)
+ self.addFlowRateLine(skinFlowRate)#todo check
self.addPerimeterLoop(outerPerimeter, lowerZ)
- self.addPerimeterLoop(innerPerimeter, higherZ)
self.addPerimeterLoop(outerPerimeter, higherZ)
self.addFlowRateLine(self.oldFlowRate)
-
def getClippedSimplifiedLoopPathByLoop(self, loop):
"""Get clipped and simplified loop path from a loop."""
loopPath = loop + [loop[0]]
@@ -157,18 +155,18 @@ def parseInitialization(self):
self.distanceFeedRate.addLine('(<procedureName> skin </procedureName>)')
return
elif firstWord == '(<extrusionHeight>':
-
self.quarterLayerThickness = 0.25 * float(splitLine[1])
self.halfLayerThickness = 0.5 * float(splitLine[1])
+ self.LayerThickness = float(splitLine[1])
elif firstWord == '(<operatingFlowRate>':
self.oldFlowRate = float(splitLine[1])
elif firstWord == '(<extrusionWidth>':
extrusionWidth = float(splitLine[1])
self.quarterPerimeterWidth = 0.25 * extrusionWidth
self.halfPerimeterWidth = 0.5 * extrusionWidth
- self.clipLength = (self.halfLayerThickness - (self.repository.clipOverPerimeterWidth.value * self.quarterLayerThickness * ((0.7853))))*4
- elif firstWord == '(<travelFeedRatePerSecond>':
- self.travelFeedRateMinute = 60.0 * float(splitLine[1])
+ self.PerimeterWidth = extrusionWidth
+ self.clipLength = (self.repository.clipOverPerimeterWidth.value * self.halfLayerThickness * (0.7853))/2
+ elif firstWord == '(<travelFeedRate>': self.travelFeedRateMinute = 60.0 * float(splitLine[1])
self.distanceFeedRate.addLine(line)
def parseLine(self, line):
@@ -151,7 +151,7 @@ def __init__(self):
self.oldTemperatureInput = None
self.skirtFlowRate = None
self.skirtTemperature = None
- self.travelFeedRateMinute = 957.0
+ self.travelFeedRateMinute = 999.0
self.unifiedLoop = LoopCrossDictionary()
def addFlowRateLineIfDifferent(self, flowRate):
Oops, something went wrong. Retry.

0 comments on commit 43071b5

Please sign in to comment.