| 3055 | } |
| 3056 | |
| 3057 | bool BuildPathD(OutPt* op, bool reverse, bool isOpen, PathD& path, double inv_scale) |
| 3058 | { |
| 3059 | if (!op || op->next == op || (!isOpen && op->next == op->prev)) |
| 3060 | return false; |
| 3061 | |
| 3062 | path.resize(0); |
| 3063 | Point64 lastPt; |
| 3064 | OutPt* op2; |
| 3065 | if (reverse) |
| 3066 | { |
| 3067 | lastPt = op->pt; |
| 3068 | op2 = op->prev; |
| 3069 | } |
| 3070 | else |
| 3071 | { |
| 3072 | op = op->next; |
| 3073 | lastPt = op->pt; |
| 3074 | op2 = op->next; |
| 3075 | } |
| 3076 | #ifdef USINGZ |
| 3077 | path.emplace_back(lastPt.x * inv_scale, lastPt.y * inv_scale, lastPt.z); |
| 3078 | #else |
| 3079 | path.emplace_back(lastPt.x * inv_scale, lastPt.y * inv_scale); |
| 3080 | #endif |
| 3081 | |
| 3082 | while (op2 != op) |
| 3083 | { |
| 3084 | if (op2->pt != lastPt) |
| 3085 | { |
| 3086 | lastPt = op2->pt; |
| 3087 | #ifdef USINGZ |
| 3088 | path.emplace_back(lastPt.x * inv_scale, lastPt.y * inv_scale, lastPt.z); |
| 3089 | #else |
| 3090 | path.emplace_back(lastPt.x * inv_scale, lastPt.y * inv_scale); |
| 3091 | #endif |
| 3092 | |
| 3093 | } |
| 3094 | if (reverse) |
| 3095 | op2 = op2->prev; |
| 3096 | else |
| 3097 | op2 = op2->next; |
| 3098 | } |
| 3099 | if (path.size() == 3 && IsVerySmallTriangle(*op2)) return false; |
| 3100 | return true; |
| 3101 | } |
| 3102 | |
| 3103 | void ClipperD::BuildPathsD(PathsD& solutionClosed, PathsD* solutionOpen) |
| 3104 | { |
no test coverage detected