Comments (7)
I have the exact same problem since last night! Have to learn some Cython but still, this error seems to be in the assert
lines you quoted.
Since this library is updated three months ago and we both seem to be running into trouble since last night, maybe it's some changes in the Cython library. It could be a cdef int
is no longer a Python int
. I'm not sure why we need these lines either, though.
from triangle.
These assertions just make sure that assumptions about the number of dimensions of arrays in the C library and the python wrapper are actually correct. Do you think you can provide the contents of the P
and S
variables in the call
triangle.triangulate({'vertices': P[:,:2], 'segments': S}, "p")
which results in the assertion failure? Or I can extract them from the example you have given once I get back to my desk a little later.
from triangle.
These assertions just make sure that assumptions about the number of dimensions of arrays in the C library and the python wrapper are actually correct. Do you think you can provide the contents of the
P
andS
variables in the call
triangle.triangulate({'vertices': P[:,:2], 'segments': S}, "p")
which results in the assertion failure? Or I can extract them from the example you have given once I get back to my desk a little later.
Thanks for the prompted reply. If it helps, this is the data I used as inputs to the triangulate
function which lead to the exact same error. Is it because my data points are 3D instead of 2D?
Code:
poly = {'vertices': np.array(newpolypoints), 'segments': np.array(segments)}
print(poly)
# print poly
# -- Triangulate
t = triangle.triangulate(poly, "p")
Output:
{'vertices': array([[ 9.24246154, -2.02496154, -8.79692308],
[ 6.71146154, -4.45896154, -8.79692308],
[ 2.78446154, -8.23696154, -8.79692308],
[ 1.91946154, -9.06896154, -8.79692308],
[-11.00953846, 4.26003846, -8.79692308],
[ -3.68553846, 11.30403846, -8.79692308]]), 'segments': array([[0, 1],
[1, 2],
[2, 3],
[3, 4],
[4, 5],
[5, 0]])}
Traceback (most recent call last):
File "triangulation.py", line 201, in <module>
main()
File "triangulation.py", line 195, in main
res = my_triangulation(face_with_points[0])
File "triangulation.py", line 146, in my_triangulation
t = triangle.triangulate(poly, "p")
AttributeError: module 'triangle' has no attribute 'triangulate'
from triangle.
I revised my code and when inputs are 2D arrays the assertionError
no longer occurred. Thanks for the help! It could be a coincidence that @rougier and I have the exact same error at roughly the same time... I'm not sure about her/his exact issue though.
from triangle.
@yuqli
Yes, vertices need to be a 2D array containing the x, y coordinates of each vertex.
from triangle.
@rougier I think this pull request for glumpy should fix the issue with the assertion error.
glumpy/glumpy#216
from triangle.
@drufat Oh nice, many thanks.
from triangle.
Related Issues (20)
- Can not build on arch linux HOT 1
- Theory-of-seismic-waves-II/02_Mesh_generation/4_Tri_mesh_delaunay_yigma_tepe.ipynb HOT 1
- changelog? HOT 2
- distribution of whl?
- Single precision mode HOT 3
- How to use the 'regions' argument in the 'triangulate()' function? HOT 5
- Add edges output HOT 2
- I can not for the life of me install triangle HOT 7
- Can't get edge list from triangulation HOT 1
- Project as a whole doesn't appear to be able to be licensed as LGPL-3 HOT 2
- Max triangles index exceeds number of vertices HOT 3
- Issue with License / conda forge submission HOT 1
- Wheels for Python 3.9 / 3.10 on PyPI HOT 7
- triangle/core.c:19390:5: error: lvalue required as increment operand HOT 1
- i cannot establish a restrictive triangulation network HOT 2
- "a" option for maximum area ignored if smaller than 0.00001 HOT 1
- i can't install triangle in mac M1 HOT 2
- pip install fails with python 3.10 HOT 1
- Build wheel for Python 3.10 and Apple M1 HOT 5
- Pip install of latest version fails for intel mac with python 3.9 HOT 2
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 triangle.