Comments (5)
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.
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.
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.
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:
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.
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)
- Default values for `Ft` and `Fn` if `UV` and `N` are provided HOT 2
- Marching squares crashes if all SDF values are positive or all values are negative.
- libigl removed function mat_max
- error in poisson surface reconstruction edge case HOT 1
- Resolution parameters switched in documentation for torus function HOT 1
- NaNs in the double areas
- png2poly rotates shape
- remesh_botsch does not work for non-closed meshes HOT 11
- `signed_distance_polygon` returns nans if first polyline point is repeated
- GMPlib certificate expiration
- FEM for 3D Tet mesh HOT 8
- Empty OBJ import, STL of the same file works fine HOT 8
- All vertices are detected as boundary vertices HOT 5
- "ImportError: Gpytoolbox cannot import its C++ binding" when using gpytoolbox.copyleft.lazy_cage on Windows HOT 4
- 2D Swept Volume/Area Computation HOT 1
- pip install gpytoolbox==0.1.0 gpytoolbox_bindings_copyleft HOT 2
- Marching Square gives zigzag lines HOT 1
- PLY file not read correctly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpytoolbox.