コード例 #1
0
ファイル: inset.py プロジェクト: aliensr85/skeinforge
def getIsIntersectingWithinList( loop, loopList ):
	"Determine if the loop is intersecting or is within the loop list."
	leftPoint = euclidean.getLeftPoint( loop )
	for otherLoop in loopList:
		if euclidean.getNumberOfIntersectionsToLeft( otherLoop, leftPoint ) % 2 == 1:
			return True
	return euclidean.isLoopIntersectingLoops( loop, loopList )
コード例 #2
0
ファイル: inset.py プロジェクト: TeamTeamUSA/SkeinFox
def isIntersectingWithinList( loop, loopList ):
	"Determine if the loop is intersecting or is within the loop list."
	if euclidean.isLoopIntersectingLoops( loop, loopList ):
		return True
	totalNumberOfIntersections = 0
	for otherLoop in loopList:
		leftPoint = euclidean.getLeftPoint( otherLoop )
		totalNumberOfIntersections += euclidean.getNumberOfIntersectionsToLeft( leftPoint, loop )
	return totalNumberOfIntersections % 2 == 1
コード例 #3
0
ファイル: inset.py プロジェクト: lImbus/giseburt-ReplicatorG
def isIntersectingWithinList(loop, loopList):
    "Determine if the loop is intersecting or is within the loop list."
    if euclidean.isLoopIntersectingLoops(loop, loopList):
        return True
    totalNumberOfIntersections = 0
    for otherLoop in loopList:
        leftPoint = euclidean.getLeftPoint(otherLoop)
        totalNumberOfIntersections += euclidean.getNumberOfIntersectionsToLeft(
            leftPoint, loop)
    return totalNumberOfIntersections % 2 == 1
コード例 #4
0
def getLoopsFromCorrectMesh( edges, faces, vertices, z ):
	"Get loops from a carve of a correct mesh."
	remainingEdgeTable = getRemainingEdgeTable( edges, vertices, z )
	remainingValues = remainingEdgeTable.values()
	for edge in remainingValues:
		if len( edge.faceIndexes ) < 2:
			print( 'This should never happen, there is a hole in the triangle mesh, each edge should have two faces.' )
			print( edge )
			print( "Something will still be printed, but there is no guarantee that it will be the correct shape." )
			print( 'Once the gcode is saved, you should check over the layer with a z of:' )
			print( z )
			return []
	loops = []
	while isPathAdded( edges, faces, loops, remainingEdgeTable, vertices, z ):
		pass
	for loopIndex in xrange( len( loops ) - 1 ):
		loop = loops[ loopIndex ]
		if euclidean.isLoopIntersectingLoops( loop, loops[ loopIndex + 1 : ] ):
			print( 'This should never happen, the triangle mesh slice intersects itself.' )
			print( "Something will still be printed, but there is no guarantee that it will be the correct shape." )
			print( 'Once the gcode is saved, you should check over the layer with a z of:' )
			print( z )
			return []
	return loops