mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-15 15:20:37 -08:00
Added Edge.is_interior property Issue #816
This commit is contained in:
parent
0625c77e4e
commit
4aee76f6c0
4 changed files with 179 additions and 4 deletions
|
|
@ -29,9 +29,11 @@ license:
|
|||
import math
|
||||
import unittest
|
||||
|
||||
from build123d.build_enums import AngularDirection
|
||||
from build123d.build_enums import AngularDirection, GeomType, Transition
|
||||
from build123d.geometry import Axis, Plane, Vector
|
||||
from build123d.objects_curve import CenterArc, EllipticalCenterArc
|
||||
from build123d.objects_sketch import Circle, Rectangle, RegularPolygon
|
||||
from build123d.operations_generic import sweep
|
||||
from build123d.topology import Edge
|
||||
|
||||
|
||||
|
|
@ -284,6 +286,14 @@ class TestEdge(unittest.TestCase):
|
|||
with self.assertRaises(TypeError):
|
||||
Edge(direction=(1, 0, 0))
|
||||
|
||||
def test_is_interior(self):
|
||||
path = RegularPolygon(5, 5).face().outer_wire()
|
||||
profile = path.location_at(0) * (Circle(0.6) & Rectangle(2, 1))
|
||||
target = sweep(profile, path, transition=Transition.RIGHT)
|
||||
inside_edges = target.edges().filter_by(lambda e: e.is_interior)
|
||||
self.assertEqual(len(inside_edges), 5)
|
||||
self.assertTrue(all(e.geom_type == GeomType.ELLIPSE for e in inside_edges))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue