Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decimate_down_to always return false #21

Open
Zeta48 opened this issue Apr 5, 2023 · 0 comments
Open

decimate_down_to always return false #21

Zeta48 opened this issue Apr 5, 2023 · 0 comments

Comments

@Zeta48
Copy link

Zeta48 commented Apr 5, 2023

I am trying to add mesh decimation to my engine using your SeamAwareDecimater.
Unfortunaletly the decimate_down_to method always return false.

Even that small 2 triangles example fails:
`

		const int inNbVertices = 4;
		// 4 Vertices
		Eigen::MatrixXd V(inNbVertices, 3);
		{
			V(0, 0) = 0.0; V(0, 1) = 0.0; V(0, 2) = 0.0;
			V(1, 0) = 0.0; V(1, 1) = 1.0; V(1, 2) = 0.0;
			V(2, 0) = 1.0; V(2, 1) = 0.0; V(2, 2) = 0.0;
			V(3, 0) = 1.0; V(3, 1) = 1.0; V(3, 2) = 0.0;
		}

		// 4 texture coordinates
		Eigen::MatrixXd TC(inNbVertices, 2);
		{
			TC(0, 0) = 0.0; TC(0, 1) = 0.0;
			TC(1, 0) = 0.0; TC(1, 1) = 1.0;
			TC(2, 0) = 1.0; TC(2, 1) = 0.0;
			TC(3, 0) = 1.0; TC(3, 1) = 1.0;
		}

		// 2 faces
		const int inNbFaces = 2;
		Eigen::MatrixXi F(inNbFaces, 3);
		Eigen::MatrixXi FT(inNbFaces, 3);
		{
			{
				F(0, 0) = 0; F(0, 1) = 3; F(0, 2) = 1;
				F(1, 0) = 0; F(1, 1) = 2; F(1, 2) = 3;
			}
			FT = F;
		}

		// Perform decimation.
		const int target_num_vertices = 3;//75%
		const int seam_aware_degree = int(SeamAwareDegree::Seamless);

		Eigen::MatrixXd V_out, TC_out;
		Eigen::MatrixXi F_out, FT_out;

		const bool success = decimate_down_to(V, F, TC, FT, target_num_vertices, V_out, F_out, TC_out, FT_out, seam_aware_degree);
		assert(success);

`

Am i doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant