def setUp(self): clipper.SCALING_FACTOR = 1 self.pc = clipper.Pyclipper() self.add_default_paths(self.pc) self.default_args = [ clipper.CT_INTERSECTION, clipper.PFT_EVENODD, clipper.PFT_EVENODD ]
def test_exact_results(self): """ Test whether coordinates passed into the library are returned exactly, if they are not affected by the operation. """ pc = clipper.Pyclipper() # Some large triangle. paths = [[[0, 1], [0, 0], [15**15, 0]]] pc.AddPaths(paths, clipper.PT_SUBJECT, True) result = pc.Execute(clipper.PT_CLIP, clipper.PFT_EVENODD, clipper.PFT_EVENODD) self.assertEqual(result, paths)
def setUp(self): clipper.SCALING_FACTOR = 2. self.pc = clipper.Pyclipper()
def test_execute_empty(self): pc = clipper.Pyclipper() with self.assertRaises(clipper.ClipperException): pc.Execute(clipper.CT_UNION, clipper.PFT_NONZERO, clipper.PFT_NONZERO)
def test_clipper_properties(self): pc = clipper.Pyclipper() for prop_name in ('ReverseSolution', 'PreserveCollinear', 'StrictlySimple'): self.check_property_assignment(pc, prop_name, [True, False])