Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
clipper.cpp File Reference
#include "clipper.hpp"
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdexcept>
#include <cstring>
#include <cstdlib>
#include <ostream>
#include <functional>
#include <assert.h>
#include <libslic3r/Int128.hpp>
+ Include dependency graph for clipper.cpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ClipperLib
 

Macros

#define HORIZONTAL   (-1.0E+40)
 
#define TOLERANCE   (1.0e-20)
 
#define NEAR_ZERO(val)   (((val) > -TOLERANCE) && ((val) < TOLERANCE))
 

Enumerations

enum  ClipperLib::Direction { ClipperLib::dRightToLeft , ClipperLib::dLeftToRight }
 
enum  ClipperLib::NodeType { ClipperLib::ntAny , ClipperLib::ntOpen , ClipperLib::ntClosed }
 

Functions

IntPoint ClipperLib::IntPoint2d (cInt x, cInt y)
 
cInt ClipperLib::Round (double val)
 
bool ClipperLib::operator== (const IntPoint &l, const IntPoint &r)
 
bool ClipperLib::operator!= (const IntPoint &l, const IntPoint &r)
 
double ClipperLib::Area (const Path &poly)
 
double ClipperLib::Area (const OutPt *op)
 
double ClipperLib::Area (const OutRec &outRec)
 
bool ClipperLib::PointIsVertex (const IntPoint &Pt, OutPt *pp)
 
int ClipperLib::PointInPolygon (const IntPoint &pt, const Path &path)
 
int ClipperLib::PointInPolygon (const IntPoint &pt, OutPt *op)
 
bool ClipperLib::Poly2ContainsPoly1 (OutPt *OutPt1, OutPt *OutPt2)
 
bool ClipperLib::SlopesEqual (const cInt dx1, const cInt dy1, const cInt dx2, const cInt dy2, bool)
 
bool ClipperLib::SlopesEqual (const TEdge &e1, const TEdge &e2, bool UseFullInt64Range)
 
bool ClipperLib::SlopesEqual (const IntPoint &pt1, const IntPoint &pt2, const IntPoint &pt3, bool UseFullInt64Range)
 
bool ClipperLib::SlopesEqual (const IntPoint &pt1, const IntPoint &pt2, const IntPoint &pt3, const IntPoint &pt4, bool UseFullInt64Range)
 
bool ClipperLib::IsHorizontal (TEdge &e)
 
double ClipperLib::GetDx (const IntPoint &pt1, const IntPoint &pt2)
 
cInt ClipperLib::TopX (TEdge &edge, const cInt currentY)
 
void ClipperLib::IntersectPoint (TEdge &Edge1, TEdge &Edge2, IntPoint &ip)
 
void ClipperLib::ReversePolyPtLinks (OutPt *pp)
 
void ClipperLib::InitEdge (TEdge *e, TEdge *eNext, TEdge *ePrev, const IntPoint &Pt)
 
void ClipperLib::InitEdge2 (TEdge &e, PolyType Pt)
 
TEdgeClipperLib::RemoveEdge (TEdge *e)
 
void ClipperLib::ReverseHorizontal (TEdge &e)
 
bool ClipperLib::GetOverlapSegment (IntPoint pt1a, IntPoint pt1b, IntPoint pt2a, IntPoint pt2b, IntPoint &pt1, IntPoint &pt2)
 
bool ClipperLib::FirstIsBottomPt (const OutPt *btmPt1, const OutPt *btmPt2)
 
OutPtClipperLib::GetBottomPt (OutPt *pp)
 
bool ClipperLib::Pt2IsBetweenPt1AndPt3 (const IntPoint &pt1, const IntPoint &pt2, const IntPoint &pt3)
 
bool ClipperLib::HorzSegmentsOverlap (cInt seg1a, cInt seg1b, cInt seg2a, cInt seg2b)
 
static void ClipperLib::RangeTest (const IntPoint &pt)
 
TEdgeClipperLib::FindNextLocMin (TEdge *E)
 
OutRecClipperLib::GetLowermostRec (OutRec *outRec1, OutRec *outRec2)
 
bool ClipperLib::Param1RightOfParam2 (OutRec *outRec1, OutRec *outRec2)
 
bool ClipperLib::IsMaxima (TEdge *e, const cInt Y)
 
bool ClipperLib::IsIntermediate (TEdge *e, const cInt Y)
 
TEdgeClipperLib::GetMaximaPair (TEdge *e)
 
void ClipperLib::GetHorzDirection (TEdge &HorzEdge, Direction &Dir, cInt &Left, cInt &Right)
 
bool ClipperLib::EdgesAdjacent (const IntersectNode &inode)
 
int ClipperLib::PointCount (OutPt *Pts)
 
bool ClipperLib::E2InsertsBeforeE1 (TEdge &e1, TEdge &e2)
 
bool ClipperLib::GetOverlap (const cInt a1, const cInt a2, const cInt b1, const cInt b2, cInt &Left, cInt &Right)
 
void ClipperLib::UpdateOutPtIdxs (OutRec &outrec)
 
DoublePoint ClipperLib::GetUnitNormal (const IntPoint &pt1, const IntPoint &pt2)
 
void ClipperLib::ReversePath (Path &p)
 
void ClipperLib::ReversePaths (Paths &p)
 
Paths ClipperLib::SimplifyPolygon (const Path &in_poly, PolyFillType fillType, bool strictly_simple)
 
double ClipperLib::DistanceSqrd (const IntPoint &pt1, const IntPoint &pt2)
 
double ClipperLib::DistanceFromLineSqrd (const IntPoint &pt, const IntPoint &ln1, const IntPoint &ln2)
 
bool ClipperLib::SlopesNearCollinear (const IntPoint &pt1, const IntPoint &pt2, const IntPoint &pt3, double distSqrd)
 
bool ClipperLib::PointsAreClose (IntPoint pt1, IntPoint pt2, double distSqrd)
 
OutPtClipperLib::ExcludeOp (OutPt *op)
 
void ClipperLib::CleanPolygon (const Path &in_poly, Path &out_poly, double distance)
 
void ClipperLib::CleanPolygon (Path &poly, double distance)
 
void ClipperLib::CleanPolygons (const Paths &in_polys, Paths &out_polys, double distance)
 
void ClipperLib::CleanPolygons (Paths &polys, double distance)
 
void ClipperLib::Minkowski (const Path &poly, const Path &path, Paths &solution, bool isSum, bool isClosed)
 
void ClipperLib::MinkowskiSum (const Path &pattern, const Path &path, Paths &solution, bool pathIsClosed)
 
void ClipperLib::TranslatePath (const Path &input, Path &output, const IntPoint &delta)
 
void ClipperLib::MinkowskiSum (const Path &pattern, const Paths &paths, Paths &solution, bool pathIsClosed)
 
void ClipperLib::MinkowskiDiff (const Path &poly1, const Path &poly2, Paths &solution)
 
void ClipperLib::AddPolyNodeToPaths (const PolyNode &polynode, NodeType nodetype, Paths &paths)
 
void ClipperLib::AddPolyNodeToPaths (PolyNode &&polynode, NodeType nodetype, Paths &paths)
 
void ClipperLib::PolyTreeToPaths (const PolyTree &polytree, Paths &paths)
 
void ClipperLib::PolyTreeToPaths (PolyTree &&polytree, Paths &paths)
 
void ClipperLib::ClosedPathsFromPolyTree (const PolyTree &polytree, Paths &paths)
 
void ClipperLib::OpenPathsFromPolyTree (PolyTree &polytree, Paths &paths)
 
std::ostream & ClipperLib::operator<< (std::ostream &s, const IntPoint &p)
 
std::ostream & ClipperLib::operator<< (std::ostream &s, const Path &p)
 
std::ostream & ClipperLib::operator<< (std::ostream &s, const Paths &p)
 

Variables

static double const ClipperLib::pi = 3.141592653589793238
 
static double const ClipperLib::two_pi = pi *2
 
static double const ClipperLib::def_arc_tolerance = 0.25
 
static int const ClipperLib::Unassigned = -1
 
static int const ClipperLib::Skip = -2
 

Macro Definition Documentation

◆ HORIZONTAL

#define HORIZONTAL   (-1.0E+40)

◆ NEAR_ZERO

#define NEAR_ZERO (   val)    (((val) > -TOLERANCE) && ((val) < TOLERANCE))

◆ TOLERANCE

#define TOLERANCE   (1.0e-20)