BuildFace|Hull -> MakeFace|Hull Issue #39

This commit is contained in:
Roger Maitland 2022-10-30 14:07:34 -04:00
parent a0a4778e3d
commit 4b85aaccd3
10 changed files with 19 additions and 19 deletions

View file

@ -43,7 +43,7 @@ with BuildSketch() as leaf:
l7 = Line((0.0692, 0.7808), (0.0000, 0.9167))
TangentArc(l6 @ 1, l7 @ 0, tangent=l6 % 1)
Mirror(*outline.edges(), about=Plane.YZ)
BuildFace(*leaf.pending_edges)
MakeFace(*leaf.pending_edges)
with BuildSketch() as west_field:
with Locations((-1, 0)):

View file

@ -33,7 +33,7 @@ with BuildSketch() as minute_indicator:
l2 = CenterArc((0, 0), clock_radius * 0.925, 0.75, 4.5)
Line(l1 @ 0, l2 @ 0)
Line(l1 @ 1, l2 @ 1)
BuildFace()
MakeFace()
Fillet(*minute_indicator.vertices(), radius=clock_radius * 0.01)
with BuildSketch() as clock_face:

View file

@ -46,7 +46,7 @@ with BuildPart() as vase:
(0, (l5 @ 1).Y + 1),
l1 @ 0,
)
BuildFace()
MakeFace()
Revolve(axis=Axis.Y)
Offset(openings=vase.faces().filter_by(Axis.Y)[-1], amount=-1)
top_edges = (

View file

@ -75,8 +75,8 @@ __all__ = [
"Torus",
"Wedge",
"BuildSketch",
"BuildFace",
"BuildHull",
"MakeFace",
"MakeHull",
"Offset",
"Circle",
"Ellipse",

View file

@ -188,10 +188,10 @@ class BuildSketch(Builder):
#
class BuildFace(Face):
"""Sketch Operation: Build Face
class MakeFace(Face):
"""Sketch Operation: Make Face
Build a face from the given perimeter edges
Create a face from the given perimeter edges
Args:
edges (Edge): sequence of perimeter edges
@ -212,10 +212,10 @@ class BuildFace(Face):
super().__init__(pending_face.wrapped)
class BuildHull(Face):
"""Sketch Operation: Build Hull
class MakeHull(Face):
"""Sketch Operation: Make Hull
Build a face from the hull of the given edges
Create a face from the hull of the given edges
Args:
edges (Edge): sequence of edges to hull

View file

@ -277,7 +277,7 @@ class TestBuilder(unittest.TestCase):
with BuildSketch() as inner:
with BuildLine():
CenterArc((0, 0), 1, 0, 360)
BuildFace()
MakeFace()
self.assertEqual(len(outer.pending_faces), 2)

View file

@ -127,7 +127,7 @@ class TestOffset(unittest.TestCase):
l = Line((0, 0), (1, 0))
Line(l @ 1, (1, 1))
Offset(amount=1)
BuildFace()
MakeFace()
self.assertAlmostEqual(test.sketch.area(), pi * 1.25 + 3, 5)
def test_line_offset(self):
@ -136,7 +136,7 @@ class TestOffset(unittest.TestCase):
l = Line((0, 0), (1, 0))
Line(l @ 1, (1, 1))
Offset(*line.line.edges(), amount=1)
BuildFace()
MakeFace()
self.assertAlmostEqual(test.sketch.area(), pi * 1.25 + 3, 5)
def test_face_offset(self):

View file

@ -76,7 +76,7 @@ class BuildLineTests(unittest.TestCase):
l7 = Line((0.0692, 0.7808), (0.0000, 0.9167))
TangentArc(l6 @ 1, l7 @ 0, tangent=l6 % 1)
Mirror(*outline.edges(), about=Plane.YZ)
BuildFace(*leaf.pending_edges)
MakeFace(*leaf.pending_edges)
self.assertAlmostEqual(leaf.sketch.area(), 0.2741600685288115, 5)
def test_three_d(self):

View file

@ -297,7 +297,7 @@ class TestRevolve(unittest.TestCase):
(0, (l5 @ 1).Y + 1),
l1 @ 0,
)
BuildFace()
MakeFace()
Revolve(axis=Axis.Y)
self.assertLess(test.part.volume(), 22**2 * pi * 50, 5)
self.assertGreater(test.part.volume(), 144 * pi * 50, 5)
@ -310,7 +310,7 @@ class TestRevolve(unittest.TestCase):
l2 = RadiusArc(l1 @ 1, (20, 10), 50)
l3 = Line(l2 @ 1, (20, 0))
l4 = Line(l3 @ 1, l1 @ 0)
BuildFace()
MakeFace()
Revolve(axis=Axis.X)
self.assertLess(test.part.volume(), 244 * pi * 20, 5)
self.assertGreater(test.part.volume(), 100 * pi * 20, 5)

View file

@ -252,14 +252,14 @@ class BuildSketchObjects(unittest.TestCase):
CenterArc((0, 0), 1, 0, 360)
CenterArc((1, 1.5), 0.5, 0, 360)
Line((0.0, 2), (-1, 3.0))
BuildHull()
MakeHull()
self.assertAlmostEqual(test.sketch.area(), 7.258175622249558, 5)
with BuildSketch() as test:
with Locations((-10, 0)):
Circle(10)
with Locations((10, 0)):
Circle(7)
BuildHull(*test.edges())
MakeHull(*test.edges())
self.assertAlmostEqual(test.sketch.area(), 577.8808734698988, 5)