MCPcopy Create free account
hub / github.com/AngusJohnson/Clipper2 / test5

Function test5

CPP/Examples/VariableOffset/VariableOffset.cpp:131–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void test5() {
132
133 Paths64 solution;
134 Paths64 subject = { MakePath({0,0, 20,0, 40,0, 60,0, 80,0, 100,0}) };
135
136 ClipperOffset co;
137 co.AddPaths(subject, JoinType::Round, EndType::Butt);
138 co.Execute(
139 [](const Path64& path,
140 const PathD& path_norms, size_t curr_idx, size_t prev_idx) {
141 return double(curr_idx * curr_idx + 10); }
142 , solution);
143
144 SvgWriter svg;
145 std::string filename = "test5.svg";
146 SvgAddOpenSubject(svg, subject, FillRule::NonZero);
147 SvgAddSolution(svg, solution, FillRule::NonZero, false);
148 SvgSaveToFile(svg, filename, 400, 400);
149 System(filename);
150}
151
152
153int main() {

Callers 1

mainFunction · 0.85

Calls 7

MakePathFunction · 0.85
SvgAddOpenSubjectFunction · 0.85
SvgAddSolutionFunction · 0.85
SvgSaveToFileFunction · 0.85
SystemFunction · 0.70
AddPathsMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected