def getCarveRotatedBoundaryLayers(self): "Get the rotated boundary layers." vertexes = [] for visibleObject in evaluate.getVisibleObjects(self.archivableObjects): vertexes += visibleObject.getTransformedVertexes() if len(vertexes) < 1: return [] self.cornerMaximum = Vector3(-999999999.0, - 999999999.0, - 9999999999.9) self.cornerMinimum = Vector3(999999999.0, 999999999.0, 9999999999.9) for vertex in vertexes: self.cornerMaximum.z = max(self.cornerMaximum.z, vertex.z) self.cornerMinimum.z = min(self.cornerMinimum.z, vertex.z) trianglemesh.initializeZoneIntervalTable(self, vertexes) halfHeight = 0.5 * self.layerThickness self.setActualMinimumZ(halfHeight) z = self.cornerMinimum.z + halfHeight while z < self.cornerMaximum.z: 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) 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 getCarveRotatedBoundaryLayers( self ): "Get the rotated boundary layers." vertices = evaluate.getVerticesFromArchivableObjects( self.archivableObjects ) if len( vertices ) < 1: return [] self.cornerMaximum = Vector3( - 999999999.0, - 999999999.0, - 9999999999.9 ) self.cornerMinimum = Vector3( 999999999.0, 999999999.0, 9999999999.9 ) for vertex in vertices: self.cornerMaximum.z = max( self.cornerMaximum.z, vertex.z ) self.cornerMinimum.z = min( self.cornerMinimum.z, vertex.z ) halfHeight = 0.5 * self.layerThickness layerTop = self.cornerMaximum.z - halfHeight self.setActualMinimumZ( halfHeight, layerTop ) trianglemesh.initializeZoneIntervalTable( self, vertices ) 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 getCarveRotatedBoundaryLayers(self): "Get the rotated boundary layers." vertexes = [] for visibleObject in evaluate.getVisibleObjects(self.archivableObjects): vertexes += visibleObject.getTransformedVertexes() if len(vertexes) < 1: return [] self.maximumZ = -912345678.0 self.minimumZ = 912345678.0 for vertex in vertexes: self.maximumZ = max(self.maximumZ, vertex.z) self.minimumZ = min(self.minimumZ, vertex.z) trianglemesh.initializeZoneIntervalTable(self, vertexes) halfHeight = 0.5 * self.layerThickness self.setActualMinimumZ(halfHeight) z = self.minimumZ + halfHeight while z < self.maximumZ: z = self.getZAddExtruderPaths(z) self.cornerMaximum = Vector3(-912345678.0, -912345678.0, -912345678.0) self.cornerMinimum = Vector3(912345678.0, 912345678.0, 912345678.0) for rotatedLoopLayer in self.rotatedLoopLayers: for loop in rotatedLoopLayer.loops: for point in loop: pointVector3 = Vector3(point.real, point.imag, rotatedLoopLayer.z) self.cornerMaximum.maximize(pointVector3) self.cornerMinimum.minimize(pointVector3) self.cornerMaximum.z += halfHeight self.cornerMinimum.z -= halfHeight for rotatedLoopLayerIndex in xrange(len(self.rotatedLoopLayers) -1, -1, -1): rotatedLoopLayer = self.rotatedLoopLayers[rotatedLoopLayerIndex] if len(rotatedLoopLayer.loops) > 0: return self.rotatedLoopLayers[: rotatedLoopLayerIndex + 1] return []