def linearCorner( self, splitLine ): "Update the bounding corners." location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine ) if self.extruderActive or self.goAroundExtruderOffTravel: self.cornerHigh = euclidean.getPointMaximum( self.cornerHigh, location ) self.cornerLow = euclidean.getPointMinimum( self.cornerLow, location ) self.oldLocation = location
def linearCorner( self, splitLine ): "Update the bounding corners." location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine ) if self.extruderActive: self.cornerHigh = euclidean.getPointMaximum( self.cornerHigh, location ) self.cornerLow = euclidean.getPointMinimum( self.cornerLow, location ) self.oldLocation = location
def getCarveRotatedBoundaryLayers( self ): "Get the rotated boundary layers." if len( self.carvableObjectInfos ) < 1: return [] self.cornerMaximum = Vector3( - 999999999.0, - 999999999.0, - 9999999999.9 ) self.cornerMinimum = Vector3( 999999999.0, 999999999.0, 9999999999.9 ) for carvableObjectInfo in self.carvableObjectInfos: self.cornerMaximum.z = max( self.cornerMaximum.z, carvableObjectInfo.top ) self.cornerMinimum.z = min( self.cornerMinimum.z, carvableObjectInfo.bottom ) halfHeight = 0.5 * self.layerThickness layerTop = self.cornerMaximum.z - halfHeight self.setActualMinimumZ( halfHeight, layerTop ) self.zZoneInterval = triangle_mesh.getZoneInterval( self.layerThickness ) z = self.cornerMinimum.z + halfHeight while z < layerTop: z = self.getZAddExtruderPaths( z ) for rotatedBoundaryLayer in self.rotatedBoundaryLayers: for loop in rotatedBoundaryLayer.loops: for point in loop: pointVector3 = Vector3( point.real, point.imag, rotatedBoundaryLayer.z ) self.cornerMaximum = euclidean.getPointMaximum( self.cornerMaximum, pointVector3 ) self.cornerMinimum = euclidean.getPointMinimum( self.cornerMinimum, pointVector3 ) self.cornerMaximum.z = layerTop + halfHeight for rotatedBoundaryLayerIndex in xrange( len( self.rotatedBoundaryLayers ) - 1, - 1, - 1 ): rotatedBoundaryLayer = self.rotatedBoundaryLayers[ rotatedBoundaryLayerIndex ] if len( rotatedBoundaryLayer.loops ) > 0: return self.rotatedBoundaryLayers[ : rotatedBoundaryLayerIndex + 1 ] return []
def linearMove( self, splitLine ): "Get statistics for a linear move." location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine ) self.cornerMaximum = euclidean.getPointMaximum( self.cornerMaximum, location ) self.cornerMinimum = euclidean.getPointMinimum( self.cornerMinimum, location ) self.thread.append( location.dropAxis( 2 ) ) self.oldLocation = location
def linearCorner(self, splitLine): "Update the bounding corners." location = gcodec.getLocationFromSplitLine(self.oldLocation, splitLine) if self.extruderActive or self.repository.goAroundExtruderOffTravel.value: self.cornerHigh = euclidean.getPointMaximum( self.cornerHigh, location) self.cornerLow = euclidean.getPointMinimum(self.cornerLow, location) self.oldLocation = location
def getCarveRotatedBoundaryLayers(self): "Get the rotated boundary layers." self.cornerMaximum = Vector3(-999999999.0, -999999999.0, self.maximumZ) self.cornerMinimum = Vector3(999999999.0, 999999999.0, self.minimumZ) for rotatedBoundaryLayer in self.rotatedBoundaryLayers: for loop in rotatedBoundaryLayer.loops: for point in loop: pointVector3 = Vector3(point.real, point.imag, rotatedBoundaryLayer.z) self.cornerMaximum = euclidean.getPointMaximum(self.cornerMaximum, pointVector3) self.cornerMinimum = euclidean.getPointMinimum(self.cornerMinimum, pointVector3) return self.rotatedBoundaryLayers
def linearCorner( self, splitLine ): "Update the bounding corners." location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine ) if self.extruderActive or self.goAroundExtruderOffTravel: self.cornerHigh = euclidean.getPointMaximum( self.cornerHigh, location ) self.cornerLow = euclidean.getPointMinimum( self.cornerLow, location ) if self.extruderActive and self.hasASurroundingLoopBeenReached: if location.z > self.getLayerTop(): layerTop = location.z + 0.33333333333 * self.layerThickness self.layerTops.append( layerTop ) self.oldLocation = location
def addToPath( self, location ): "Add a point to travel and maybe extrusion." if self.oldLocation != None: travel = location.distance( self.oldLocation ) if self.feedRateMinute > 0.0: self.totalBuildTime += 60.0 * travel / self.feedRateMinute self.totalDistanceTraveled += travel if self.extruderActive: self.totalDistanceExtruded += travel self.cornerHigh = euclidean.getPointMaximum( self.cornerHigh, location ) self.cornerLow = euclidean.getPointMinimum( self.cornerLow, location ) self.oldLocation = location
def addToPath( self, location ): "Add a point to travel and maybe extrusion." if self.oldLocation != None: travel = location.distance( self.oldLocation ) if self.feedrateMinute > 0.0: self.totalBuildTime += 60.0 * travel / self.feedrateMinute self.totalDistanceTraveled += travel if self.extruderActive: self.totalDistanceExtruded += travel self.cornerHigh = euclidean.getPointMaximum( self.cornerHigh, location ) self.cornerLow = euclidean.getPointMinimum( self.cornerLow, location ) self.oldLocation = location
def linearMove(self, splitLine): "Get statistics for a linear move." location = gcodec.getLocationFromSplitLine(self.oldLocation, splitLine) self.cornerMaximum = euclidean.getPointMaximum(self.cornerMaximum, location) self.cornerMinimum = euclidean.getPointMinimum(self.cornerMinimum, location) if self.extruderActive: if len(self.thread) == 0: self.thread = [self.oldLocation.dropAxis(2)] self.thread.append(location.dropAxis(2)) self.oldLocation = location
def getCarveRotatedBoundaryLayers( self ): "Get the rotated boundary layers." self.cornerMaximum = Vector3( - 999999999.0, - 999999999.0, self.maximumZ ) self.cornerMinimum = Vector3( 999999999.0, 999999999.0, self.minimumZ ) for rotatedBoundaryLayer in self.rotatedBoundaryLayers: for loop in rotatedBoundaryLayer.loops: for point in loop: pointVector3 = Vector3( point.real, point.imag, rotatedBoundaryLayer.z ) self.cornerMaximum = euclidean.getPointMaximum( self.cornerMaximum, pointVector3 ) self.cornerMinimum = euclidean.getPointMinimum( self.cornerMinimum, pointVector3 ) halfLayerThickness = 0.5 * self.layerThickness self.cornerMaximum.z += halfLayerThickness self.cornerMinimum.z -= halfLayerThickness return self.rotatedBoundaryLayers
def getCarveRotatedBoundaryLayers( self ): "Get the rotated boundary layers." self.cornerMaximum = Vector3( - 999999999.0, - 999999999.0, - 999999999.0 ) self.cornerMinimum = Vector3( 999999999.0, 999999999.0, 999999999.0 ) for point in self.vertices: self.cornerMaximum = euclidean.getPointMaximum( self.cornerMaximum, point ) self.cornerMinimum = euclidean.getPointMinimum( self.cornerMinimum, point ) halfHeight = 0.5 * self.layerThickness self.zZoneInterval = getZoneInterval( self.layerThickness ) layerTop = self.cornerMaximum.z - halfHeight * 0.5 z = self.cornerMinimum.z + halfHeight while z < layerTop: z = self.getZAddExtruderPaths( z ) return self.rotatedBoundaryLayers
def getCarveRotatedBoundaryLayers(self): "Get the rotated boundary layers." self.importModule() self.cornerMaximum = Vector3(-999999999.0, -999999999.0, self.maximumZ) self.cornerMinimum = Vector3(999999999.0, 999999999.0, self.minimumZ) for rotatedBoundaryLayer in self.rotatedBoundaryLayers: for loop in rotatedBoundaryLayer.loops: for point in loop: pointVector3 = Vector3(point.real, point.imag, rotatedBoundaryLayer.z) self.cornerMaximum = euclidean.getPointMaximum(self.cornerMaximum, pointVector3) self.cornerMinimum = euclidean.getPointMinimum(self.cornerMinimum, pointVector3) halfLayerThickness = 0.5 * self.layerThickness self.cornerMaximum.z += halfLayerThickness self.cornerMinimum.z -= halfLayerThickness return self.rotatedBoundaryLayers