diff --git a/resources/model/3DBenchy.stl b/resources/model/3DBenchy.stl new file mode 100644 index 0000000000..17977bfff7 Binary files /dev/null and b/resources/model/3DBenchy.stl differ diff --git a/resources/model/Bambu_Cube.stl b/resources/model/Bambu_Cube.stl new file mode 100644 index 0000000000..521fbb6ee3 Binary files /dev/null and b/resources/model/Bambu_Cube.stl differ diff --git a/resources/model/ksr_FDMTest.stl b/resources/model/ksr_FDMTest.stl new file mode 100644 index 0000000000..b93919ca37 Binary files /dev/null and b/resources/model/ksr_FDMTest.stl differ diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 95b8bb7451..f61f639276 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -490,6 +490,14 @@ wxMenu* MenuFactory::append_submenu_add_generic(wxMenu* menu, ModelVolumeType ty [type, item](wxCommandEvent&) { obj_list()->load_generic_subobject(item, type); }, "", menu); } + if (type == ModelVolumeType::INVALID) { + sub_menu->AppendSeparator(); + for (auto &item : {L("Bambu Cube"), L("3DBenchy"), L("ksr FDMTest")}) { + append_menu_item( + sub_menu, wxID_ANY, _(item), "", [type, item](wxCommandEvent &) { obj_list()->load_generic_subobject(item, type); }, "", menu); + } + } + return sub_menu; } diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 1749fd8fb7..eaacb556df 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -2031,24 +2031,30 @@ static TriangleMesh create_mesh(const std::string& type_name, const BoundingBoxf { const double side = wxGetApp().plater()->canvas3D()->get_size_proportional_to_max_bed_size(0.1); - indexed_triangle_set mesh; + TriangleMesh mesh; if (type_name == "Cube") // Sitting on the print bed, left front front corner at (0, 0). - mesh = its_make_cube(side, side, side); + mesh = TriangleMesh(its_make_cube(side, side, side)); else if (type_name == "Cylinder") // Centered around 0, sitting on the print bed. // The cylinder has the same volume as the box above. - mesh = its_make_cylinder(0.5 * side, side); + mesh = TriangleMesh(its_make_cylinder(0.5 * side, side)); else if (type_name == "Sphere") // Centered around 0, half the sphere below the print bed, half above. // The sphere has the same volume as the box above. - mesh = its_make_sphere(0.5 * side, PI / 18); + mesh = TriangleMesh(its_make_sphere(0.5 * side, PI / 18)); else if (type_name == "Slab") // Sitting on the print bed, left front front corner at (0, 0). - mesh = its_make_cube(bb.size().x() * 1.5, bb.size().y() * 1.5, bb.size().z() * 0.5); + mesh = TriangleMesh(its_make_cube(bb.size().x() * 1.5, bb.size().y() * 1.5, bb.size().z() * 0.5)); else if (type_name == "Cone") - mesh = its_make_cone(0.5 * side, side); - return TriangleMesh(mesh); + mesh = TriangleMesh(its_make_cone(0.5 * side, side)); + else if (type_name == "Bambu Cube") + mesh.ReadSTLFile((Slic3r::resources_dir() + "/model/Bambu_Cube.stl").c_str(), true, nullptr); + else if (type_name == "3DBenchy") + mesh.ReadSTLFile((Slic3r::resources_dir() + "/model/3DBenchy.stl").c_str(), true, nullptr); + else if (type_name == "ksr FDMTest") + mesh.ReadSTLFile((Slic3r::resources_dir() + "/model/ksr_FDMTest.stl").c_str(), true, nullptr); + return mesh; } void ObjectList::load_generic_subobject(const std::string& type_name, const ModelVolumeType type)