コード例 #1
0
	def _checkBboxSegment(self, bcp1, bcp2, pt):
		# Like _checkBbox, but checks the whole segment and calculates extrema
		myRect = normRect((self._prev[0], self._prev[1], pt[0], pt[1]))
		if not pointInRect(bcp1, myRect) or not pointInRect(bcp2, myRect):
			extrema = getExtremaForCubic(self._prev, bcp1, bcp2, pt, h=True, v=True)
			for p in extrema:
				if self.extremum_calculate_badness:
					badness = self._getBadness(p, myRect)
					if badness >= self.extremum_ignore_badness_below:
						self.errors.append(OutlineError(p, "Extremum", badness))
				else:
					self.errors.append(OutlineError(p, "Extremum"))
コード例 #2
0
 def _checkBboxSegment(self, bcp1, bcp2, pt):
     # Like _checkBbox, but checks the whole segment and calculates extrema
     myRect = normRect((self._prev[0], self._prev[1], pt[0], pt[1]))
     if not pointInRect(bcp1, myRect) or not pointInRect(bcp2, myRect):
         extrema, vectors = getExtremaForCubic(self._prev,
                                               bcp1,
                                               bcp2,
                                               pt,
                                               h=True,
                                               v=True)
         for i, p in enumerate(extrema):
             if self.extremum_calculate_badness:
                 badness = self._getBadness(p, myRect)
                 if badness >= self.extremum_ignore_badness_below:
                     self.errors.append(
                         OutlineError(p, "Extremum", badness, vectors[i]))
             else:
                 self.errors.append(
                     OutlineError(p, "Extremum", vector=vectors[i]))
コード例 #3
0
	def _checkBbox(self, pointToCheck, boxPoint):
		# boxPoint is the final point of the current node,
		# the other bbox point is the previous final point
		myRect = normRect((self._prev[0], self._prev[1], boxPoint[0], boxPoint[1]))
		if not pointInRect(pointToCheck, myRect):
			if self.extremum_calculate_badness:
				badness = self._getBadness(pointToCheck, myRect)
				if badness >= self.extremum_ignore_badness_below:
					self.errors.append(OutlineError(pointToCheck, "Extremum", badness))
			else:
				self.errors.append(OutlineError(pointToCheck, "Extremum"))
コード例 #4
0
 def _checkBbox(self, pointToCheck, boxPoint):
     # boxPoint is the final point of the current node,
     # the other bbox point is the previous final point
     myRect = normRect(
         (self._prev[0], self._prev[1], boxPoint[0], boxPoint[1]))
     if not pointInRect(pointToCheck, myRect):
         if self.extremum_calculate_badness:
             badness = self._getBadness(pointToCheck, myRect)
             if badness >= self.extremum_ignore_badness_below:
                 self.errors.append(
                     OutlineError(pointToCheck, "Extremum", badness, None))
         else:
             self.errors.append(
                 OutlineError(pointToCheck, "Extremum", vector=None))