| 102 | } |
| 103 | |
| 104 | void test4() { |
| 105 | |
| 106 | int64_t const scale = 100; |
| 107 | Paths64 solution; |
| 108 | Paths64 subject = { Ellipse(ScaleRect<int64_t,int64_t>(Rect64(10, 10, 50, 50), scale)) }; |
| 109 | |
| 110 | ClipperOffset co; |
| 111 | co.AddPaths(subject, JoinType::Round, EndType::Round); |
| 112 | co.Execute( |
| 113 | [scale](const Path64& path, |
| 114 | const PathD& path_norms, size_t curr_idx, size_t prev_idx) { |
| 115 | //double vertex_sin_a = CrossProduct(path_norms[curr_idx], path_norms[prev_idx]); |
| 116 | //double vertex_cos_a = DotProduct(path_norms[curr_idx], path_norms[prev_idx]); |
| 117 | //double vertex_angle = std::atan2(vertex_sin_a, vertex_cos_a); |
| 118 | //double edge_angle = std::atan2(path_norms[curr_idx].y, path_norms[curr_idx].x); |
| 119 | double sin_edge = path_norms[curr_idx].y; |
| 120 | return Sqr(sin_edge) * 3 * scale; } |
| 121 | , solution); |
| 122 | |
| 123 | std::string filename = "test4.svg"; |
| 124 | SvgWriter svg; |
| 125 | SvgAddOpenSubject(svg, subject, FillRule::NonZero); |
| 126 | SvgAddSolution(svg, solution, FillRule::NonZero, false); |
| 127 | SvgSaveToFile(svg, filename, 400, 400); |
| 128 | System(filename); |
| 129 | } |
| 130 | |
| 131 | void test5() { |
| 132 |
no test coverage detected