def addSegmentTableLoops( self, boundaryLayerIndex ): "Add the segment tables and loops to the boundary." boundaryLayer = self.boundaryLayers[ boundaryLayerIndex ] euclidean.subtractXIntersectionsTable( boundaryLayer.outerHorizontalTable, boundaryLayer.innerHorizontalTable ) euclidean.subtractXIntersectionsTable( boundaryLayer.outerVerticalTable, boundaryLayer.innerVerticalTable ) boundaryLayer.horizontalSegmentTable = self.getHorizontalSegmentTableForXIntersectionsTable( boundaryLayer.outerHorizontalTable ) boundaryLayer.verticalSegmentTable = self.getVerticalSegmentTableForXIntersectionsTable( boundaryLayer.outerVerticalTable ) innerHorizontalSegmentTable = self.getHorizontalSegmentTableForXIntersectionsTable( boundaryLayer.innerHorizontalTable ) innerVerticalSegmentTable = self.getVerticalSegmentTableForXIntersectionsTable( boundaryLayer.innerVerticalTable ) betweenPoints = getPointsFromSegmentTable( boundaryLayer.horizontalSegmentTable ) betweenPoints += getPointsFromSegmentTable( boundaryLayer.verticalSegmentTable ) innerPoints = getPointsFromSegmentTable( innerHorizontalSegmentTable ) innerPoints += getPointsFromSegmentTable( innerVerticalSegmentTable ) innerPointTable = {} for innerPoint in innerPoints: innerPointTable[ innerPoint ] = None boundaryLayer.innerLoops = [] boundaryLayer.outerLoops = [] millRadius = 0.75 * self.millWidth loops = triangle_mesh.getInclusiveLoops( betweenPoints, betweenPoints, millRadius ) loops = euclidean.getSimplifiedLoops( loops, millRadius ) for loop in loops: if isPointOfTableInLoop( loop, innerPointTable ): boundaryLayer.innerLoops.append( loop ) else: boundaryLayer.outerLoops.append( loop ) if self.repository.crossHatch.value and boundaryLayerIndex % 2 == 1: boundaryLayer.segmentTable = boundaryLayer.verticalSegmentTable else: boundaryLayer.segmentTable = boundaryLayer.horizontalSegmentTable
def getJoinedLoops( self, importRadius, subObjectInfoLoopsList ): "Get joined loops sliced through shape." loops = [] for subObjectInfoLoops in subObjectInfoLoopsList: loops += subObjectInfoLoops corners = [] for loop in loops: corners += loop corners += getLoopsListsIntersections( subObjectInfoLoopsList ) allPoints = corners[ : ] allPoints += getInBetweenPointsFromLoops( importRadius, loops ) return triangle_mesh.getInclusiveLoops( allPoints, corners, importRadius, False )
def getIntersectedLoops( self, importRadius, subObjectInfoLoopsList ): "Get intersected loops sliced through shape." firstLoops = subObjectInfoLoopsList[ 0 ] lastLoops = getJoinedList( subObjectInfoLoopsList[ 1 : ] ) radiusSide = 0.01 * importRadius corners = getPointsBoundarySideLoops( True, firstLoops, getJoinedList( lastLoops ), radiusSide ) corners += getPointsBoundarySideLoops( True, lastLoops, getJoinedList( firstLoops ), radiusSide ) corners += getLoopsListsIntersections( subObjectInfoLoopsList ) allPoints = corners[ : ] allPoints += getInBetweenPointsFromLoopsBoundarySideOtherLoops( True, importRadius, lastLoops, firstLoops, radiusSide ) allPoints += getInBetweenPointsFromLoopsBoundarySideOtherLoops( True, importRadius, firstLoops, lastLoops, radiusSide ) return triangle_mesh.getInclusiveLoops( allPoints, corners, importRadius, False )
def getSubtractedLoops( self, importRadius, subObjectInfoLoopsList ): "Get subtracted loops sliced through shape." negativeLoops = getJoinedList( subObjectInfoLoopsList[ 1 : ] ) positiveLoops = subObjectInfoLoopsList[ 0 ] radiusSide = 0.01 * importRadius corners = getPointsBoundarySideLoops( True, positiveLoops, getJoinedList( negativeLoops ), radiusSide ) corners += getPointsBoundarySideLoops( False, negativeLoops, getJoinedList( positiveLoops ), radiusSide ) loopsListsIntersections = getLoopsListsIntersections( subObjectInfoLoopsList ) corners += loopsListsIntersections allPoints = corners[ : ] allPoints += getInBetweenPointsFromLoopsBoundarySideOtherLoops( True, importRadius, negativeLoops, positiveLoops, radiusSide ) allPoints += getInBetweenPointsFromLoopsBoundarySideOtherLoops( False, importRadius, positiveLoops, negativeLoops, radiusSide ) return triangle_mesh.getInclusiveLoops( allPoints, corners, importRadius, False )
def addSegmentTableLoops(self, boundaryLayerIndex): "Add the segment tables and loops to the boundary." boundaryLayer = self.boundaryLayers[boundaryLayerIndex] euclidean.subtractXIntersectionsTable( boundaryLayer.outerHorizontalTable, boundaryLayer.innerHorizontalTable) euclidean.subtractXIntersectionsTable(boundaryLayer.outerVerticalTable, boundaryLayer.innerVerticalTable) boundaryLayer.horizontalSegmentTable = self.getHorizontalSegmentTableForXIntersectionsTable( boundaryLayer.outerHorizontalTable) boundaryLayer.verticalSegmentTable = self.getVerticalSegmentTableForXIntersectionsTable( boundaryLayer.outerVerticalTable) innerHorizontalSegmentTable = self.getHorizontalSegmentTableForXIntersectionsTable( boundaryLayer.innerHorizontalTable) innerVerticalSegmentTable = self.getVerticalSegmentTableForXIntersectionsTable( boundaryLayer.innerVerticalTable) betweenPoints = getPointsFromSegmentTable( boundaryLayer.horizontalSegmentTable) betweenPoints += getPointsFromSegmentTable( boundaryLayer.verticalSegmentTable) innerPoints = getPointsFromSegmentTable(innerHorizontalSegmentTable) innerPoints += getPointsFromSegmentTable(innerVerticalSegmentTable) innerPointTable = {} for innerPoint in innerPoints: innerPointTable[innerPoint] = None boundaryLayer.innerLoops = [] boundaryLayer.outerLoops = [] millRadius = 0.75 * self.millWidth loops = triangle_mesh.getInclusiveLoops(betweenPoints, betweenPoints, millRadius) loops = euclidean.getSimplifiedLoops(loops, millRadius) for loop in loops: if isPointOfTableInLoop(loop, innerPointTable): boundaryLayer.innerLoops.append(loop) else: boundaryLayer.outerLoops.append(loop) if self.repository.crossHatch.value and boundaryLayerIndex % 2 == 1: boundaryLayer.segmentTable = boundaryLayer.verticalSegmentTable else: boundaryLayer.segmentTable = boundaryLayer.horizontalSegmentTable