mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 16:27:54 -06:00
NEW: [STUDIO-3178] Add three common benchmark models
Change-Id: Ie9c73260692baab865ca99fabcce8f090e54de21
This commit is contained in:
parent
77c0c42f9e
commit
5e4f4f82da
5 changed files with 21 additions and 7 deletions
BIN
resources/model/3DBenchy.stl
Normal file
BIN
resources/model/3DBenchy.stl
Normal file
Binary file not shown.
BIN
resources/model/Bambu_Cube.stl
Normal file
BIN
resources/model/Bambu_Cube.stl
Normal file
Binary file not shown.
BIN
resources/model/ksr_FDMTest.stl
Normal file
BIN
resources/model/ksr_FDMTest.stl
Normal file
Binary file not shown.
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue