Fix clipart.cpp

This commit is contained in:
Andreas Fabri 2024-01-18 11:09:36 +00:00
parent c5a186b903
commit e8909924d5
2 changed files with 4 additions and 4 deletions

View File

@ -212,14 +212,14 @@ template <class Kernel, class Container>
bool is_valid(const Multipolygon_with_holes_2<Kernel, Container>& multipolygon) {
// Validate polygons
for (auto const& polygon: multipolygon.polygons()) {
for (auto const& polygon: multipolygon.polygons_with_holes()) {
if (!is_valid(polygon)) return false;
}
typename CGAL::Polygon_repair::Polygon_repair<Kernel, Container>::Validation_triangulation vt;
typename CGAL::Polygon_repair::Polygon_repair<Kernel, Container>::Validation_triangulation::Locate_type lt;
int li;
for (auto const& polygon: multipolygon.polygons()) {
for (auto const& polygon: multipolygon.polygons_with_holes()) {
if (vt.number_of_faces() > 0) {

View File

@ -31,7 +31,7 @@ int main(int argc, char* argv[]) {
if (file.path().filename().extension() != ".obj") continue;
std::cout << "Reading " << file.path().filename() << "...";
if (std::filesystem::exists(folder_out + "/" + std::string(file.path().stem()) + ".svg")) {
if (std::filesystem::exists(folder_out + "/" + file.path().stem().string() + ".svg")) {
std::cout << " skipped: already processed" << std::endl;
continue;
}
@ -90,7 +90,7 @@ int main(int argc, char* argv[]) {
double scale = desired_width/(bbox.xmax()-bbox.xmin());
std::ofstream ofs(folder_out + "/" + std::string(file.path().stem()) + ".svg");
std::ofstream ofs(folder_out + "/" + file.path().stem().string() + ".svg");
ofs << "<svg viewBox=\"0 0 " << desired_width << " " << scale*(bbox.ymax()-bbox.ymin()) << "\" xmlns=\"http://www.w3.org/2000/svg\">" << std::endl;
for (auto const& polygon: mp.polygons_with_holes()) {