def fits_line(self, pJ, p0, p1): ''' compares the angle p1-p0-pJ. return true if the distance d (p0-pJ) is c*(1-delta) < d < c*(1+delta) where c is critdist() the angle p1-p0-pJ is within rho degrees of 180 ''' if GridPoint(pJ) in self.connectivity: return False #import pdb #pdb.set_trace() c = self.critdist() distance_cond = within_distance(c, p0, pJ, self.delta) angle_cond = is_parallel(pJ - p0, p1 - p0, self.rho_loose) return (distance_cond and angle_cond)
def fits_line(self, pJ, p0, p1): ''' compares the angle p1-p0-pJ. return true if the distance d (p0-pJ) is c*(1-delta) < d < c*(1+delta) where c is critdist() the angle p1-p0-pJ is within rho degrees of 180 ''' if GridPoint(pJ) in self.connectivity: return False #import pdb #pdb.set_trace() c = self.critdist() distance_cond = within_distance(c, p0, pJ, self.delta) angle_cond = is_parallel(pJ-p0, p1-p0, self.rho_loose) return (distance_cond and angle_cond)
def fits_parallel(self, pJ, p0, p1, pX, pZ): ''' fits a point parallel to a corner returns true if the distance d (p0-pJ) is within 1*delta of c the angle pC-p0-p1 is within rho degrees of 90 the line pC-p0 is parallel to pX-pZ within rho_strict degrees here, p0 is the actual p0 next to pJ unlike in the above method ''' if GridPoint(pJ) in self.connectivity: return False if p1 is None or pX is None or pZ is None: return False c = self.critdist() distance_cond = within_distance(c, pJ, p0, self.delta) angle_cond = is_perpend(pJ - p0, p1 - p0, self.rho) parallel_cond = is_parallel(pJ - p0, pZ - pX, self.rho_strict) return (distance_cond and angle_cond and parallel_cond)
def fits_parallel(self, pJ, p0, p1, pX, pZ): ''' fits a point parallel to a corner returns true if the distance d (p0-pJ) is within 1*delta of c the angle pC-p0-p1 is within rho degrees of 90 the line pC-p0 is parallel to pX-pZ within rho_strict degrees here, p0 is the actual p0 next to pJ unlike in the above method ''' if GridPoint(pJ) in self.connectivity: return False if p1 is None or pX is None or pZ is None: return False c = self.critdist() distance_cond = within_distance(c, pJ, p0, self.delta) angle_cond = is_perpend(pJ-p0, p1-p0, self.rho) parallel_cond = is_parallel(pJ-p0, pZ-pX, self.rho_strict) return (distance_cond and angle_cond and parallel_cond)