def ReadModel(self, f, options): (m, msg) = import_vecfile.ReadVecFileToModel(f, options) self.assertIsNotNone(m) self.assertEqual(msg, "") if SHOW: showfaces.ShowFaces(m.faces, m.points, f) return m
def testBevel4pt(self): opt = import_vecfile.ImportOptions() opt.bevel_amount = .5 opt.convert_options.filled_only = False opt.convert_options.smoothness = 0 (m, msg) = import_vecfile.ReadVecFileToModel("testfiles/4pt.ai", opt) self.assertEqual(msg, "") self.assertEqual(len(m.faces), 5) if SHOW: showfaces.ShowFaces(m.faces, m.points, "Bevel 4pt")
def testTri(self): pa = geom.PolyArea( geom.Points([(0.0, 0.0, 0.0), (1.0, 0.0, 0.0), (0.5, 0.25, 0.0)]), [0, 1, 2]) o = offset.Offset(pa, 0.0, 0.0) o.Build() m = geom.Model() m.points = pa.points model.AddOffsetFacesToModel(m, o) if SHOW: showfaces.ShowFaces(m.faces, m.points, "Tri")
def testBevel3dout(self): opt = import_vecfile.ImportOptions() opt.bevel_amount = 0.05 opt.convert_options.filled_only = False opt.convert_options.smoothness = 0 opt.convert_options.combine_paths = True (m, msg) = import_vecfile.ReadVecFileToModel("testfiles/3dout.ai", opt) self.assertEqual(msg, "") self.assertEqual(len(m.faces), 44) if SHOW: showfaces.ShowFaces(m.faces, m.points, "Bevel 3dout")
def testIrreg(self): pa = geom.PolyArea( geom.Points([(0.0, 0.1, 0.0), (-0.1, -0.2, 0.0), (0.1, -0.25, 0.0), (0.3, 0.05, 0.0), (1.0, 0.0, 0.0), (1.1, 1.0, 0.0), (-0.1, 1.2, 0.0)]), list(range(0, 7))) o = offset.Offset(pa, 0.0, 0.0) o.Build() m = geom.Model() m.points = pa.points model.AddOffsetFacesToModel(m, o) if SHOW: showfaces.ShowFaces(m.faces, m.points, "Irreg")
def testHoles(self): ans = triquad.QuadrangulateFaceWithHoles(F2outer, [F2hole1, F2hole2], Vs2) if Show: showfaces.ShowFaces(ans, Vs2, "F2 - quad")
def testM(self): ans = triquad.QuadrangulateFace(Fsm, Vsm) if Show: showfaces.ShowFaces(ans, Vsm, "Fsm - quad") self.assertEqual(len(ans), 14)
def testCircle(self): ans = triquad.QuadrangulateFace(F3circle, Vs3) if Show: showfaces.ShowFaces(ans, Vs3, "F3circle - quad") self.assertEqual(len(ans), 9)
def testSquare(self): ans = triquad.QuadrangulateFace(F1square, Vs1) if Show: showfaces.ShowFaces(ans, Vs1, "F1square - quad") self.assertEqual(len(ans), 1)
def testTriangle(self): ans = triquad.QuadrangulateFace(F1tri, Vs1) if Show: showfaces.ShowFaces(ans, Vs1, "F1tri - quad") self.assertEqual(ans, [tuple(F1tri)])
def testM(self): ans = triquad.TriangulateFace(Fsm, Vsm) if Show: showfaces.ShowFaces(ans, Vsm, "Fsm - tri") self.assertEqual(len(ans), 26)