fairyfly-core 0.2.9__tar.gz → 0.2.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/PKG-INFO +1 -1
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/model.py +21 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/shape.py +26 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly_core.egg-info/PKG-INFO +1 -1
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/CODE_OF_CONDUCT.md +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/CONTRIBUTING.md +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/LICENSE +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/MANIFEST.in +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/README.md +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/dev-requirements.txt +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/__init__.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/__main__.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/_base.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/_lockable.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/boundary.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/checkdup.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/cli/__init__.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/cli/setconfig.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/colorobj.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/config.json +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/config.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/dictutil.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/extensionutil.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/logutil.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/properties.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/search.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/typing.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/units.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/writer/__init__.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/writer/boundary.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/writer/model.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly/writer/shape.py +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly_core.egg-info/SOURCES.txt +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly_core.egg-info/dependency_links.txt +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly_core.egg-info/entry_points.txt +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly_core.egg-info/requires.txt +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/fairyfly_core.egg-info/top_level.txt +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/requirements.txt +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/setup.cfg +0 -0
- {fairyfly_core-0.2.9 → fairyfly_core-0.2.10}/setup.py +0 -0
|
@@ -606,6 +606,27 @@ class Model(_Base):
|
|
|
606
606
|
for i in reversed(i_to_remove):
|
|
607
607
|
self._shapes.pop(i)
|
|
608
608
|
|
|
609
|
+
def remove_duplicate_vertices(self, tolerance=None):
|
|
610
|
+
"""Remove any duplicate vertices from the model.
|
|
611
|
+
|
|
612
|
+
Any degenerate shapes found while removing duplicate vertices will be
|
|
613
|
+
automatically removed from the model.
|
|
614
|
+
|
|
615
|
+
Args:
|
|
616
|
+
tolerance: The minimum distance between a vertex and the boundary segments
|
|
617
|
+
at which point the vertex is considered distinct. If None, the
|
|
618
|
+
Model's tolerance will be used. (Default: None).
|
|
619
|
+
"""
|
|
620
|
+
tolerance = self.tolerance if tolerance is None else tolerance
|
|
621
|
+
i_to_remove = []
|
|
622
|
+
for i, shape in enumerate(self._shapes):
|
|
623
|
+
try:
|
|
624
|
+
shape.remove_duplicate_vertices(tolerance)
|
|
625
|
+
except ValueError: # degenerate shape found!
|
|
626
|
+
i_to_remove.append(i)
|
|
627
|
+
for i in reversed(i_to_remove):
|
|
628
|
+
self._shapes.pop(i)
|
|
629
|
+
|
|
609
630
|
def check_all(self, raise_exception=True, detailed=False, all_ext_checks=False):
|
|
610
631
|
"""Check all of the aspects of the Model for validation errors.
|
|
611
632
|
|
|
@@ -247,6 +247,21 @@ class Shape(_Base):
|
|
|
247
247
|
self._geometry = self.geometry.scale(factor, origin)
|
|
248
248
|
self.properties.scale(factor, origin)
|
|
249
249
|
|
|
250
|
+
def remove_duplicate_vertices(self, tolerance=0.01):
|
|
251
|
+
"""Remove all duplicate vertices from this object's geometry.
|
|
252
|
+
|
|
253
|
+
Args:
|
|
254
|
+
tolerance: The minimum distance between a vertex and the boundary segments
|
|
255
|
+
at which point the vertex is considered duplicate. Default: 0.01,
|
|
256
|
+
suitable for objects in millimeters.
|
|
257
|
+
"""
|
|
258
|
+
try:
|
|
259
|
+
self._geometry = self.geometry.remove_duplicate_vertices(tolerance)
|
|
260
|
+
except AssertionError as e: # usually a sliver face of some kind
|
|
261
|
+
raise ValueError(
|
|
262
|
+
'Shape "{}" is invalid with dimensions less than the '
|
|
263
|
+
'tolerance.\n{}'.format(self.full_id, e))
|
|
264
|
+
|
|
250
265
|
def remove_colinear_vertices(self, tolerance=0.01):
|
|
251
266
|
"""Remove all colinear and duplicate vertices from this object's geometry.
|
|
252
267
|
|
|
@@ -472,6 +487,17 @@ class Shape(_Base):
|
|
|
472
487
|
# snap all polygons together
|
|
473
488
|
polygon_2ds = Polygon2D.snap_polygons(polygon_2ds, tol)
|
|
474
489
|
|
|
490
|
+
# remove colinear and degenerate geometry
|
|
491
|
+
i_to_remove = []
|
|
492
|
+
for i, poly in enumerate(polygon_2ds):
|
|
493
|
+
try:
|
|
494
|
+
poly.remove_colinear_vertices(tol)
|
|
495
|
+
except ValueError: # degenerate shape found!
|
|
496
|
+
i_to_remove.append(i)
|
|
497
|
+
for i in reversed(i_to_remove):
|
|
498
|
+
polygon_2ds.pop(i)
|
|
499
|
+
is_holes.pop(i)
|
|
500
|
+
|
|
475
501
|
# intersect the Room2D polygons within the 2D space
|
|
476
502
|
int_poly = Polygon2D.intersect_polygon_segments(polygon_2ds, tol)
|
|
477
503
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|