mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-13 17:09:02 +08:00
Change 4-digit after dot for fields to 8, useful for z-step
also a little refresh fix for z-step
This commit is contained in:
parent
9aaf4e905c
commit
2c33dc9cc8
@ -649,7 +649,8 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector<t_config_
|
||||
|| opt_key == "support_material_contact_distance_bottom"
|
||||
|| opt_key == "xy_size_compensation"
|
||||
|| opt_key == "hole_size_compensation"
|
||||
|| opt_key == "hole_to_polyhole") {
|
||||
|| opt_key == "hole_to_polyhole"
|
||||
|| opt_key == "z_step") {
|
||||
steps.emplace_back(posSlice);
|
||||
} else if (opt_key == "support_material") {
|
||||
steps.emplace_back(posSupportMaterial);
|
||||
|
@ -23,16 +23,16 @@ namespace Slic3r
|
||||
|
||||
static const coordf_t MIN_LAYER_HEIGHT = 0.01;
|
||||
static const coordf_t MIN_LAYER_HEIGHT_DEFAULT = 0.07;
|
||||
|
||||
inline coordf_t check_z_step(coordf_t val, coordf_t z_step) {
|
||||
uint64_t valint = uint64_t(val * 100000. + 0.1);
|
||||
uint64_t stepint = uint64_t(z_step * 100000. + 0.1);
|
||||
return (((valint + (stepint/2)) / stepint) * stepint) / 100000.;
|
||||
// fields are with 8-number precision after the dot
|
||||
inline coordf_t check_z_step(const coordf_t val, const coordf_t z_step) {
|
||||
uint64_t valint = uint64_t(val * 100000000. + 0.1);
|
||||
uint64_t stepint = uint64_t(z_step * 100000000. + 0.1);
|
||||
return (((valint + (stepint/2)) / stepint) * stepint) / 100000000.;
|
||||
//return int((val + z_step * 0.5) / z_step) * z_step;
|
||||
}
|
||||
inline bool test_z_step(coordf_t val, coordf_t z_step) {
|
||||
uint64_t valint = uint64_t(val * 100000. + 0.1);
|
||||
uint64_t stepint = uint64_t(z_step * 100000. + 0.1);
|
||||
inline bool test_z_step(const coordf_t val, const coordf_t z_step) {
|
||||
uint64_t valint = uint64_t(val * 100000000. + 0.1);
|
||||
uint64_t stepint = uint64_t(z_step * 100000000. + 0.1);
|
||||
return valint % stepint == 0;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ class PrintConfig;
|
||||
class PrintObjectConfig;
|
||||
class ModelObject;
|
||||
|
||||
coordf_t check_z_step(coordf_t val, coordf_t z_step);
|
||||
coordf_t check_z_step(const coordf_t val,const coordf_t z_step);
|
||||
|
||||
// Parameters to guide object slicing and support generation.
|
||||
// The slicing parameters account for a raft and whether the 1st object layer is printed with a normal or a bridging flow
|
||||
|
@ -36,7 +36,7 @@ using t_kill_focus = std::function<void(const std::string&)>;
|
||||
using t_change = std::function<void(const t_config_option_key&, const boost::any&)>;
|
||||
using t_back_to_init = std::function<void(const std::string&)>;
|
||||
|
||||
wxString double_to_string(double const value, const int max_precision = 4);
|
||||
wxString double_to_string(double const value, const int max_precision = 8);
|
||||
|
||||
class RevertButton : public ScalableButton
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user