Skip to content

Efficiency issues about CGAL::Face_filtered_graph classes. #8355

Open
@fynkxo

Description

@fynkxo

Issue Details

Efficiency issues about CGAL::Face_filtered_graph classes.

The code is as follows. The time statistics results are attached in the figure.
From the results, we can see that the Face_filtered_graph construction took a huge amount of time.The same seems to be true in the class CGAL::copy face graph.

Source Code

for (decltype(NumberComponents)i = 0; i < NumberComponents; i++)
	{
		std::shared_ptr<boost::timer::auto_cpu_timer> t{new boost::timer::auto_cpu_timer()};
		std::cout << "Construct: \n";
		CGAL::Face_filtered_graph<Mesh> subMesh{mesh,i,fccmap};
                t.reset(new boost::timer::auto_cpu_timer);
                std::cout << "Calculate:\n";
		double volumeOrigin = PMP::volume(subMesh);
		double volume = std::abs(volumeOrigin);

			double x1 = INFINITY, x2 = -INFINITY;
			double y1 = INFINITY, y2 = -INFINITY;
			double z1 = INFINITY, z2 = -INFINITY;
			auto iter = CGAL::vertices(subMesh);
			while (iter.first != iter.second)
			{
				++iter.first;
				K::Point_3 v = mesh.point(*iter.first);
				double x = v.x();
				double y = v.y();
				double z = v.z();
				x1 = std::min(x1, x);
				x2 = std::max(x2, x);
				y1 = std::min(y1, y);
				y2 = std::max(y2, y);
				z1 = std::min(z1, z);
				z2 = std::max(z2, z);
			}

			volumes.push_back(volume);
			volumesOrigin.push_back(volumeOrigin);
			bboxes.push_back(CGAL::Bbox_3(x1, y1, z1, x2, y2, z2));
	}

Environment

  • Operating system (Windows64 bits):
  • Compiler: Visual Studio 2022
  • Release or debug mode: Release
  • Specific flags used (if any):
  • CGAL version: 5.6.1
  • Boost version: 1.84
  • Other libraries versions if used (Eigen, TBB, etc.):

Refer to drawing:

QQ截图20240715180021

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions