mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 11:23:42 +00:00
Refine code
This commit is contained in:
@@ -566,17 +566,17 @@ const ModelObjectPtrs& Cut::perform_with_groove(const Groove& groove, const Tran
|
|||||||
};
|
};
|
||||||
|
|
||||||
// cut by upper plane
|
// cut by upper plane
|
||||||
|
|
||||||
const Transform3d cut_matrix_upper = translation_transform(rotation_m * (groove_half_depth * Vec3d::UnitZ())) * m_cut_matrix;
|
|
||||||
{
|
{
|
||||||
|
const Transform3d cut_matrix_upper = translation_transform(rotation_m * (groove_half_depth * Vec3d::UnitZ())) * m_cut_matrix;
|
||||||
|
|
||||||
cut(tmp_object, cut_matrix_upper, ModelObjectCutAttribute::KeepLower, tmp_model_for_cut);
|
cut(tmp_object, cut_matrix_upper, ModelObjectCutAttribute::KeepLower, tmp_model_for_cut);
|
||||||
add_volumes_from_cut(upper, ModelObjectCutAttribute::KeepUpper, tmp_model_for_cut);
|
add_volumes_from_cut(upper, ModelObjectCutAttribute::KeepUpper, tmp_model_for_cut);
|
||||||
}
|
}
|
||||||
|
|
||||||
// cut by lower plane
|
// cut by lower plane
|
||||||
|
|
||||||
const Transform3d cut_matrix_lower = translation_transform(rotation_m * (-groove_half_depth * Vec3d::UnitZ())) * m_cut_matrix;
|
|
||||||
{
|
{
|
||||||
|
const Transform3d cut_matrix_lower = translation_transform(rotation_m * (-groove_half_depth * Vec3d::UnitZ())) * m_cut_matrix;
|
||||||
|
|
||||||
cut(tmp_object, cut_matrix_lower, ModelObjectCutAttribute::KeepUpper, tmp_model_for_cut);
|
cut(tmp_object, cut_matrix_lower, ModelObjectCutAttribute::KeepUpper, tmp_model_for_cut);
|
||||||
add_volumes_from_cut(lower, ModelObjectCutAttribute::KeepLower, tmp_model_for_cut);
|
add_volumes_from_cut(lower, ModelObjectCutAttribute::KeepLower, tmp_model_for_cut);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2348,7 +2348,7 @@ void cut_mesh(const indexed_triangle_set& mesh, float z, indexed_triangle_set* u
|
|||||||
IntersectionLines upper_lines, lower_lines;
|
IntersectionLines upper_lines, lower_lines;
|
||||||
std::vector<int> upper_slice_vertices, lower_slice_vertices;
|
std::vector<int> upper_slice_vertices, lower_slice_vertices;
|
||||||
std::vector<Vec3i32> facets_edge_ids = its_face_edge_ids(mesh);
|
std::vector<Vec3i32> facets_edge_ids = its_face_edge_ids(mesh);
|
||||||
std::map<int, Vec3f> section_vertices_map;
|
std::map<int, Vec3f> section_vertices_map; // vertices on the cut plane
|
||||||
|
|
||||||
for (int facet_idx = 0; facet_idx < int(mesh.indices.size()); ++ facet_idx) {
|
for (int facet_idx = 0; facet_idx < int(mesh.indices.size()); ++ facet_idx) {
|
||||||
const stl_triangle_vertex_indices &facet = mesh.indices[facet_idx];
|
const stl_triangle_vertex_indices &facet = mesh.indices[facet_idx];
|
||||||
|
|||||||
Reference in New Issue
Block a user