mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 14:49:03 +08:00
New gcode visualization library - Custom values for travel and wipe moves radius
This commit is contained in:
parent
7adaa32cd5
commit
72846bf0cd
@ -16,13 +16,18 @@ namespace libvgcode {
|
||||
static constexpr float PI = 3.141592f;
|
||||
|
||||
//
|
||||
// Default radius, in mm, of the cylinders used to render the travel moves.
|
||||
// Predefined values for the radius, in mm, of the cylinders used to render the travel moves.
|
||||
//
|
||||
static constexpr float DEFAULT_TRAVELS_RADIUS_MM = 0.1f;
|
||||
static constexpr float MIN_TRAVELS_RADIUS_MM = 0.05f;
|
||||
static constexpr float MAX_TRAVELS_RADIUS_MM = 1.0f;
|
||||
|
||||
//
|
||||
// Default radius, in mm, of the cylinders used to render the wipe moves.
|
||||
// Predefined values for the radius, in mm, of the cylinders used to render the wipe moves.
|
||||
//
|
||||
static constexpr float DEFAULT_WIPES_RADIUS_MM = 0.1f;
|
||||
static constexpr float MIN_WIPES_RADIUS_MM = 0.05f;
|
||||
static constexpr float MAX_WIPES_RADIUS_MM = 1.0f;
|
||||
|
||||
//
|
||||
// Vector in 3 dimensions
|
||||
|
@ -309,6 +309,7 @@ public:
|
||||
float get_travels_radius() const;
|
||||
//
|
||||
// Set the radius, in mm, of the cylinders used to render the travel moves.
|
||||
// Radius is clamped to [MIN_TRAVELS_RADIUS_MM..MAX_TRAVELS_RADIUS_MM]
|
||||
//
|
||||
void set_travels_radius(float radius);
|
||||
//
|
||||
@ -317,6 +318,7 @@ public:
|
||||
float get_wipes_radius() const;
|
||||
//
|
||||
// Set the radius, in mm, of the cylinders used to render the wipe moves.
|
||||
// Radius is clamped to [MIN_WIPES_RADIUS_MM..MAX_WIPES_RADIUS_MM]
|
||||
//
|
||||
void set_wipes_radius(float radius);
|
||||
|
||||
|
@ -1002,13 +1002,13 @@ void ViewerImpl::set_color_range_palette(EViewType type, const Palette& palette)
|
||||
|
||||
void ViewerImpl::set_travels_radius(float radius)
|
||||
{
|
||||
m_travels_radius = std::clamp(radius, 0.05f, 0.5f);
|
||||
m_travels_radius = std::clamp(radius, MIN_TRAVELS_RADIUS_MM, MAX_TRAVELS_RADIUS_MM);
|
||||
update_heights_widths();
|
||||
}
|
||||
|
||||
void ViewerImpl::set_wipes_radius(float radius)
|
||||
{
|
||||
m_wipes_radius = std::clamp(radius, 0.05f, 0.5f);
|
||||
m_wipes_radius = std::clamp(radius, MIN_WIPES_RADIUS_MM, MAX_WIPES_RADIUS_MM);
|
||||
update_heights_widths();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user