NEW: add rounded rectangle model

Rounded rectangle can be used to create some frequently contacted models.
Also add icons for some objects.

jira: none
Change-Id: I59dec8d6d892f8fb975b0723ea2cd85ccfc65d28
(cherry picked from commit 83830b844d3720f99651174daa3b1ac81e64e5d7)
This commit is contained in:
Arthur 2024-03-06 11:01:27 +08:00 committed by Lane.Wei
parent 2243747e75
commit 377756464e
10 changed files with 6 additions and 2 deletions

BIN
resources/model/Cone.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
resources/model/Cube.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
resources/model/Disc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
resources/model/Sphere.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
resources/model/Torus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

View File

@ -484,10 +484,12 @@ wxMenu* MenuFactory::append_submenu_add_generic(wxMenu* menu, ModelVolumeType ty
sub_menu->AppendSeparator();
}
for (auto &item : {L("Cube"), L("Cylinder"), L("Sphere"), L("Cone"), L("Disc"),L("Torus")})
std::vector<std::string> icons = { "cube", "Cylinder", "Sphere", "Cone", "Disc", "Torus", "rounded_rectangle" };
size_t i = 0;
for (auto &item : {L("Cube"), L("Cylinder"), L("Sphere"), L("Cone"), L("Disc"),L("Torus"),L("Rounded Rectangle") })
{
append_menu_item(sub_menu, wxID_ANY, _(item), "",
[type, item](wxCommandEvent&) { obj_list()->load_generic_subobject(item, type); }, "", menu);
[type, item](wxCommandEvent&) { obj_list()->load_generic_subobject(item, type); }, Slic3r::resources_dir() + "/model/" + icons[i++] + ".png", menu);
}
if (type == ModelVolumeType::INVALID) {

View File

@ -2104,6 +2104,8 @@ static TriangleMesh create_mesh(const std::string& type_name, const BoundingBoxf
mesh.ReadSTLFile((Slic3r::resources_dir() + "/model/Disc.stl").c_str(), true, nullptr);
else if (type_name == "Torus")
mesh.ReadSTLFile((Slic3r::resources_dir() + "/model/torus.stl").c_str(), true, nullptr);
else if (type_name == "Rounded Rectangle")
mesh.ReadSTLFile((Slic3r::resources_dir() + "/model/rounded_rectangle.stl").c_str(), true, nullptr);
else if (type_name == "Bambu Cube")
mesh.ReadSTLFile((Slic3r::resources_dir() + "/model/Bambu_Cube.stl").c_str(), true, nullptr);
else if (type_name == "Bambu Cube V2")