Пример #1
0
def getInsetSeparateLoopsFromLoops(inset, loops, thresholdRatio=0.9):
    "Get the separate inset loops."
    isInset = inset > 0
    insetSeparateLoops = []
    radius = abs(inset)
    arounds = getAroundsFromLoops(loops, radius, thresholdRatio)
    for around in arounds:
        leftPoint = euclidean.getLeftPoint(around)
        if isInset == euclidean.isInFilledRegion(loops, leftPoint):
            if isInset:
                around.reverse()
            insetSeparateLoops.append(around)
    return insetSeparateLoops
Пример #2
0
def getInsetSeparateLoopsFromLoops( inset, loops, thresholdRatio = 0.9 ):
	"Get the separate inset loops."
	isInset = inset > 0
	insetSeparateLoops = []
	radius = abs( inset )
	arounds = getAroundsFromLoops( loops, radius, thresholdRatio )
	for around in arounds:
		leftPoint = euclidean.getLeftPoint( around )
		if isInset == euclidean.isInFilledRegion( loops, leftPoint ):
			if isInset:
				around.reverse()
			insetSeparateLoops.append( around )
	return insetSeparateLoops
Пример #3
0
	def getLoopsFromMesh( self, z ):
		"Get loops from a carve of a mesh."
		originalLoops = []
		if self.isCorrectMesh:
			originalLoops = getLoopsFromCorrectMesh( self.edges, self.faces, self.getVertices(), z )
		if len( originalLoops ) < 1:
			originalLoops = getLoopsFromUnprovenMesh( self.edges, self.faces, self.importRadius, self.getVertices(), z )
		loops = getLoopsInOrderOfArea( compareAreaDescending, euclidean.getSimplifiedLoops( originalLoops, self.importRadius ) )
		for loopIndex in xrange( len( loops ) ):
			loop = loops[ loopIndex ]
			leftPoint = euclidean.getLeftPoint( loop )
			isInFilledRegion = euclidean.isInFilledRegion( loops[ : loopIndex ] + loops[ loopIndex + 1 : ], leftPoint )
			if isInFilledRegion == euclidean.isWiddershins( loop ):
				loop.reverse()
		return loops
Пример #4
0
 def getLoopsFromMesh(self, z):
     "Get loops from a carve of a mesh."
     originalLoops = []
     if self.isCorrectMesh:
         originalLoops = getLoopsFromCorrectMesh(self.edges, self.faces,
                                                 self.vertices, z)
     if len(originalLoops) < 1:
         originalLoops = getLoopsFromUnprovenMesh(self.edges, self.faces,
                                                  self.importRadius,
                                                  self.vertices, z)
     loops = getLoopsInOrderOfArea(
         compareAreaDescending,
         euclidean.getSimplifiedLoops(originalLoops, self.importRadius))
     for loopIndex in xrange(len(loops)):
         loop = loops[loopIndex]
         leftPoint = euclidean.getLeftPoint(loop)
         isInFilledRegion = euclidean.isInFilledRegion(
             loops[:loopIndex] + loops[loopIndex + 1:], leftPoint)
         if isInFilledRegion == euclidean.isWiddershins(loop):
             loop.reverse()
     return loops