Code Monkey home page Code Monkey logo

Comments (14)

lukkio88 avatar lukkio88 commented on July 17, 2024

By the way, the client app I'm using is:

#include <Bff.h>
#include <MeshIO.h>
#include <iostream>

int main(int argc, char** argv) {

	if(argc != 3) {
		std::cout << "Usage : UnitTestDewrinkling <input-filename>.obj <output-filename>.obj" << std::endl;
		return 1;
	}

	std::string input_filename = argv[1];
	std::string output_filename = argv[2];

	Mesh test_mesh;

	std::cout << "Loading mesh from " << input_filename << "..." << std::endl;

	if(!test_mesh.read(input_filename))
		std::cout << "Reading problems!" << std::endl;

	std::cout << "Initializing flattening module..." << std::endl;

	BFF flattening_module(test_mesh);
	EigenDenseMatrix boundaryData(flattening_module.data->bN);

	std::cout << "Flattening (generating uv)" << std::endl;

	flattening_module.flatten(boundaryData,true);

	std::cout << "Flattening done, now storing into " << output_filename << "..." << std::endl;

	test_mesh.write(output_filename,false,false);

	std::cout << "Output stored!" << std::endl;


	return 0;

}

Maybe there's some other setting I'm before starting the flattening. For example I noticed you have something like:

        // flatten
        if (type == BoundaryType::automatic) {
            removeVertexHandles();
            DenseMatrix u(bff->data->bN);
            bff->flatten(u, true);
            performPCA();
            update();

        } 

In your Viewer.cpp, maybe I need to call removeVertexHandles and PerformPCA somehow?

from boundary-first-flattening.

lukkio88 avatar lukkio88 commented on July 17, 2024

And one more question... I'm not 100% sure, but why is the image of the checkboard like shifted (from your original tool)?

from boundary-first-flattening.

rohan-sawhney avatar rohan-sawhney commented on July 17, 2024

You can probably just get rid of the alpha and beta (this is cholmod specific) and return "refA + refB". It seems like your client app is alright, there is no need to call/implement "removeVertexHandles" and "performPCA" - these are called for visualization purposes.

from boundary-first-flattening.

lukkio88 avatar lukkio88 commented on July 17, 2024

There was an issue with my initialization function in my Dense/Sparse classes now I'm getting the following outputs (normalized and not normalized)
screenshot from 2018-10-12 13-46-40

screenshot from 2018-10-12 13-48-54

The second picture is quite close to what your tool provides (not the same though, this might be actually Eigen at this point). However I don't understand why the texture mapping doesn't align the texture with the orientation of the mesh.

from boundary-first-flattening.

lukkio88 avatar lukkio88 commented on July 17, 2024

I've accidentally closed the issue... sorry...

from boundary-first-flattening.

rohan-sawhney avatar rohan-sawhney commented on July 17, 2024

You'll have to translate, rotate and/or scale either the texture image or the uvs to get them to align the way you want them to. The "Show UV Tex Param" option in Meshlab lets you see the current alignment.

from boundary-first-flattening.

lukkio88 avatar lukkio88 commented on July 17, 2024

So despite not being aligned, you would say the parameterization is still correct.

from boundary-first-flattening.

rohan-sawhney avatar rohan-sawhney commented on July 17, 2024

Its difficult for me to say, I'd print out the uvs from the BFF tool and your implementation and see the error between them to check if your implementation is correct.

from boundary-first-flattening.

lukkio88 avatar lukkio88 commented on July 17, 2024

I was more referring, in general. The UV look different to me, so there might still be something to sorted out.

from boundary-first-flattening.

lukkio88 avatar lukkio88 commented on July 17, 2024

You can probably just get rid of the alpha and beta (this is cholmod specific) and return "refA + refB". It seems like your client app is alright, there is no need to call/implement "removeVertexHandles" and "performPCA" - these are called for visualization purposes.

I don't think I can get rid of the two constants, since you use them in your overload of the operator -

from boundary-first-flattening.

rohan-sawhney avatar rohan-sawhney commented on July 17, 2024

Right, but you can just get rid of the "add" function and directly return "A + B" and "A - B" in the appropriate operators.

from boundary-first-flattening.

lukkio88 avatar lukkio88 commented on July 17, 2024

Fair point.

from boundary-first-flattening.

lukkio88 avatar lukkio88 commented on July 17, 2024

Hi again, Is there some special setting you do in your cholesky factorization? If you compare my output against yours you can see the top right corner distorted (in mine). Is there maybe some special setting I should be aware of?

I have the feeling the Eigen solver has stability issues, but I might be complete wrong.

from boundary-first-flattening.

rohan-sawhney avatar rohan-sawhney commented on July 17, 2024

In my experience, Cholmod is a more stable solver than Eigen. Eigen has wrappers around multiple external solvers such as Cholmod (see here: http://eigen.tuxfamily.org/dox/group__TopicSparseSystems.html), it might be worth giving them a try to see if the results improve (and to make sure the problem is solver related).

from boundary-first-flattening.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.