From 73cd351e2d18860612caa723cd23881a3a978fb7 Mon Sep 17 00:00:00 2001 From: surynek Date: Thu, 17 Oct 2024 22:07:17 +0200 Subject: [PATCH] Minor code improvements. --- src/libseqarrange/src/seq_sequential.cpp | 28 ++++++++++++------------ src/libseqarrange/src/seq_sequential.hpp | 22 +++---------------- 2 files changed, 17 insertions(+), 33 deletions(-) diff --git a/src/libseqarrange/src/seq_sequential.cpp b/src/libseqarrange/src/seq_sequential.cpp index 08b0d93ba1..5e23a88f46 100644 --- a/src/libseqarrange/src/seq_sequential.cpp +++ b/src/libseqarrange/src/seq_sequential.cpp @@ -1223,7 +1223,7 @@ void introduce_PointOutsidePolygon(z3::solver &Solver, - (normal.x() * dec_var_X2) - (normal.x() * line.a.x()) - (normal.y() * dec_var_Y2) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1266,7 +1266,7 @@ void introduce_SequentialPointOutsidePolygon(z3::solver &Solver, - (normal.x() * dec_var_X2) - (normal.x() * line.a.x()) - (normal.y() * dec_var_Y2) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1309,7 +1309,7 @@ void introduce_ConsequentialPointOutsidePolygon(z3::solver &Solver, - (normal.x() * dec_var_X2) - (normal.x() * line.a.x()) - (normal.y() * dec_var_Y2) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1354,7 +1354,7 @@ void introduce_ShiftSequentialPointOutsidePolygon(z3::solver &Solver, - (normal.x() * dec_var_X2) - (normal.x() * line.a.x()) - (normal.y() * dec_var_Y2) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1399,7 +1399,7 @@ void introduce_ShiftConsequentialPointOutsidePolygon(z3::solver &Solv - (normal.x() * dec_var_X2) - (normal.x() * line.a.x()) - (normal.y() * dec_var_Y2) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1483,7 +1483,7 @@ void introduce_SequentialFixedPointOutsidePolygon(z3::solver &Solver, - (normal.x() * dec_var_X2) - (normal.x() * line.a.x()) - (normal.y() * dec_var_Y2) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1525,7 +1525,7 @@ void introduce_SequentialFixedPointOutsidePolygon(z3::solver &Solver, - (normal.x() * dec_var_X2) - (normal.x() * line.a.x()) - (normal.y() * dec_var_Y2) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1570,7 +1570,7 @@ void introduce_ConsequentialFixedPointOutsidePolygon(z3::solver &Solv - (normal.x() * dec_var_X2) - (normal.x() * line.a.x()) - (normal.y() * dec_var_Y2) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1615,7 +1615,7 @@ void introduce_ConsequentialFixedPointOutsidePolygon(z3::solver &Solv - (normal.x() * dec_var_X2) - (normal.x() * line.a.x()) - (normal.y() * dec_var_Y2) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1657,7 +1657,7 @@ void introduce_PointOutsideFixedPolygon(z3::solver &Solver, - (normal.x() * Context.real_val(dec_value_X2.numerator, dec_value_X2.denominator)) - (normal.x() * line.a.x()) - (normal.y() * Context.real_val(dec_value_Y2.numerator, dec_value_Y2.denominator)) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1700,7 +1700,7 @@ void introduce_SequentialPointOutsideFixedPolygon(z3::solver &Solver, - (normal.x() * Context.real_val(dec_value_X2.numerator, dec_value_X2.denominator)) - (normal.x() * line.a.x()) - (normal.y() * Context.real_val(dec_value_Y2.numerator, dec_value_Y2.denominator)) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1743,7 +1743,7 @@ void introduce_SequentialPointOutsideFixedPolygon(z3::solver &Solver, - (normal.x() * Context.real_val(dec_value_X2.numerator, dec_value_X2.denominator)) - (normal.x() * line.a.x()) - (normal.y() * Context.real_val(dec_value_Y2.numerator, dec_value_Y2.denominator)) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1788,7 +1788,7 @@ void introduce_ConsequentialPointOutsideFixedPolygon(z3::solver &Solv - (normal.x() * Context.real_val(dec_value_X2.numerator, dec_value_X2.denominator)) - (normal.x() * line.a.x()) - (normal.y() * Context.real_val(dec_value_Y2.numerator, dec_value_Y2.denominator)) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { @@ -1834,7 +1834,7 @@ void introduce_ConsequentialPointOutsideFixedPolygon(z3::solver &Solv - (normal.x() * Context.real_val(dec_value_X2.numerator, dec_value_X2.denominator)) - (normal.x() * line.a.x()) - (normal.y() * Context.real_val(dec_value_Y2.numerator, dec_value_Y2.denominator)) - - (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/); + - (normal.y() * line.a.y()) > 0); if (p == 0) { diff --git a/src/libseqarrange/src/seq_sequential.hpp b/src/libseqarrange/src/seq_sequential.hpp index ed6572b812..b880bb0fb7 100644 --- a/src/libseqarrange/src/seq_sequential.hpp +++ b/src/libseqarrange/src/seq_sequential.hpp @@ -47,16 +47,15 @@ namespace Sequential /*----------------------------------------------------------------*/ - -const coord_t SEQ_SVG_SCALE_FACTOR = 50000; - + #define SEQ_INTERSECTION_REPULSION_MIN "-0.01" #define SEQ_INTERSECTION_REPULSION_MAX "1.01" #define SEQ_TEMPORAL_ABSENCE_THRESHOLD "-16" #define SEQ_TEMPORAL_PRESENCE_THRESHOLD "16" #define SEQ_Z3_SOLVER_TIMEOUT "8000" - + +const coord_t SEQ_SVG_SCALE_FACTOR = 50000; const int SEQ_GROUND_PRESENCE_TIME = 32; const int SEQ_PROGRESS_RANGE = 100; @@ -72,21 +71,6 @@ const double SEQ_DECIMATION_TOLERANCE_VALUE_HIGH = 450000.0; typedef std::basic_string string; typedef std::unordered_map string_map; - - -/*----------------------------------------------------------------*/ -/* -struct PrinterGeometry -{ - coord_t x_size; - coord_t y_size; - - std::set convex_heights; - std::set box_heights; - - std::map > extruder_slices; -}; -*/ /*----------------------------------------------------------------*/