mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 06:55:58 +08:00
Minor code improvements.
This commit is contained in:
parent
7cd23ab3e7
commit
73cd351e2d
@ -1223,7 +1223,7 @@ void introduce_PointOutsidePolygon(z3::solver &Solver,
|
|||||||
- (normal.x() * dec_var_X2)
|
- (normal.x() * dec_var_X2)
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * dec_var_Y2)
|
- (normal.y() * dec_var_Y2)
|
||||||
- (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/);
|
- (normal.y() * line.a.y()) > 0);
|
||||||
|
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
{
|
{
|
||||||
@ -1266,7 +1266,7 @@ void introduce_SequentialPointOutsidePolygon(z3::solver &Solver,
|
|||||||
- (normal.x() * dec_var_X2)
|
- (normal.x() * dec_var_X2)
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * dec_var_Y2)
|
- (normal.y() * dec_var_Y2)
|
||||||
- (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/);
|
- (normal.y() * line.a.y()) > 0);
|
||||||
|
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
{
|
{
|
||||||
@ -1309,7 +1309,7 @@ void introduce_ConsequentialPointOutsidePolygon(z3::solver &Solver,
|
|||||||
- (normal.x() * dec_var_X2)
|
- (normal.x() * dec_var_X2)
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * dec_var_Y2)
|
- (normal.y() * dec_var_Y2)
|
||||||
- (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/);
|
- (normal.y() * line.a.y()) > 0);
|
||||||
|
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
{
|
{
|
||||||
@ -1354,7 +1354,7 @@ void introduce_ShiftSequentialPointOutsidePolygon(z3::solver &Solver,
|
|||||||
- (normal.x() * dec_var_X2)
|
- (normal.x() * dec_var_X2)
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * dec_var_Y2)
|
- (normal.y() * dec_var_Y2)
|
||||||
- (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/);
|
- (normal.y() * line.a.y()) > 0);
|
||||||
|
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
{
|
{
|
||||||
@ -1399,7 +1399,7 @@ void introduce_ShiftConsequentialPointOutsidePolygon(z3::solver &Solv
|
|||||||
- (normal.x() * dec_var_X2)
|
- (normal.x() * dec_var_X2)
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * dec_var_Y2)
|
- (normal.y() * dec_var_Y2)
|
||||||
- (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/);
|
- (normal.y() * line.a.y()) > 0);
|
||||||
|
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
{
|
{
|
||||||
@ -1483,7 +1483,7 @@ void introduce_SequentialFixedPointOutsidePolygon(z3::solver &Solver,
|
|||||||
- (normal.x() * dec_var_X2)
|
- (normal.x() * dec_var_X2)
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * dec_var_Y2)
|
- (normal.y() * dec_var_Y2)
|
||||||
- (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/);
|
- (normal.y() * line.a.y()) > 0);
|
||||||
|
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
{
|
{
|
||||||
@ -1525,7 +1525,7 @@ void introduce_SequentialFixedPointOutsidePolygon(z3::solver &Solver,
|
|||||||
- (normal.x() * dec_var_X2)
|
- (normal.x() * dec_var_X2)
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * dec_var_Y2)
|
- (normal.y() * dec_var_Y2)
|
||||||
- (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/);
|
- (normal.y() * line.a.y()) > 0);
|
||||||
|
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
{
|
{
|
||||||
@ -1570,7 +1570,7 @@ void introduce_ConsequentialFixedPointOutsidePolygon(z3::solver &Solv
|
|||||||
- (normal.x() * dec_var_X2)
|
- (normal.x() * dec_var_X2)
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * dec_var_Y2)
|
- (normal.y() * dec_var_Y2)
|
||||||
- (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/);
|
- (normal.y() * line.a.y()) > 0);
|
||||||
|
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
{
|
{
|
||||||
@ -1615,7 +1615,7 @@ void introduce_ConsequentialFixedPointOutsidePolygon(z3::solver &Solv
|
|||||||
- (normal.x() * dec_var_X2)
|
- (normal.x() * dec_var_X2)
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * dec_var_Y2)
|
- (normal.y() * dec_var_Y2)
|
||||||
- (normal.y() * line.a.y()) > 0/*Context.real_val("0")*/);
|
- (normal.y() * line.a.y()) > 0);
|
||||||
|
|
||||||
if (p == 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() * Context.real_val(dec_value_X2.numerator, dec_value_X2.denominator))
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * Context.real_val(dec_value_Y2.numerator, dec_value_Y2.denominator))
|
- (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)
|
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() * Context.real_val(dec_value_X2.numerator, dec_value_X2.denominator))
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * Context.real_val(dec_value_Y2.numerator, dec_value_Y2.denominator))
|
- (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)
|
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() * Context.real_val(dec_value_X2.numerator, dec_value_X2.denominator))
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * Context.real_val(dec_value_Y2.numerator, dec_value_Y2.denominator))
|
- (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)
|
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() * Context.real_val(dec_value_X2.numerator, dec_value_X2.denominator))
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * Context.real_val(dec_value_Y2.numerator, dec_value_Y2.denominator))
|
- (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)
|
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() * Context.real_val(dec_value_X2.numerator, dec_value_X2.denominator))
|
||||||
- (normal.x() * line.a.x())
|
- (normal.x() * line.a.x())
|
||||||
- (normal.y() * Context.real_val(dec_value_Y2.numerator, dec_value_Y2.denominator))
|
- (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)
|
if (p == 0)
|
||||||
{
|
{
|
||||||
|
@ -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_MIN "-0.01"
|
||||||
#define SEQ_INTERSECTION_REPULSION_MAX "1.01"
|
#define SEQ_INTERSECTION_REPULSION_MAX "1.01"
|
||||||
#define SEQ_TEMPORAL_ABSENCE_THRESHOLD "-16"
|
#define SEQ_TEMPORAL_ABSENCE_THRESHOLD "-16"
|
||||||
#define SEQ_TEMPORAL_PRESENCE_THRESHOLD "16"
|
#define SEQ_TEMPORAL_PRESENCE_THRESHOLD "16"
|
||||||
|
|
||||||
#define SEQ_Z3_SOLVER_TIMEOUT "8000"
|
#define SEQ_Z3_SOLVER_TIMEOUT "8000"
|
||||||
|
|
||||||
|
const coord_t SEQ_SVG_SCALE_FACTOR = 50000;
|
||||||
const int SEQ_GROUND_PRESENCE_TIME = 32;
|
const int SEQ_GROUND_PRESENCE_TIME = 32;
|
||||||
const int SEQ_PROGRESS_RANGE = 100;
|
const int SEQ_PROGRESS_RANGE = 100;
|
||||||
|
|
||||||
@ -72,21 +71,6 @@ const double SEQ_DECIMATION_TOLERANCE_VALUE_HIGH = 450000.0;
|
|||||||
|
|
||||||
typedef std::basic_string<char> string;
|
typedef std::basic_string<char> string;
|
||||||
typedef std::unordered_map<string, int> string_map;
|
typedef std::unordered_map<string, int> string_map;
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------*/
|
|
||||||
/*
|
|
||||||
struct PrinterGeometry
|
|
||||||
{
|
|
||||||
coord_t x_size;
|
|
||||||
coord_t y_size;
|
|
||||||
|
|
||||||
std::set<coord_t> convex_heights;
|
|
||||||
std::set<coord_t> box_heights;
|
|
||||||
|
|
||||||
std::map<coord_t, std::vector<Polygon> > extruder_slices;
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------*/
|
/*----------------------------------------------------------------*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user