Clarify use of math functions

This commit is contained in:
thewildmage
2023-05-29 21:12:44 -06:00
parent 085591ee06
commit d3cc8b7575
2 changed files with 3 additions and 4 deletions

View File

@@ -329,13 +329,13 @@ namespace Slic3r {
double object_size_x(int num_patterns) {
return num_patterns * ((m_wall_count - 1) * line_spacing_angle()) +
(num_patterns - 1) * (m_pattern_spacing + line_width()) +
cos(to_radians(m_corner_angle) / 2) * m_wall_side_length +
std::cos(to_radians(m_corner_angle) / 2) * m_wall_side_length +
line_spacing_anchor() * m_anchor_perimeters
;
}
double object_size_y(double start_pa, double step_pa, int num_patterns) {
return 2 * sin(to_radians(m_corner_angle) / 2) * m_wall_side_length +
return 2 * std::sin(to_radians(m_corner_angle) / 2) * m_wall_side_length +
max_numbering_height(start_pa, step_pa, num_patterns) +
m_glyph_padding_vertical * 2 +
line_width_anchor()

View File

@@ -1,7 +1,6 @@
#pragma once
#define calib_pressure_advance_dd
#include <math.h>
#include <string>
#include "Point.hpp"
namespace Slic3r {
@@ -90,7 +89,7 @@ class calib_pressure_advance_pattern: public calib_pressure_advance
// from slic3r documentation: spacing = extrusion_width - layer_height * (1 - PI/4)
double line_spacing() { return line_width() - mp_gcodegen->config().layer_height.value * (1 - M_PI / 4); };
double line_spacing_anchor() { return line_width_anchor() - mp_gcodegen->config().initial_layer_print_height.value * (1 - M_PI / 4); };
double line_spacing_angle() { return line_spacing() / sin(to_radians(m_corner_angle) / 2); };
double line_spacing_angle() { return line_spacing() / std::sin(to_radians(m_corner_angle) / 2); };
double object_size_x(int num_patterns);
double object_size_y(double start_pa, double step_pa, int num_patterns);