def test_buddha(self): obj = import_model("happy_vrip_res4.ply") select_object(obj) prev_bounds = get_bounds(obj) correction(True, False) self.assertEqual(prev_bounds, get_bounds(obj)) bpy.ops.object.mode_set(mode='EDIT') bpy.context.tool_settings.mesh_select_mode = [False, True, False] bpy.ops.mesh.select_all(action='DESELECT') bpy.ops.mesh.select_non_manifold() self.assertEqual(get_selected_points(), [])
def test_egg(self): chosen_faces = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63} obj = import_model("egg_with_support.stl") select_object(obj) sp = SupportPlanes(obj) self.assertEqual(len(sp), 10) self.assertEqual(sp[0].faces, chosen_faces) sp[0].select() self.assertEqual(set( [face.index for face in obj.data.polygons if face.select]), chosen_faces) sp[0].apply() xmin, xmax, ymin, ymax, zmin, zmax = get_bounds(obj) self.assertTrue(round(xmin - -10.986856460571289, 4) == 0) self.assertTrue(round(xmax - 10.986856460571289, 4) == 0) self.assertTrue(round(ymin - -10.986852645874023, 4) == 0) self.assertTrue(round(ymax - 10.986856460571289, 4) == 0) self.assertTrue(round(zmin - -5.7220458984375e-06, 4) == 0) self.assertTrue(round(zmax - 32.62044143676758, 4) == 0)