MCPcopy
hub / github.com/CadQuery/cadquery / test2Dfillet

Method test2Dfillet

tests/test_cadquery.py:5085–5104  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5083 self.assertEqual(len(result.Solids()), 4)
5084
5085 def test2Dfillet(self):
5086
5087 r = Workplane().rect(1, 2).wires().val()
5088 f = Face.makeFromWires(r)
5089 verts = r.Vertices()
5090
5091 self.assertEqual(len(f.fillet2D(0.5, verts).Vertices()), 6)
5092 self.assertEqual(len(r.fillet2D(0.5, verts).Vertices()), 6)
5093 self.assertEqual(len(r.fillet2D(0.25, verts).Vertices()), 8)
5094
5095 # Test fillet2D with open wire and single vertex
5096 w0 = Workplane().hLine(1).vLine(1).wire()
5097 w0_verts = w0.vertices(">X and <Y").vals()
5098 unfilleted_wire0 = w0.val()
5099 filleted_wire0 = unfilleted_wire0.fillet2D(0.5, w0_verts)
5100
5101 self.assertEqual(len(filleted_wire0.Vertices()), 4)
5102
5103 # the filleted wire is shorter than the original
5104 self.assertGreater(unfilleted_wire0.Length() - filleted_wire0.Length(), 0.1)
5105
5106 def test2Dchamfer(self):
5107

Callers

nothing calls this directly

Calls 13

WorkplaneClass · 0.85
vLineMethod · 0.80
hLineMethod · 0.80
valMethod · 0.45
wiresMethod · 0.45
rectMethod · 0.45
makeFromWiresMethod · 0.45
VerticesMethod · 0.45
fillet2DMethod · 0.45
wireMethod · 0.45
valsMethod · 0.45
verticesMethod · 0.45

Tested by

no test coverage detected