Skip to content

Commit

Permalink
Fix ClippingShape.is_completely_{inside,outside} spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
musicinmybrain committed May 2, 2024
1 parent c64dd71 commit b9d46f0
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/ezdxf/tools/clipping_portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ class ClippingShape(abc.ABC):
def bbox(self) -> BoundingBox2d: ...

@abc.abstractmethod
def is_completley_inside(self, other: BoundingBox2d) -> bool: ...
def is_completely_inside(self, other: BoundingBox2d) -> bool: ...

# returning False means: I don't know!

@abc.abstractmethod
def is_completley_outside(self, other: BoundingBox2d) -> bool: ...
def is_completely_outside(self, other: BoundingBox2d) -> bool: ...

@abc.abstractmethod
def clip_point(self, point: Vec2) -> Optional[Vec2]: ...
Expand Down Expand Up @@ -248,9 +248,9 @@ def clip_line(self, start: Vec2, end: Vec2) -> Sequence[tuple[Vec2, Vec2]]:
def clip_polyline(self, points: NumpyPoints2d) -> Sequence[NumpyPoints2d]:
clipper = self.clipper
polyline_bbox = BoundingBox2d(points.extents())
if self.is_completley_outside(polyline_bbox):
if self.is_completely_outside(polyline_bbox):
return tuple()
if self.is_completley_inside(polyline_bbox):
if self.is_completely_inside(polyline_bbox):
return (points,)
return [
NumpyPoints2d(part)
Expand All @@ -261,9 +261,9 @@ def clip_polyline(self, points: NumpyPoints2d) -> Sequence[NumpyPoints2d]:
def clip_polygon(self, points: NumpyPoints2d) -> Sequence[NumpyPoints2d]:
clipper = self.clipper
polygon_bbox = BoundingBox2d(points.extents())
if self.is_completley_outside(polygon_bbox):
if self.is_completely_outside(polygon_bbox):
return tuple()
if self.is_completley_inside(polygon_bbox):
if self.is_completely_inside(polygon_bbox):
return (points,)
return [
NumpyPoints2d(part)
Expand All @@ -278,10 +278,10 @@ def clip_paths(
for path in paths:
for sub_path in path.sub_paths():
path_bbox = BoundingBox2d(sub_path.control_vertices())
if self.is_completley_inside(path_bbox):
if self.is_completely_inside(path_bbox):
yield sub_path
continue
if self.is_completley_outside(path_bbox):
if self.is_completely_outside(path_bbox):
continue
polyline = Vec2.list(sub_path.flattening(max_sagitta, segments=4))
for part in clipper.clip_polyline(polyline):
Expand All @@ -297,10 +297,10 @@ def clip_filled_paths(
if len(sub_path) < 2:
continue
path_bbox = BoundingBox2d(sub_path.control_vertices())
if self.is_completley_inside(path_bbox):
if self.is_completely_inside(path_bbox):
yield sub_path
continue
if self.is_completley_outside(path_bbox):
if self.is_completely_outside(path_bbox):
continue
for part in clipper.clip_polygon(
Vec2.list(sub_path.flattening(max_sagitta, segments=4))
Expand Down Expand Up @@ -328,10 +328,10 @@ def __init__(self, vertices: Iterable[UVec]) -> None:

super().__init__(bbox, ClippingRect2d(bbox.extmin, bbox.extmax))

def is_completley_inside(self, other: BoundingBox2d) -> bool:
def is_completely_inside(self, other: BoundingBox2d) -> bool:
return self._bbox.contains(other)

def is_completley_outside(self, other: BoundingBox2d) -> bool:
def is_completely_outside(self, other: BoundingBox2d) -> bool:
return not self._bbox.has_intersection(other)

def clip_point(self, point: Vec2) -> Optional[Vec2]:
Expand Down Expand Up @@ -381,10 +381,10 @@ def __init__(self, vertices: Iterable[UVec]) -> None:
polygon = Vec2.list(vertices)
super().__init__(BoundingBox2d(polygon), ConvexClippingPolygon2d(polygon))

def is_completley_inside(self, other: BoundingBox2d) -> bool:
def is_completely_inside(self, other: BoundingBox2d) -> bool:
return False # I don't know!

def is_completley_outside(self, other: BoundingBox2d) -> bool:
def is_completely_outside(self, other: BoundingBox2d) -> bool:
return not self._bbox.has_intersection(other)


Expand All @@ -400,10 +400,10 @@ def __init__(self, vertices: Iterable[UVec]) -> None:
polygon = Vec2.list(vertices)
super().__init__(BoundingBox2d(polygon), ConcaveClippingPolygon2d(polygon))

def is_completley_inside(self, other: BoundingBox2d) -> bool:
def is_completely_inside(self, other: BoundingBox2d) -> bool:
return False # I don't know!

def is_completley_outside(self, other: BoundingBox2d) -> bool:
def is_completely_outside(self, other: BoundingBox2d) -> bool:
return not self._bbox.has_intersection(other)


Expand All @@ -419,11 +419,11 @@ def __init__(self, vertices: Iterable[UVec], outer_bounds: BoundingBox2d) -> Non
polygon = Vec2.list(vertices)
super().__init__(outer_bounds, InvertedClippingPolygon2d(polygon, outer_bounds))

def is_completley_inside(self, other: BoundingBox2d) -> bool:
def is_completely_inside(self, other: BoundingBox2d) -> bool:
# returning False means: I don't know!
return False # not easy to detect

def is_completley_outside(self, other: BoundingBox2d) -> bool:
def is_completely_outside(self, other: BoundingBox2d) -> bool:
return not self._bbox.has_intersection(other)


Expand Down

0 comments on commit b9d46f0

Please sign in to comment.