fix clipper usage to fix accumulator contours.
This commit is contained in:
parent
b44c6c00d0
commit
f52e3fef75
1 changed files with 7 additions and 7 deletions
|
@ -658,11 +658,6 @@ void tgPolygonAddToClipperAccumulator( const TGPolygon& subject, bool dump )
|
||||||
ClipperLib::Polygons clipper_subject;
|
ClipperLib::Polygons clipper_subject;
|
||||||
make_clipper_poly( subject, &clipper_subject );
|
make_clipper_poly( subject, &clipper_subject );
|
||||||
|
|
||||||
ClipperLib::Clipper c;
|
|
||||||
c.Clear();
|
|
||||||
c.AddPolygons(clipper_subject, ClipperLib::ptSubject);
|
|
||||||
c.AddPolygons(clipper_accumulator, ClipperLib::ptClip);
|
|
||||||
|
|
||||||
if (dump) {
|
if (dump) {
|
||||||
subjectFile.open ("subject.txt");
|
subjectFile.open ("subject.txt");
|
||||||
subjectFile << clipper_subject;
|
subjectFile << clipper_subject;
|
||||||
|
@ -673,7 +668,12 @@ void tgPolygonAddToClipperAccumulator( const TGPolygon& subject, bool dump )
|
||||||
clipFile.close();
|
clipFile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !c.Execute(ClipperLib::ctUnion, clipper_accumulator, ClipperLib::pftNonZero, ClipperLib::pftNonZero) ) {
|
ClipperLib::Clipper c;
|
||||||
|
c.Clear();
|
||||||
|
c.AddPolygons(clipper_subject, ClipperLib::ptSubject);
|
||||||
|
c.AddPolygons(clipper_accumulator, ClipperLib::ptClip);
|
||||||
|
|
||||||
|
if ( !c.Execute(ClipperLib::ctUnion, clipper_accumulator, ClipperLib::pftEvenOdd, ClipperLib::pftEvenOdd) ) {
|
||||||
SG_LOG(SG_GENERAL, SG_ALERT, "Add to Accumulator returned FALSE" );
|
SG_LOG(SG_GENERAL, SG_ALERT, "Add to Accumulator returned FALSE" );
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue