Comments (7)
yes the problem is inside the c++, also confirmed by the issue you mentioned.
regarding the -1, got it, makes sense but is it not a fix.
I tried to push Alec to fix the issue, but it seems stuck :(
The fix suggested in the other issue is FI(i) = FImax;
you can do that in python, just set
face_ids[face_ids >= len(faces)] = len(faces)-1
or something similar.
I don't think this is the correct fix, but it is a reasonable walk around.
from libigl-python-bindings.
could you share the mesh?
from libigl-python-bindings.
No problem, here it is
from libigl-python-bindings.
hmhmh it seems to be a windows problem?
I tried your code/mesh and no error.
If the problem is in the C++ version, it needs to be fixed there.
from libigl-python-bindings.
Unfortunately, I'm not sure how to check either of your thoughts, whether it's a windows-specific problem, or it's in c++ version. These questions needs someone with a better understanding of libigl-python-bindings that mine. I'd be happy to provide any extra info upon request though.
I did an additional check if shifting all the output face ids by one could be a workaround, but no, the generator does produce faces with id = 0:
Code
import igl
verts, faces = igl.read_triangle_mesh('D:/Data/mesh.obj')
num_samples = 1000
print(len(faces))
for i in range(100):
_, face_ids = igl.random_points_on_mesh(num_samples, verts, faces)
for fid in face_ids:
if not ((fid-1) < len(faces) and (fid-1) >= 0):
print('Failed try {} with face {}'.format(i, fid))
Output:
14886
Failed try 18 with face 0
Failed try 44 with face 0
Failed try 45 with face 0
Failed try 93 with face 0
Failed try 94 with face 0
Failed try 98 with face 0
from libigl-python-bindings.
I think it is a bug in libigl.
Btw, why are you doing fid-1
?
Shouldn't be just fid
?
from libigl-python-bindings.
@teseoch do you mean c++ version libigl? Were you able to reproduce then?
Regarding fid-1
, that was an extra check if the whole range of produced face ids was shifted by one. Say, instead of giving face ids in the correct range of [ 0, len(faces) )
it gives faces in range [ 1, len(faces)+1 )
. If that was the case, doing fid-1
will give a workaround
The check confirmed that igl.random_points_on_mesh()
produces faces ids in range [ 0, len(faces)+1 )
, so doing fid-1
won't help
from libigl-python-bindings.
Related Issues (20)
- Dual Contouring HOT 1
- AttributeError: type object 'DataImage' has no attribute '_instance_inits' HOT 1
- igl::writeMESH and igl::writeMSH
- Fast winding number terminates with some meshes / segfaults HOT 1
- Binding for Python27 HOT 2
- Errors result to use igl::harmonic HOT 3
- Computing adjacency matrix fails using the bindings, works fine in C++ HOT 2
- support for collapse_edge and other libigl methods
- Implementation for NRosy HOT 1
- Error: Numerical issue with ARAP HOT 6
- Using ARAP to flatten a 3D textured mesh into 2D?
- Consistent ordering between unique_edge_map and cotmatrix_entries
- "Error: Numerical Issue" on ARAP HOT 3
- remove_duplicates HOT 1
- Incorrect isolines output (Python version differs from C++) HOT 1
- Add the binding for getting all of the boundary loops
- `average_onto_vertices` only accepts 3-dim input HOT 2
- Compute a cross field on mesh based on a few brush strokes
- How to use igl.cut_mesh(v: array, f: array, cuts: array) HOT 1
- Getting an error trying to build python
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 libigl-python-bindings.