NEW: [STUDIO-3178] Add three common benchmark models

Change-Id: Ie9c73260692baab865ca99fabcce8f090e54de21
This commit is contained in:
maosheng.wei 2023-06-14 17:24:48 +08:00 committed by Lane.Wei
parent 77c0c42f9e
commit 5e4f4f82da
5 changed files with 21 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -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); [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; return sub_menu;
} }

View file

@ -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); 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") if (type_name == "Cube")
// Sitting on the print bed, left front front corner at (0, 0). // 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") else if (type_name == "Cylinder")
// Centered around 0, sitting on the print bed. // Centered around 0, sitting on the print bed.
// The cylinder has the same volume as the box above. // 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") else if (type_name == "Sphere")
// Centered around 0, half the sphere below the print bed, half above. // Centered around 0, half the sphere below the print bed, half above.
// The sphere has the same volume as the box 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") else if (type_name == "Slab")
// Sitting on the print bed, left front front corner at (0, 0). // 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") else if (type_name == "Cone")
mesh = its_make_cone(0.5 * side, side); mesh = TriangleMesh(its_make_cone(0.5 * side, side));
return TriangleMesh(mesh); 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) void ObjectList::load_generic_subobject(const std::string& type_name, const ModelVolumeType type)