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

Method test2Dchamfer

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

Source from the content-addressed store, hash-verified

5104 self.assertGreater(unfilleted_wire0.Length() - filleted_wire0.Length(), 0.1)
5105
5106 def test2Dchamfer(self):
5107
5108 r = Workplane().rect(1, 2).wires().val()
5109 f = Face.makeFromWires(r)
5110 verts = r.Vertices()
5111
5112 self.assertEqual(len(f.chamfer2D(0.5, verts).Vertices()), 6)
5113 self.assertEqual(len(r.chamfer2D(0.5, verts).Vertices()), 6)
5114 self.assertEqual(len(r.chamfer2D(0.25, verts).Vertices()), 8)
5115
5116 r = Workplane().hLine(1).vLine(1).wire().val()
5117 vs = r.Vertices()
5118
5119 self.assertEqual(len(r.chamfer2D(0.25, [vs[1]]).Vertices()), 4)
5120
5121 with raises(ValueError):
5122 r.chamfer2D(0.25, [vs[0]])
5123
5124 def test_Face_makeFromWires(self):
5125

Callers

nothing calls this directly

Calls 10

WorkplaneClass · 0.85
vLineMethod · 0.80
hLineMethod · 0.80
valMethod · 0.45
wiresMethod · 0.45
rectMethod · 0.45
makeFromWiresMethod · 0.45
VerticesMethod · 0.45
chamfer2DMethod · 0.45
wireMethod · 0.45

Tested by

no test coverage detected