Renamed create_face_neighbors_index() to its_face_edge_ids().

Renamed its_create_neighbors_index() / its_create_neighbors_index_par() to its_face_neighbors() / its_face_neighbors_par().
New variant of its_face_edge_ids() to create edge IDs from face neighbors.
Fixed some incorrect use of _NDEBUG, it should be NDEBUG.
PrintObject::slice_support_volumes() returns newly Polygons, which are cheaper than ExPolygons.
Updated SeamPlacer and SupportMaterial to use regions defined as Polygons, not ExPolygons.
TriangleSelector::get_facets_strict() returning a patch with T-joints retriangulated.
New slice_mesh_slabs() - slicing projections of a triangle patch into top / bottom layers of slices, for MMU top / bottom segmentation.
TriangleMeshSlicer - use 64 mutexes instead of one when scattering sliced triangles into layers. This makes a big difference on modern many core desktop computers.
When applying MM segmented regions to input regions, the split regions are now re-merged with 10x higher positive offset epsilon to avoid creating gaps.
When testing for existence of paint-on supports or seam, use a more efficient has_facets() test, which does not deserialize into the expensive TriangleSelector tree structure.
GLIndexedVertexArray newly uses Eigen::AlignedBox<float, 3> for efficiency instead of our double based BoundingBoxf3.
Improved MMU painting refresh speed by optimizing generation of the vertex buffers.
Refactored MMU segmentation - projection of painted surfaces from top / bottom.
	1) Parallelized.
	2) Using the new slice_mesh_slabs() instead of projecting one triangle by the other and merging them with Clipper.
This commit is contained in:
Vojtech Bubnik 2021-06-20 15:21:12 +02:00
parent d08a70478e
commit 0d70a2be69
23 changed files with 1357 additions and 489 deletions

View file

@ -201,21 +201,24 @@ void SeamPlacer::init(const Print& print)
std::vector<ExPolygons> temp_enf;
std::vector<ExPolygons> temp_blk;
std::vector<Polygons> temp_polygons;
for (const PrintObject* po : print.objects()) {
temp_enf.clear();
temp_blk.clear();
po->project_and_append_custom_facets(true, EnforcerBlockerType::ENFORCER, temp_enf);
po->project_and_append_custom_facets(true, EnforcerBlockerType::BLOCKER, temp_blk);
// Offset the triangles out slightly.
for (auto* custom_per_object : {&temp_enf, &temp_blk}) {
auto merge_and_offset = [po, &temp_polygons, max_nozzle_dmr](EnforcerBlockerType type, std::vector<ExPolygons>& out) {
// Offset the triangles out slightly.
temp_polygons.clear();
po->project_and_append_custom_facets(true, type, temp_polygons);
out.clear();
out.reserve(temp_polygons.size());
float offset = max_nozzle_dmr + po->config().elefant_foot_compensation;
for (ExPolygons& explgs : *custom_per_object) {
explgs = Slic3r::offset_ex(explgs, scale_(offset));
for (const Polygons &src : temp_polygons) {
out.emplace_back(Slic3r::offset_ex(src, scale_(offset)));
offset = max_nozzle_dmr;
}
}
};
merge_and_offset(EnforcerBlockerType::BLOCKER, temp_blk);
merge_and_offset(EnforcerBlockerType::ENFORCER, temp_enf);
// FIXME: Offsetting should be done somehow cheaper, but following does not work
// for (auto* custom_per_object : {&temp_enf, &temp_blk}) {