mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-17 11:47:54 -06:00
Simple brim ears impl (#1779)
* First working brim ear impl, ported from SuperSlicer * Make brim ears configurable * Generate ears only if ear size > 0 * Fix `Polygon::convex_points` as well as brim ear max angle * Fix another error in `Polygon::convex_points` and `Polygon::concave_points` * Apply brim ears to inner brims as well * tweak hide and disable condition a bit --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
parent
afe1030b58
commit
f714e72faa
9 changed files with 136 additions and 18 deletions
|
@ -237,7 +237,7 @@ Points filter_points_by_vectors(const Points &poly, FilterFn filter)
|
|||
// p2 is next point to the currently visited point p1.
|
||||
Vec2d v2 = (p2 - p1).cast<double>();
|
||||
if (filter(v1, v2))
|
||||
out.emplace_back(p2);
|
||||
out.emplace_back(p1);
|
||||
v1 = v2;
|
||||
p1 = p2;
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ template<typename ConvexConcaveFilterFn>
|
|||
Points filter_convex_concave_points_by_angle_threshold(const Points &poly, double angle_threshold, ConvexConcaveFilterFn convex_concave_filter)
|
||||
{
|
||||
assert(angle_threshold >= 0.);
|
||||
if (angle_threshold < EPSILON) {
|
||||
if (angle_threshold > EPSILON) {
|
||||
double cos_angle = cos(angle_threshold);
|
||||
return filter_points_by_vectors(poly, [convex_concave_filter, cos_angle](const Vec2d &v1, const Vec2d &v2){
|
||||
return convex_concave_filter(v1, v2) && v1.normalized().dot(v2.normalized()) < cos_angle;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue