8 import fields2cover
as f2c
11 assert pytest.approx(a) == pytest.approx(b)
14 assert (f2c.Route().asLineString().isEmpty());
16 route.addConnection(f2c.MultiPoint(
17 f2c.VectorPoint([f2c.Point(0, 0)])));
18 swaths1 = f2c.Swaths();
19 swaths1.push_back(f2c.Swath(f2c.LineString(f2c.VectorPoint(
20 [f2c.Point(0, 0), f2c.Point(1, 0)])), 4));
21 route.addSwaths(swaths1);
22 route.addConnection(f2c.MultiPoint(f2c.VectorPoint(
23 [f2c.Point(1, 0), f2c.Point(1, 1)])));
24 swaths2 = f2c.Swaths();
25 swaths2.push_back(f2c.Swath(f2c.LineString(f2c.VectorPoint(
26 [f2c.Point(1, 1), f2c.Point(0, 1)])), 4));
27 route.addSwaths(swaths2);
28 route.addConnection(f2c.MultiPoint());
29 assert not (route.asLineString().isEmpty());
30 near(route.asLineString().length(), 3);