Пример #1
0
	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
Пример #2
0
	def getUnion( self, importRadius, subObjectLoopsList ):
		"Get joined loops sliced through shape."
		loops = []
		for subObjectLoops in subObjectLoopsList:
			loops += subObjectLoops
		corners = []
		for loop in loops:
			corners += loop
		corners += getLoopsListsIntersections( subObjectLoopsList )
		allPoints = corners[ : ]
		allPoints += getInBetweenPointsFromLoops( importRadius, loops )
		return triangle_mesh.getInclusiveLoops( allPoints, corners, importRadius, False )
Пример #3
0
	def getIntersection( self, importRadius, subObjectLoopsList ):
		"Get intersected loops sliced through shape."
		firstLoops = subObjectLoopsList[ 0 ]
		lastLoops = getJoinedList( subObjectLoopsList[ 1 : ] )
		radiusSide = 0.01 * importRadius
		corners = getPointsBoundarySideLoops( True, firstLoops, getJoinedList( lastLoops ), radiusSide )
		corners += getPointsBoundarySideLoops( True, lastLoops, getJoinedList( firstLoops ), radiusSide )
		corners += getLoopsListsIntersections( subObjectLoopsList )
		allPoints = corners[ : ]
		allPoints += getInBetweenPointsFromLoopsBoundarySideOtherLoops( True, importRadius, lastLoops, firstLoops, radiusSide )
		allPoints += getInBetweenPointsFromLoopsBoundarySideOtherLoops( True, importRadius, firstLoops, lastLoops, radiusSide )
		return triangle_mesh.getInclusiveLoops( allPoints, corners, importRadius, False )
Пример #4
0
	def getFirstMinusComplement( self, importRadius, subObjectLoopsList ):
		"Get subtracted loops sliced through shape."
		negativeLoops = getJoinedList( subObjectLoopsList[ 1 : ] )
		positiveLoops = subObjectLoopsList[ 0 ]
		radiusSide = 0.01 * importRadius
		corners = getPointsBoundarySideLoops( True, positiveLoops, getJoinedList( negativeLoops ), radiusSide )
		corners += getPointsBoundarySideLoops( False, negativeLoops, getJoinedList( positiveLoops ), radiusSide )
		loopsListsIntersections = getLoopsListsIntersections( subObjectLoopsList )
		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 )
Пример #5
0
 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