mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 07:41:09 -06:00
Refactored the travel/retract/avoid_crossing_perimeters logic. Several edge cases are now handled correctly. #2498
This commit is contained in:
parent
7e82159620
commit
2562070232
6 changed files with 98 additions and 103 deletions
|
@ -129,7 +129,7 @@ Layer::any_internal_region_slice_contains(const T &item) const
|
|||
}
|
||||
return false;
|
||||
}
|
||||
template bool Layer::any_internal_region_slice_contains<Line>(const Line &item) const;
|
||||
template bool Layer::any_internal_region_slice_contains<Polyline>(const Polyline &item) const;
|
||||
|
||||
template <class T>
|
||||
bool
|
||||
|
@ -140,20 +140,7 @@ Layer::any_bottom_region_slice_contains(const T &item) const
|
|||
}
|
||||
return false;
|
||||
}
|
||||
template bool Layer::any_bottom_region_slice_contains<Line>(const Line &item) const;
|
||||
|
||||
template <class T>
|
||||
bool
|
||||
Layer::any_internal_region_fill_surface_contains(const T &item) const
|
||||
{
|
||||
FOREACH_LAYERREGION(this, layerm) {
|
||||
if ((*layerm)->fill_surfaces.any_internal_contains(item)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
template bool Layer::any_internal_region_fill_surface_contains<Line>(const Line &item) const;
|
||||
template bool Layer::any_internal_region_fill_surface_contains<Polyline>(const Polyline &item) const;
|
||||
|
||||
template bool Layer::any_bottom_region_slice_contains<Polyline>(const Polyline &item) const;
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
REGISTER_CLASS(Layer, "Layer");
|
||||
|
|
|
@ -95,8 +95,7 @@ class Layer {
|
|||
void make_slices();
|
||||
template <class T> bool any_internal_region_slice_contains(const T &item) const;
|
||||
template <class T> bool any_bottom_region_slice_contains(const T &item) const;
|
||||
template <class T> bool any_internal_region_fill_surface_contains(const T &item) const;
|
||||
|
||||
|
||||
protected:
|
||||
int _id; // sequential number of layer, 0-based
|
||||
PrintObject *_object;
|
||||
|
|
|
@ -77,7 +77,6 @@ SurfaceCollection::any_internal_contains(const T &item) const
|
|||
}
|
||||
return false;
|
||||
}
|
||||
template bool SurfaceCollection::any_internal_contains<Line>(const Line &item) const;
|
||||
template bool SurfaceCollection::any_internal_contains<Polyline>(const Polyline &item) const;
|
||||
|
||||
template <class T>
|
||||
|
@ -89,7 +88,7 @@ SurfaceCollection::any_bottom_contains(const T &item) const
|
|||
}
|
||||
return false;
|
||||
}
|
||||
template bool SurfaceCollection::any_bottom_contains<Line>(const Line &item) const;
|
||||
template bool SurfaceCollection::any_bottom_contains<Polyline>(const Polyline &item) const;
|
||||
|
||||
SurfacesPtr
|
||||
SurfaceCollection::filter_by_type(SurfaceType type)
|
||||
|
|
|
@ -69,14 +69,10 @@
|
|||
%code%{ RETVAL = (int)(intptr_t)THIS; %};
|
||||
|
||||
void make_slices();
|
||||
bool any_internal_region_slice_contains_line(Line* line)
|
||||
%code%{ RETVAL = THIS->any_internal_region_slice_contains(*line); %};
|
||||
bool any_bottom_region_slice_contains_line(Line* line)
|
||||
%code%{ RETVAL = THIS->any_bottom_region_slice_contains(*line); %};
|
||||
bool any_internal_region_fill_surface_contains_line(Line* line)
|
||||
%code%{ RETVAL = THIS->any_internal_region_fill_surface_contains(*line); %};
|
||||
bool any_internal_region_fill_surface_contains_polyline(Polyline* polyline)
|
||||
%code%{ RETVAL = THIS->any_internal_region_fill_surface_contains(*polyline); %};
|
||||
bool any_internal_region_slice_contains_polyline(Polyline* polyline)
|
||||
%code%{ RETVAL = THIS->any_internal_region_slice_contains(*polyline); %};
|
||||
bool any_bottom_region_slice_contains_polyline(Polyline* polyline)
|
||||
%code%{ RETVAL = THIS->any_bottom_region_slice_contains(*polyline); %};
|
||||
};
|
||||
|
||||
%name{Slic3r::Layer::Support} class SupportLayer {
|
||||
|
@ -123,12 +119,8 @@
|
|||
Ref<ExPolygonCollection> slices()
|
||||
%code%{ RETVAL = &THIS->slices; %};
|
||||
|
||||
bool any_internal_region_slice_contains_line(Line* line)
|
||||
%code%{ RETVAL = THIS->any_internal_region_slice_contains(*line); %};
|
||||
bool any_bottom_region_slice_contains_line(Line* line)
|
||||
%code%{ RETVAL = THIS->any_bottom_region_slice_contains(*line); %};
|
||||
bool any_internal_region_fill_surface_contains_line(Line* line)
|
||||
%code%{ RETVAL = THIS->any_internal_region_fill_surface_contains(*line); %};
|
||||
bool any_internal_region_fill_surface_contains_polyline(Polyline* polyline)
|
||||
%code%{ RETVAL = THIS->any_internal_region_fill_surface_contains(*polyline); %};
|
||||
bool any_internal_region_slice_contains_polyline(Polyline* polyline)
|
||||
%code%{ RETVAL = THIS->any_internal_region_slice_contains(*polyline); %};
|
||||
bool any_bottom_region_slice_contains_polyline(Polyline* polyline)
|
||||
%code%{ RETVAL = THIS->any_bottom_region_slice_contains(*polyline); %};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue