DLL_PUBLIC void CDECL add_offset_paths(ClipperLib::ClipperOffset *ptr, ClipperLib::IntPoint** paths, size_t* path_counts, size_t count, ClipperLib::JoinType joinType, ClipperLib::EndType endType) { ClipperLib::Paths vs = ClipperLib::Paths(); for(size_t i = 0; i < count; i++) { auto it = vs.emplace(vs.end()); for(size_t j = 0; j < path_counts[i]; j++) { it->emplace(it->end(), paths[i][j].X, paths[i][j].Y); } } try { ptr->AddPaths(vs, joinType, endType); } catch(ClipperLib::clipperException e) { printf(e.what()); } }
DLL_PUBLIC bool CDECL add_paths(ClipperLib::Clipper *ptr, ClipperLib::IntPoint** paths, size_t* path_counts, size_t count, ClipperLib::PolyType polyType, bool closed) { ClipperLib::Paths vs = ClipperLib::Paths(); for(size_t i = 0; i < count; i++) { auto it = vs.emplace(vs.end()); for(size_t j = 0; j < path_counts[i]; j++) { it->emplace(it->end(), paths[i][j].X, paths[i][j].Y); } } bool result = false; try { result = ptr->AddPaths(vs, polyType, closed); } catch(ClipperLib::clipperException e) { printf(e.what()); } return result; }