| 74 | } |
| 75 | |
| 76 | void test3() { |
| 77 | |
| 78 | double radius = 5000.0; |
| 79 | Paths64 subject = { Ellipse(Rect64(-radius, -radius, radius, radius), 200) }; |
| 80 | |
| 81 | ClipperOffset co; |
| 82 | co.AddPaths(subject, JoinType::Miter, EndType::Polygon); |
| 83 | |
| 84 | co.SetDeltaCallback([radius](const Path64& path, |
| 85 | const PathD& path_norms, size_t curr_idx, size_t prev_idx) { |
| 86 | // when multiplying the x & y of edge unit normal vectors, the value will be |
| 87 | // largest (0.5) when edges are at 45 deg. and least (-0.5) at negative 45 deg. |
| 88 | double delta = path_norms[curr_idx].y * path_norms[curr_idx].x; |
| 89 | return radius * 0.5 + radius * delta; |
| 90 | }); |
| 91 | |
| 92 | // solution |
| 93 | Paths64 solution; |
| 94 | co.Execute(1.0, solution); |
| 95 | |
| 96 | std::string filename = "test3.svg"; |
| 97 | SvgWriter svg; |
| 98 | SvgAddSubject(svg, subject, FillRule::NonZero); |
| 99 | SvgAddSolution(svg, solution, FillRule::NonZero, false); |
| 100 | SvgSaveToFile(svg, filename, 400, 400); |
| 101 | System(filename); |
| 102 | } |
| 103 | |
| 104 | void test4() { |
| 105 |
no test coverage detected