From f8ef9bc363171bd6bd276164526f7397041aedfc Mon Sep 17 00:00:00 2001
From: Rodrigo <162915171+RF47@users.noreply.github.com>
Date: Fri, 4 Jul 2025 03:09:44 -0300
Subject: [PATCH] Small improvement of tpmsd infill (#10049)
* smooth tpmsd
Changed the number of initial segments in the make_waves function from 4 to 16 for finer wave discretization. This should improve the accuracy of the generated wave polylines.
* Update param_tpmsd.svg
---
resources/images/param_tpmsd.svg | 195 +++++++------------------------
src/libslic3r/Fill/FillTpmsD.cpp | 5 +-
2 files changed, 45 insertions(+), 155 deletions(-)
diff --git a/resources/images/param_tpmsd.svg b/resources/images/param_tpmsd.svg
index 247f77c6d2..c66ea26347 100644
--- a/resources/images/param_tpmsd.svg
+++ b/resources/images/param_tpmsd.svg
@@ -22,93 +22,16 @@
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
- inkscape:zoom="24.479167"
- inkscape:cx="12.214468"
- inkscape:cy="12.88851"
+ inkscape:zoom="45.254834"
+ inkscape:cx="17.987029"
+ inkscape:cy="12.805262"
inkscape:window-width="2560"
inkscape:window-height="1377"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="svg10"
- showguides="true">
-
-
-
-
-
-
-
-
-
-
-
-
-
+ showguides="true" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/libslic3r/Fill/FillTpmsD.cpp b/src/libslic3r/Fill/FillTpmsD.cpp
index 1f2f3fb76c..4750fc55fc 100644
--- a/src/libslic3r/Fill/FillTpmsD.cpp
+++ b/src/libslic3r/Fill/FillTpmsD.cpp
@@ -55,8 +55,9 @@ static Polylines make_waves(double gridZ, double density_adjusted, double line_s
std::vector> wave;
{//fill one wave
const auto v=[&](double u){return acos(a/b*cos(u));};
- for(int c=0;c<=4;++c){
- const double u=minU+2*M_PI*c/4;
+ const int initialSegments=16;
+ for(int c=0;c<=initialSegments;++c){
+ const double u=minU+2*M_PI*c/initialSegments;
wave.emplace_back(u,v(u));
}
{//refine