Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukáš Hejl <hejl.lukas@gmail.com>2022-06-08 11:42:27 +0300
committerLukáš Hejl <hejl.lukas@gmail.com>2022-06-08 11:42:50 +0300
commit397b8789452431863720088f27c52c5b511c1e6a (patch)
tree8bc0c90ea16d282962556fbb02d0b89e34ef32af
parentf11f216f919b383bd0d5ca800150bd138b97ae5b (diff)
Backported a fix from Clipper 6.4.2 for the issue that Clipper Z coordinated has incorrect value because ZFillFunction wasn't called in all cases (https://sourceforge.net/p/polyclipping/bugs/160/). Also, this issue led to duplicity vertices with the same XY coordinates but differ in Z coordinates.lh_clipper_fix
-rw-r--r--src/clipper/clipper.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/clipper/clipper.cpp b/src/clipper/clipper.cpp
index 84d68b1e6..84109398a 100644
--- a/src/clipper/clipper.cpp
+++ b/src/clipper/clipper.cpp
@@ -2290,6 +2290,12 @@ void Clipper::ProcessHorizontal(TEdge *horzEdge)
if (horzEdge->OutIdx >= 0 && !IsOpen) //note: may be done multiple times
{
+#ifdef CLIPPERLIB_USE_XYZ
+ if (dir == dLeftToRight)
+ SetZ(e->Curr, *horzEdge, *e);
+ else
+ SetZ(e->Curr, *e, *horzEdge);
+#endif
op1 = AddOutPt(horzEdge, e->Curr);
TEdge* eNextHorz = m_SortedEdges;
while (eNextHorz)
@@ -2614,6 +2620,9 @@ void Clipper::ProcessEdgesAtTopOfScanbeam(const cInt topY)
{
e->Curr.x() = TopX( *e, topY );
e->Curr.y() = topY;
+#ifdef CLIPPERLIB_USE_XYZ
+ e->Curr.z() = topY == e->Top.y() ? e->Top.z() : (topY == e->Bot.y() ? e->Bot.z() : 0);
+#endif
}
//When StrictlySimple and 'e' is being touched by another edge, then