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

Function test_hull

tests/test_hull.py:7–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7def test_hull():
8
9 c1 = cq.Edge.makeCircle(0.5, (-1.5, 0.5, 0))
10 c2 = cq.Edge.makeCircle(0.5, (1.9, 0.0, 0))
11 c3 = cq.Edge.makeCircle(0.2, (0.3, 1.5, 0))
12 c4 = cq.Edge.makeCircle(0.2, (1.0, 1.5, 0))
13 c5 = cq.Edge.makeCircle(0.1, (0.0, 0.0, 0.0))
14 e1 = cq.Edge.makeLine(cq.Vector(0, -0.5), cq.Vector(-0.5, 1.5))
15 e2 = cq.Edge.makeLine(cq.Vector(2.1, 1.5), cq.Vector(2.6, 1.5))
16
17 edges = [c1, c2, c3, c4, c5, e1, e2]
18
19 h = hull.find_hull(edges)
20
21 assert len(h.Vertices()) == 11
22 assert h.IsClosed()
23 assert h.isValid()
24
25
26def test_validation():

Callers

nothing calls this directly

Calls 5

makeLineMethod · 0.80
IsClosedMethod · 0.80
isValidMethod · 0.80
makeCircleMethod · 0.45
VerticesMethod · 0.45

Tested by

no test coverage detected