-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port Paint Brim Gizmo from BBS (#8433)
This PR ported the Brim Ear gizmo from BambuStudio. Thanks BambuLab! For compatibility reason, the existing auto-detected brim ears is kept. To use this new brim ear gizmo, you will have to change the brim style to "Painted".  Fix #6774
- Loading branch information
Showing
32 changed files
with
1,775 additions
and
72 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#ifndef BRIMEARSPOINT_HPP | ||
#define BRIMEARSPOINT_HPP | ||
|
||
#include <libslic3r/Point.hpp> | ||
|
||
|
||
namespace Slic3r { | ||
|
||
// An enum to keep track of where the current points on the ModelObject came from. | ||
enum class PointsStatus { | ||
NoPoints, // No points were generated so far. | ||
Generating, // The autogeneration algorithm triggered, but not yet finished. | ||
AutoGenerated, // Points were autogenerated (i.e. copied from the backend). | ||
UserModified // User has done some edits. | ||
}; | ||
|
||
struct BrimPoint | ||
{ | ||
Vec3f pos; | ||
float head_front_radius; | ||
|
||
BrimPoint() | ||
: pos(Vec3f::Zero()), head_front_radius(0.f) | ||
{} | ||
|
||
BrimPoint(float pos_x, | ||
float pos_y, | ||
float pos_z, | ||
float head_radius) | ||
: pos(pos_x, pos_y, pos_z) | ||
, head_front_radius(head_radius) | ||
{} | ||
|
||
BrimPoint(Vec3f position, float head_radius) | ||
: pos(position) | ||
, head_front_radius(head_radius) | ||
{} | ||
|
||
Vec3f transform(const Transform3d &trsf) | ||
{ | ||
Vec3d result = trsf * pos.cast<double>(); | ||
return result.cast<float>(); | ||
} | ||
|
||
bool operator==(const BrimPoint &sp) const | ||
{ | ||
float rdiff = std::abs(head_front_radius - sp.head_front_radius); | ||
return (pos == sp.pos) && rdiff < float(EPSILON); | ||
} | ||
|
||
bool operator!=(const BrimPoint &sp) const { return !(sp == (*this)); } | ||
template<class Archive> void serialize(Archive &ar) | ||
{ | ||
ar(pos, head_front_radius); | ||
} | ||
}; | ||
|
||
using BrimPoints = std::vector<BrimPoint>; | ||
|
||
} | ||
|
||
|
||
#endif // BRIMEARSPOINT_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.