예제 #1
0
 def test_nonuniform(self):
     result = dfm_check('step_files/nonuniform.STEP')
     issue = {'issue': 'non-uniform', 'faces': None}
     self.assertGreater(len(result['issues']), 0)
     self.assertTrue(any(i == issue for i in result['issues']))
     result = dfm_check('step_files/milled_pocket.STEP')
     self.assertEqual({'issues': [issue]}, result)
예제 #2
0
 def test_radius(self):
     result = dfm_check('step_files/radius.STEP')
     issue = {'issue': 'radius', 'faces': None}
     self.assertGreater(len(result['issues']), 0)
     self.assertEqual({'issues': [issue]}, result)
     result = dfm_check('step_files/radius_both_edges.STEP')
     self.assertGreater(len(result['issues']), 0)
     for i in result['issues']:
         self.assertEqual(issue, i)
예제 #3
0
 def test_small_cut(self):
     result = dfm_check('step_files/small_hole.STEP')
     # example: issue = {'issue': 'small-hole', 'faces': [1]}
     self.assertGreater(len(result['issues']), 0)
     small_cut_issues = [
         i for i in result['issues'] if i['issue'] == 'small-cut'
     ]
     self.assertGreater(len(small_cut_issues), 0)
     self.assertTrue(len(small_cut_issues[0]['faces']) >= 1)
예제 #4
0
 def test_small_outside_radii(self):
     result = dfm_check('step_files/small_outside_radii.step')
     self.assertEqual(result, {'issues': []})
예제 #5
0
 def test_counterbore(self):
     result = dfm_check('step_files/counter_bore.STEP')
     # example: issue = {'issue': 'counter-bore', 'faces': [1]}
     self.assertGreater(len(result['issues']), 0)
     self.assertEqual('counter-bore', result['issues'][0]['issue'])
     self.assertTrue(len(result['issues'][0]['faces']) >= 1)
예제 #6
0
 def test_countersink(self):
     result = dfm_check('step_files/counter_sinks.STEP')
     # example: issue = {'issue': 'counter-sink', 'faces': [1, 2]}
     self.assertGreater(len(result['issues']), 0)
     self.assertEqual('counter-sink', result['issues'][0]['issue'])
     self.assertTrue(len(result['issues'][0]['faces']) >= 2)
예제 #7
0
 def test_draft(self):
     result = dfm_check('step_files/draft.STEP')
     issue = {'issue': 'draft', 'faces': None}
     self.assertGreater(len(result['issues']), 0)
     self.assertEqual({'issues': [issue]}, result)
예제 #8
0
 def test_large_radius_internal_corner(self):
     result = dfm_check('step_files/large_radius_internal_corner.step')
     self.assertEqual(result, {'issues': []})
예제 #9
0
 def test_thin_cut_between_radii(self):
     result = dfm_check('step_files/thin_cut_between_radii.step')
     summary = summarize(result)
     self.assertIn('small-cut', summary)
예제 #10
0
 def test_unmanufacturable_extrusion(self):
     result = dfm_check('step_files/unmanufacturable_extrusion.step')
     summary = summarize(result)
     self.assertIn('non-uniform', summary)
예제 #11
0
 def test_manufacturable_splines(self):
     result = dfm_check('step_files/manufacturable_splines.step')
     self.assertEqual(result, {'issues': []})
예제 #12
0
 def test_manufacturable_extrusion(self):
     result = dfm_check('step_files/manufacturable_extrusion.step')
     self.assertEqual(result, {'issues': []})
예제 #13
0
 def test_counter_confusion(self):
     result = dfm_check('step_files/counter_confusion.step')
     summary = summarize(result)
     self.assertNotIn('counter-bore', summary)
     self.assertNotIn('counter-sink', summary)
     self.assertIn('non-uniform', summary)
예제 #14
0
 def test_shallow_internal_radius(self):
     result = dfm_check('step_files/shallow_internal_radius.step')
     summary = summarize(result)
     self.assertIn('tight-corner-mild', summary)
     self.assertNotIn('small-cut', summary)
예제 #15
0
 def test_thin_cut_large_ends(self):
     result = dfm_check('step_files/thin_cut_large_ends.step')
     summary = summarize(result)
     self.assertIn('small-cut', summary)
예제 #16
0
 def test_thin_cut_from_outside(self):
     result = dfm_check('step_files/thin_cut_from_outside.step')
     summary = summarize(result)
     self.assertIn('small-cut', summary)
예제 #17
0
 def test_small_hole(self):
     result = dfm_check('step_files/small_hole_2.STEP')
     self.assertGreater(len(result['issues']), 0)
     self.assertEqual('small-hole', result['issues'][0]['issue'])
     self.assertTrue(len(result['issues'][0]['faces']) >= 1)
예제 #18
0
 def test_sharp_internal_corner(self):
     result = dfm_check('step_files/sharp_internal_corner.step')
     summary = summarize(result)
     self.assertIn('tight-corner', summary)
     self.assertNotIn('small-cut', summary)
예제 #19
0
 def test_good_part(self):
     result = dfm_check('step_files/good_part.STEP')
     self.assertEqual({'issues': []}, result)