GithubHelp home page GithubHelp logo

Comments (5)

sgsellan avatar sgsellan commented on June 3, 2024

Hi! Thanks for using our code!

Indeed our method will never change the topology of the shape, so if it starts from a sphere (that's what V0, F0 are), it will only be able to recover genus 0 shapes. We'll make this clearer in the documentation.

from gpytoolbox.

nissmar avatar nissmar commented on June 3, 2024

Thank you for your quick reply!
I understand that the genus of the output will be zero but from the article I had the impression that reach_for_the_spheres could still deform the input mesh to best fit the target shape (for instance if the target is a cup and the input a sphere, the latter could somehow be deformed to fit the cup with a "filled" handle
). Is that not the case? Do you know what causes the code to crash in this example?

from gpytoolbox.

sgsellan avatar sgsellan commented on June 3, 2024

I see! No, that's not the case, if the input is genus 1, the flow will attempt to change topology and reach a singularity, leading to a crash (see Fig. 19 in our paper). Nonetheless, we should catch these singularities better so that there's no segfault. I'll try to replicate your error on my side to fix it.

from gpytoolbox.

sgsellan avatar sgsellan commented on June 3, 2024

Hi Nissmar!

I spent a little bit longer debugging this and tracked down the issue. Indeed, because our method is not intended to work if the input mesh and sdf genus don't agree, singularities were being caused; nonetheless, we should catch these singularities inside our code and return your last converged result so that the method fails gracefully. It should never segfault. There was an issue with how we stitched together the active and inactive mesh after each flow iteration that caused this segfault in extreme cases. It is fixed in #101 now.

If you install gpytoolbox from that PR branch and run the updated algorithm (I don't have access to your 53159.obj, so I use the stl file linked here) by doing

V,F = gpy.read_mesh("test/unit_tests_data/53159.stl")
# is mesh normalized? print corners
# print(np.min(V, axis=0))
# print(np.max(V, axis=0))
V = gpy.normalize_points(V)
 j = 32
sdf = lambda x: gpy.signed_distance(x, V, F)[0]
gx, gy, gz = np.meshgrid(np.linspace(-1.0, 1.0, j+1), np.linspace(-1.0, 1.0, j+1), np.linspace(-1.0, 1.0, j+1))
U = np.vstack((gx.flatten(), gy.flatten(), gz.flatten())).T
V0, F0 = gpy.icosphere(2)
Vr,Fr = gpy.reach_for_the_spheres(U, sdf, V0, F0, min_h = .01, verbose = False)

the algorithm encounters a singularity, but now catches it inside the python code and returns the following ugly-yet-intended mesh:
Screenshot 2023-11-06 at 8 55 23 AM

You can even see the singularity forming like a little black hole in the top left :) intuitively, that is the method "trying" to get the topology change without succeeding.

Let me know if you have any more questions! Best of luck in your pursuit of the spheres.

  • Silvia

from gpytoolbox.

nissmar avatar nissmar commented on June 3, 2024

Hi Silvia! Thank you very much for your reply and fixing that segmentation fault, I'm sure it will be useful for other people as well! Thank you also for the insights on your great method :)

from gpytoolbox.

Related Issues (19)

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.