Giter VIP home page Giter VIP logo

triangle's People

Contributors

addam avatar aldanial avatar bong0 avatar celil-zz avatar cgohlke avatar drufat avatar gonzalocasas avatar icemtel avatar mdarnold1 avatar mikedh avatar mwtoews avatar mzucker avatar pdebuyl avatar polarnick239 avatar stefsmeets avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

triangle's Issues

Triangle won't compile.. "error: triangle/core.c: No such file or directory"

Hi there,

I just downloaded the git repository and tried to install it. However I am experiencing the following problem. Any suggestions?

federico@zfractal:/Downloads/triangle$ pwd
/home/federico/Downloads/triangle
federico@zfractal:
/Downloads/triangle$ ls
build c CHEATSHEET doc MANIFEST.in README.rst release.sh setup.py triangle triangle.egg-info upload_docs.sh
federico@zfractal:~/Downloads/triangle$ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to triangle.egg-info/requires.txt
writing triangle.egg-info/PKG-INFO
writing top-level names to triangle.egg-info/top_level.txt
writing dependency_links to triangle.egg-info/dependency_links.txt
reading manifest file 'triangle.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'triangle.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
pyrexc triangle/core.pyx --> triangle/core.c
/home/federico/Downloads/triangle/triangle/core.pyx:5:35: Expected an identifier or literal
building 'triangle.core' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DVOID=int -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -I/usr/include/python2.7 -c c/triangle.c -o build/temp.linux-x86_64-2.7/c/triangle.o
c/triangle.c:3267:6: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
void internalerror()
^
c/triangle.c:4886:6: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
void exactinit()
^
c/triangle.c: In function ‘segmentintersection’:
c/triangle.c:11707:28: warning: variable ‘collinear’ set but not used [-Wunused-but-set-variable]
enum finddirectionresult collinear;
^
c/triangle.c: In function ‘tallyencs’:
c/triangle.c:13184:7: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
int dummy;
^
c/triangle.c: At top level:
c/triangle.c:13206:6: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
void precisionerror()
^
c/triangle.c: In function ‘splitencsegs’:
c/triangle.c:13257:7: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
int dummy;
^
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DVOID=int -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -I/usr/include/python2.7 -c triangle/core.c -o build/temp.linux-x86_64-2.7/triangle/core.o
x86_64-linux-gnu-gcc: error: triangle/core.c: No such file or directory
x86_64-linux-gnu-gcc: fatal error: no input files
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 4

0xC0000005 error

When I only run the triangle once, there is no problem, and when I run it multiple times, a random error occurs.

This is my code and data, can you please help me see what the problem is?

path1 = r"D:\pdata.txt"
path2 = r"D:\index.txt"
import numpy as np
from triangle import triangulate
with open(path1, "r") as f1:
data1 = f1.readlines()
data2 = []
for i in range(len(data1)):
mid = data1[i].strip("\n").split(",")
data2.append([float(mid[0]), float(mid[1]), float(mid[2])])

with open(path2, "r") as f2:
data3 = f2.readlines()
data4 = []
for i in range(len(data3)):
mid = data3[i].strip("\n").split(",")
data4.append([int(mid[0]), int(mid[1])])

A = dict(vertices=np.delete(data2, 2, axis=1), segments=data4)
final_data = []
for i in range(10):
final_data.append(triangulate(A, "p"))

index.txt
pdata.txt

Segments do not work?

following code should produce a triangulation with enforced segments:

import triangle
import triangle.plot
from numpy import *
import matplotlib.pyplot as plt

pts = array(((0,0), (1,0), (1, 1), (0, 1)))
segs2 = array([[0,2],[1,2],[0,1]])
dic = {'vertices':pts, 'segments':segs2}

B = triangle.triangulate(dic)
triangle.plot.compare(plt, dic, B)
plt.show()

The enforced segments are shown correctly in the plot. However, they are not considered in the triangulation. This seems to be a bug? It woult be cool, to have this problem fixed.

Btw, why does this triangle-wrapper not support 3D points? Triangle supports 3D points and is a nice tool for interpolating 3D data.

crashes python when using buggy geometry with 'p' flag

I've found that buggy geometry processed with the 'p' flag will crash Python. I've tested on two systems, both Mac.

This reproduces the behaviour for me. Note the repeated vertex at index 4:


from triangle import triangulate
geom = {
    'segments': [
        [0, 1],
        [1, 2],
        [2, 3],
        [3, 4],
        [4, 0]
    ],
    'vertices': [
        [5, -5],
        [5, 0],
        [0, 0],
        [0, -2],
        [0, -2]
    ]
}
poly_triangulation = triangulate(geom, opts='p')

Would be nice if there were a way to throw an exception prior to Python itself crashing.

Requesting a new version release

The last version on pypi (2013.04.05) lacks Python 3 support implemented in master in 2014.
Can you release a new version to simplify library installation on Python 3?

Crashes python when using the '-c' flag

I used triangle to make a triangulation of a rectangle (here, a square), using just the four corner points:

## make boundary of sheet
xyRectangle = np.array(((-1,-1), (-1,1), (1,1), (1,-1)))

## make triangulation
xy0 = xyRectangle 
A = dict(vertices=xy0)
B = tr.triangulate(A, 'qa0.0003')
tr.compare(plt, A, B)
plt.show()

When I use only the q or a flags, it runs perfectly. However, when I try calculating the convex hull as well, using the c flag, it just crashes my Jupyter notebook kernel.

Is there some bug somewhere, or am I not using the flag correctly?

i cannot establish a restrictive triangulation network

how can I modify my code to make it work,Here's the code:
import matplotlib.pyplot as plt
import numpy as np

import triangle as tr

def circle(N, R):
i = np.arange(N)
theta = i * 2 * np.pi / N
pts = np.stack([np.cos(theta), np.sin(theta)], axis=1) * R
seg = np.stack([i, i + 1], axis=1) % N
return pts, seg

pts0, seg0 = circle(30, 1.4)
pts1, seg1 = circle(16, 1.2)
pts2, seg2 = circle(17, 1)
pts = np.vstack([pts0, pts1, pts2])
seg = np.vstack([seg0, seg1 + seg0.shape[0]])

A = dict(vertices=pts, segments=seg1 + seg0.shape[0])
B = tr.triangulate(A)
tr.compare(plt, A, B)
plt.show()

pip install fails with python 3.10

Hi,

pip install triangle fails with python 3.10.

Setup: fresh conda-arm64 environment with python 3.10 on Macbook Pro (M1 Pro chip). Installation works with python 3.9 and otherwise identical conditions, making me suspect that it is a general incompatibility with python 3.10.

Let me know if you need the log, but the error should be easy enough to reproduce.

Crashing in Windows with Python 3.5 and 3.6

Tried to install via pip, easy_install, and using the binaries on the gohlke page with py35 and py36 (Anaconda3). In all cases, compiling/install goes fine, I can import triangle in python but then get a crash with any call to a function (for example convexhull on the example). Event logger reports an access violation from the core.xx.pyd library.
If I install with py27, works fine.
Is this another VC version problem?

Max triangles index exceeds number of vertices

For some sets of vertices and segments, some of the triangle indices exceed the maximum allowed vertex index.

For instance:

import numpy as np
import triangle as tr

bug_arr = np.array(
[[ 0.        ,  0.        ],
 [-0.01054464, -0.11041172],
 [-0.02108927, -0.22082344],
 [-0.03163391, -0.33123515],
 [-0.04217855, -0.44164687],
 [-0.4585519 ,  0.0420809 ],
 [ 0.46661427, -0.04458542],
 [-0.47125578, -0.06724769],
 [ 0.4555808 , -0.15512749],
 [-0.48395965, -0.17657628],
 [ 0.44454733, -0.26566956],
 [-0.05272318, -0.55205859],
 [-0.49666353, -0.28590488],
 [ 0.43351386, -0.37621163],
 [-0.50936741, -0.39523347],
 [ 0.42248039, -0.48675369],
 [-0.06326782, -0.66247031],
 [ 0.41144692, -0.59729576],
 [-0.52207129, -0.50456206],
 [-0.07381246, -0.77288203],
 [ 0.40041345, -0.70783783],
 [-0.53477517, -0.61389065],
 [-0.08435709, -0.88329374],
 [ 0.38937998, -0.81837989],
 [-0.54747904, -0.72321925],
 [-0.8979827 ,  0.08051809],
 [-0.91538909, -0.02677838],
 [ 0.92957895, -0.090486  ],
 [ 0.91547002, -0.20022277],
 [-0.93279549, -0.13407485],
 [ 0.90136109, -0.30995954],
 [-0.95020188, -0.24137132]]
)

bug_segments = np.array(
[[ 8,  1],
 [26, 25],
 [13,  3],
 [ 2,  9],
 [ 5, 25],
 [10,  8],
 [ 1,  5],
 [ 3,  9],
 [ 7,  5],
 [ 6,  0],
 [13, 10],
 [10,  1],
 [ 1,  7],
 [ 2,  1],
 [ 9,  7],
 [ 7, 25],
 [ 6,  5],
 [10,  2],
 [ 0,  5],
 [ 8,  0],
 [ 7, 26],
 [13,  2],
 [ 1,  0],
 [ 3,  2],
 [ 2,  7],
 [ 9, 26]],
dtype=int)

delaunay = tr.triangulate({"vertices":bug_arr, "segments":bug_segments}, "pc")
tri = delaunay["triangles"]

print("Max triangles index {:d} exceeds number of vertices {:d}.".format(np.max(tri.ravel()), bug_arr.shape[0]))

prints "Max triangles index 33 exceeds number of vertices 32." Modifying delaunay["triangles"]
according to delaunay["triangles"] = delaunay["triangles"] % bug_arr.shape[0] appears to solve
this issue. Don't know whether this is an issue with this wrapper or the library itself.

Wheels for Python 3.9 / 3.10 on PyPI

Thanks for this great library! I'm trying to migrate my code to use Python 3.9, but wheels on pypi are available up to and including Python 3.8.

Would it be possible to upload wheels for python 3.9 and 3.10?

Can not build on arch linux

Build fails on arch linux with this error.
gcc version 8.2.1

building 'triangle.core' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/c
    creating build/temp.linux-x86_64-2.7/triangle
    gcc -pthread -B /meta/anaconda3/envs/signal2/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DVOID=void -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -I/meta/anaconda3/envs/signal2/include/python2.7 -c c/triangle.c -o build/temp.linux-x86_64-2.7/c/triangle.o
    c/triangle.c:3274:6: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
     void internalerror()
          ^~~~~~~~~~~~~
    c/triangle.c:4893:6: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
     void exactinit()
          ^~~~~~~~~
    c/triangle.c:13216:6: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
     void precisionerror()

how to produce .node file?

Hi, i use the file .poly to divide into triangles, but i don't know how to produce .node file, can anybody tell me how to do it? thanks very much.

Error when running *voronoi*

Windows 10, Python 3.6.4, numpy 1.14.2
in __init__.py, in voronoi:
Two lines of code

    ray_origin = e[-fltr][:, 0]
    ray_direct = n[-fltr]

Result in error

TypeError: The numpy boolean negative, the -operator, is not supported, use the~operator or the logical_not function instead.
Fixed by changing - to ~:

    ray_origin = e[~fltr][:, 0]
    ray_direct = n[~fltr]

Will it work on other versions of numpy?

Assertion check error in `core.pyx`

I'm using triangle for the glumpy library (glumpy.github.io) and since last update (triangle), I get some consistent errors:

Traceback (most recent call last):
  File "collection-triangles.py", line 51, in <module>
    I = triangulate(P)
  File "collection-triangles.py", line 26, in triangulate
    T = triangle.triangulate({'vertices': P[:,:2], 'segments': S}, "p")
  File "/usr/local/lib/python3.7/site-packages/triangle/tri.py", line 66, in triangulate
    tri, _ = triang(tri, opts)
  File "triangle/core.pyx", line 247, in triangle.core.triang
  File "triangle/core.pyx", line 219, in triangle.core.fin
  File "triangle/core.pyx", line 74, in triangle.core.ii._set
  File "triangle/core.pyx", line 115, in triangle.core._wrap.check
AssertionError

When I looked at your code, I've to admit I'm a bit puzzled by these lines:

cdef _wrap(triangulateio* c):

    cdef int _1 = 1
    cdef int _2 = 2
    cdef int _3 = 3
    cdef int _4 = 4

    def check():
        assert _1 == 1
        assert _2 == 2
        assert _3 == 3
        assert _4 == 4

Obviously in my case these assertions are False but I'm not sure to understand how this can be. Any advices on how to debug ?

In glumpy, I'm using the tiger.py to test.

Seemingly reasonable inputs result in core dump!

Hey, this might be a triangle library bug, but since my code is in python I figured I'd try here first!

This is against triangle == 2013.04.05 as downloaded by pip.

Segfault occurs on Ubuntu 14.04 and OSX 10.10.

To repro:

import triangle

triangle_input = {
    'segments': [
        [0, 1],
        [1, 2],
        [2, 3],
        [3, 4],
        [4, 5],
        [5, 6],
        [6, 7],
        [7, 8],
        [8, 9],
        [9, 10],
        [10, 11],
        [11, 12],
        [12, 0]
    ],
    'holes': [
        [2.194746831368343, 0.22198663923314035]
    ],
    'vertices': [
        [2.1948854485272875, 0.2233940429716767],
        [2.210334747734508, 0.2045690176995104],
        [2.23101526067872, 0.19170904853717624],
        [2.2547319630849922, 0.18617908927292653],
        [2.2789675703171275, 0.18856608834740984],
        [2.301149721315429, 0.1986166902985606],
        [2.3189240083317504, 0.21526412684456825],
        [2.3304038731566465, 0.23674144339235967],
        [2.334370845917945, 0.2607690431393805],
        [2.333798685834391, 0.27],
        [2.1854430073431304, 0.27],
        [2.184870847259575, 0.26076904313938054],
        [2.1874178917967892, 0.24142231941101294]
    ]
}

triangle_result = triangle.triangulate(triangle_input, 'p')

Notes:

  • The last segment is not drawn below (so you can see where the curve starts).
  • The winding of the polygon is counter-clockwise.
  • The hole (shown in red) is outside the enclosed area by a fairly large amount (~0.002)
  • This configuration works for thousands of other inputs (and produces correct results!)

screenshot 2015-03-03 17 40 24

Any thoughts on what might be happening?

"a" option for maximum area ignored if smaller than 0.00001

When I try to triangulated meshes really finely (a < 0.00001), the a option seems to be ignored. Is this behaviour intended? I haven't found it documented anywhere.

I believe I could work around this by simply scaling up my mesh. However if the 0.00001 is simply a hard-coded limit, it might be nice if it could be made a bit smaller.

I can not for the life of me install triangle

I am actually trying to install glumpy, which depends on triangle. Both cannot be installed either via pip or source install, and because both spit out the same error, I am now here. I am using Windows 10, installing in an Anaconda env with Python 3.7. The error I get after cloning the repo, doing

cd triangle
python setup.py install

is

E:\-----\VisualStudio\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DVOID=void -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -IE:\*****\Anaconda3\include -IE:\*****\Anaconda3\include -IE:\-----\VisualStudio\VC\Tools\MSVC\14.15.26726\ATLMFC\include -IE:\-----\VisualStudio\VC\Tools\MSVC\14.15.26726\include "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tctriangle/core.c /Fobuild\temp.win-amd64-3.7\Release\triangle/core.obj
core.c
E:\-----\VisualStudio\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:E:\*****\Anaconda3\libs /LIBPATH:E:\*****\Anaconda3\PCbuild\amd64 /LIBPATH:E:\-----\VisualStudio\VC\Tools\MSVC\14.15.26726\ATLMFC\lib\x64 /LIBPATH:E:\-----\VisualStudio\VC\Tools\MSVC\14.15.26726\lib\x64 "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17134.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.17134.0\um\x64" /EXPORT:PyInit_core build\temp.win-amd64-3.7\Release\c/triangle.obj build\temp.win-amd64-3.7\Release\triangle/core.obj /OUT:build\lib.win-amd64-3.7\triangle\core.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\c\core.cp37-win_amd64.lib
LINK : fatal error LNK1104: cannot open file 'OLDNAMES.lib'
error: command 'E:\\-----\\VisualStudio\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\link.exe' failed with exit status 1104

I masked my filesystem structure with ----- and *****. Those should be valid paths.
I would be happy to give you more information, I just don't know what :)

holes in triangulation

Hey, thanks for this package- I'm looking in to switching from meshpy to this. I noticed that holes don't appear to be making it to triangle. If the holes are passed to the plotting helper function it creates a marker for the hole, but is triangulated over:

hole_example

Code to reproduce:

import triangle
import triangle.plot
import matplotlib.pyplot as plt

import numpy as np


if __name__ == '__main__':
    ### generate a circle with a hole in it                         
    theta = np.linspace(0.0, np.pi * 2, 25)
    circle = np.column_stack((np.cos(theta),
                              np.sin(theta)))

    # exterior plus interior                                        
    vertices = np.vstack((circle, circle * .5))
    segments = np.column_stack((np.arange(0, len(circle) - 1),
                                np.arange(1, len(circle))))
    # add the interior                                              
    segments = np.vstack((segments,
                          segments + len(circle)))

    # the hole is in the middle. like a doughnut                    
    holes = np.array([[0,0]], dtype=np.float64)

    # args to pass to triangulate                                   
    args = {'segments': segments,
            'vertices': vertices,
            'holes':    holes}
    B = triangle.triangulate(args)

    triangle.plot.compare(plt, args, B)
    plt.show()

Using the FTN95 C++ compiler

This issue might is related to #28. I have the same difficulties as mentioned in the ticket. I would be able to fix the issue if I can have some guidelines to use another compiler other than the Microsoft C++ compiler.

We use the Silverfrost C++ compiler and can compile the triangle.c source code. The resulting executable works perfectly fine and the basic idea is to combine it with this Python code.

Questions:

  1. Does the Python code requires an executable or a dll? If it requires an executable: what must be the name of the executable and in which directory?
  2. If it requires a dll: Where must I set the compiler options?

Issue with new way triangle.triangulate operates

First of all, thank you for this very useful package.
I was working with the 2017 release until now without problems and today tried on a new install that fetched the 2019 release.
I found out the hard way that triangle.triangulate has drastically changed the way in handles the input dict and it doesn't allow unexpected keys anymore.
I'm probably the only one, but I find it handy to be able to bundle additional data in the dict under extra keys.
The 2017 version didn't care because it had a preset list of keys in which it would go through and just ignore the other ones (but still return the final dict with the extra keys).
In the 2019, you iterate through all the keys in the dict and try to match all of them with the fwd translation and reverse translation. That breaks if the dict contains any unexpected key.
Would you mind changing this slightly so that extra keys can be passed through? I could do it and submit a PR if you want. It shouldn't be much more than a few lines, I think.
Obviously, the user can filter the dict before feeding to triangle but I think allowing pass-through of extra keys would make the package more flexible.
Let me know what you think.

triangles no longer returned

Hi, it looks like with the new release triangles are no longer returned:

Code that used to work (JSON of args in gist):

with open('arg.json', 'w') as f:
    arg = json.load(f)
from triangle import triangulate
result = triangulate(arg, 'pq30')
return result['vertices'], result['triangles']

If you embed and check returned keys, they are now missing 'triangles`:

In [9]: result.keys()
Out[9]: dict_keys(['vertices', 'vertex_markers', 'holes'])

Bug: Triangualte with 'a' and small values <10 ** -4

I don't think this will be fixed any time soon, the source of the problem is probably in C code. But I want to make others aware of this problem.
Using triangulate with parameter 'aX' (which sets a restriction on maximum triangle area) with X - a number <10**-4, the Triangle will fully ignore this argument, and maximum triangle area will be unrestricted.

This is quite unexpected, because this means that algorithm will already have problems with triangles of linear size 10**-3-10**-2, which is not that small.

import scipy as sp
import triangle

boundary_points = sp.array([[-1, -1], [1, -1], [1, 1], [-1, 1]])

max_areas = [10 ** -5, 9 * 10 ** -5, 10 ** -4, 1.1 * 10 ** - 4, 10 ** -2 ]

print('Max area   Num of triangles')
for max_area in max_areas:
    tri_data = {'vertices': boundary_points}
    code = 'a{0}'.format(max_area)
    tri = triangle.triangulate(tri_data, code)

    coords = tri['vertices']
    trias = tri['triangles']

    print('{:.2e}   '.format(max_area), len(trias))

For me this prints

Max area   Num of triangles
1.00e-05    4
9.00e-05    2
1.00e-04    62223
1.10e-04    56758
1.00e-02    628

I could reproduce this problem with circular geometry and for objects of different size, also with additional code 'q' the problem remains.

Warning during installation: comparison of integers of different signs: 'int'

I noticed these two warnings during installation. Is there any reason to be concerned about these?

gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/andrew/miniconda3/include -arch x86_64 -I/Users/andrew/miniconda3/include -arch x86_64 -DVOID=int -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -I/Users/andrew/miniconda3/include/python3.6m -c c/triangle.c -o build/temp.macosx-10.7-x86_64-3.6/c/triangle.o
c/triangle.c:3949:17: warning: comparison of integers of different signs: 'int'
      and 'unsigned long' [-Wsign-compare]
  if (alignment > sizeof(VOID *)) {
      ~~~~~~~~~ ^ ~~~~~~~~~~~~~~
c/triangle.c:4349:16: warning: comparison of integers of different signs: 'int'
      and 'unsigned long' [-Wsign-compare]
      (trisize < 6 * sizeof(triangle) + sizeof(int))) {
       ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.

Memory error on Python 2.7 / Windows 7.

Hi there,
I just tried reinstalling Triangle but was prompted with this error. Also, I have PGen installed but it seems to throw that error regardless.

Collecting triangle
  Using cached triangle-20170106.tar.gz
    Unable to find pgen, not compiling formal grammar.
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "c:\users\timber~1\appdata\local\temp\pip-build-ug0zae\triangle\setup.py", line 57, in <module>
        define_macros=define_macros)
      File "C:\Python27\lib\distutils\core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "build\bdist.win32\egg\setuptools\dist.py", line 265, in __init__
      File "build\bdist.win32\egg\setuptools\dist.py", line 310, in fetch_build_eggs
      File "build\bdist.win32\egg\pkg_resources\__init__.py", line 800, in resolve
      File "build\bdist.win32\egg\pkg_resources\__init__.py", line 1050, in best_match
      File "build\bdist.win32\egg\pkg_resources\__init__.py", line 1062, in obtain
      File "build\bdist.win32\egg\setuptools\dist.py", line 377, in fetch_build_egg
      File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 629, in easy_install
      File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 659, in install_item
      File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 844, in install_eggs
      File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 1072, in build_and_install
      File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 1058, in run_setup
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 240, in run_setup
      File "C:\Python27\lib\contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 193, in setup_context
      File "C:\Python27\lib\contextlib.py", line 35, in __exit__
        self.gen.throw(type, value, traceback)
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 152, in save_modules
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 126, in __exit__
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump
    MemoryError
    Complete output from command python setup.py egg_info:
    Unable to find pgen, not compiling formal grammar.

    Traceback (most recent call last):

      File "<string>", line 20, in <module>

      File "c:\users\timber~1\appdata\local\temp\pip-build-ug0zae\triangle\setup.py", line 57, in <module>

        define_macros=define_macros)

      File "C:\Python27\lib\distutils\core.py", line 111, in setup

        _setup_distribution = dist = klass(attrs)

      File "build\bdist.win32\egg\setuptools\dist.py", line 265, in __init__

      File "build\bdist.win32\egg\setuptools\dist.py", line 310, in fetch_build_eggs

      File "build\bdist.win32\egg\pkg_resources\__init__.py", line 800, in resolve

      File "build\bdist.win32\egg\pkg_resources\__init__.py", line 1050, in best_match

      File "build\bdist.win32\egg\pkg_resources\__init__.py", line 1062, in obtain

      File "build\bdist.win32\egg\setuptools\dist.py", line 377, in fetch_build_egg

      File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 629, in easy_install

      File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 659, in install_item

      File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 844, in install_eggs

      File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 1072, in build_and_install

      File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 1058, in run_setup

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 240, in run_setup

      File "C:\Python27\lib\contextlib.py", line 35, in __exit__

        self.gen.throw(type, value, traceback)

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 193, in setup_context

      File "C:\Python27\lib\contextlib.py", line 35, in __exit__

        self.gen.throw(type, value, traceback)

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 152, in save_modules

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 126, in __exit__

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

      File "build\bdist.win32\egg\setuptools\sandbox.py", line 110, in dump

    MemoryError

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in c:\users\timber~1\appdata\local\temp\pip-build-ug0zae\triangle

i can't install triangle in mac M1

pip install triangle
Collecting triangle
    Using cached triangle-20200424.tar.gz (1.6 MB)
    Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from triangle) (1.22.3)
Building wheels for collected packages: triangle
    Building wheel for triangle (setup.py) ... error
    error: subprocess-exited-with-error

    × python setup.py bdist_wheel did not run successfully.
    │ exit code: 1
    ╰─> [300 lines of output]
            running bdist_wheel
            running build
            running build_py
            creating build
            creating build/lib.macosx-10.9-universal2-3.10
            creating build/lib.macosx-10.9-universal2-3.10/triangle
            copying triangle/plot.py -> build/lib.macosx-10.9-universal2-3.10/triangle
            copying triangle/version.py -> build/lib.macosx-10.9-universal2-3.10/triangle
            copying triangle/init.py -> build/lib.macosx-10.9-universal2-3.10/triangle
            copying triangle/tri.py -> build/lib.macosx-10.9-universal2-3.10/triangle
            copying triangle/core1_run.py -> build/lib.macosx-10.9-universal2-3.10/triangle
            copying triangle/data.py -> build/lib.macosx-10.9-universal2-3.10/triangle
            creating build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/dots.1.v.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.r.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/bbox.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/face.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/greenland.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex3.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/diamond_02_00009.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.q.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/diamond_02_00009.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.2.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/dots.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.4.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/square_circle_hole.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.2.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/diamond_02_00009.1.v.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.3.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/A.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/ell.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex3.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/la.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.2.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.2.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/square_circle_hole.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/greenland.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.q.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/face.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex3.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.r.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/ell.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/A.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.2.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.2.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.3.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/la.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/diamond_02_00009.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.4.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/bbox.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/face.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/square_circle_hole.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/A.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex3.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/la.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.4.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.2.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.2.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.2.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/la.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/A.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/face.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.3.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex3.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/bbox.1.area -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/diamond_02_00009.1.v.edge -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/dots.1.v.edge -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            running build_ext
            building 'triangle.core' extension
            creating build/temp.macosx-10.9-universal2-3.10
            creating build/temp.macosx-10.9-universal2-3.10/c
            creating build/temp.macosx-10.9-universal2-3.10/triangle
            clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -DVOID=void -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c c/triangle.c -o build/temp.macosx-10.9-universal2-3.10/c/triangle.o
            c/triangle.c:3956:17: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (alignment > sizeof(VOID *)) {
                        ~~~~~~~~~ ^ ~~~~~~~~~~~~~~
            c/triangle.c:4356:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                        (trisize < 6 * sizeof(triangle) + sizeof(int))) {
                          ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            2 warnings generated.
            c/triangle.c:3956:17: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (alignment > sizeof(VOID *)) {
                        ~~~~~~~~~ ^ ~~~~~~~~~~~~~~
            c/triangle.c:4356:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                        (trisize < 6 * sizeof(triangle) + sizeof(int))) {
                          ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            2 warnings generated.
            clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -DVOID=void -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c triangle/core.c -o build/temp.macosx-10.9-universal2-3.10/triangle/core.o
            triangle/core.c:19390:5: error: expression is not assignable
                    ++Py_REFCNT(o);
                    ^ ~~~~~~~~~~~~
            triangle/core.c:19392:5: error: expression is not assignable
                    --Py_REFCNT(o);
                    ^ ~~~~~~~~~~~~
            triangle/core.c:19701:5: error: expression is not assignable
                    ++Py_REFCNT(o);
                    ^ ~~~~~~~~~~~~
            triangle/core.c:19703:5: error: expression is not assignable
                    --Py_REFCNT(o);
                    ^ ~~~~~~~~~~~~
            triangle/core.c:19951:5: error: expression is not assignable
                    ++Py_REFCNT(o);
                    ^ ~~~~~~~~~~~~
            triangle/core.c:19953:5: error: expression is not assignable
                    --Py_REFCNT(o);
                    ^ ~~~~~~~~~~~~
            triangle/core.c:22901:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                    (PyUnicode_GET_SIZE(*name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
                        PyUnicode_WSTR_LENGTH(op) :                                       
                        ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22901:22: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                                                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
                        ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),
                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22901:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                    (PyUnicode_GET_SIZE(*name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
                          PyUnicode_WSTR_LENGTH(op)))
                          ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22901:52: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                    (PyUnicode_GET_SIZE(*name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                                                                                  ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
                        PyUnicode_WSTR_LENGTH(op) :                                       
                        ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22901:52: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                                                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                                                                                  ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
                        ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),
                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22901:52: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                    (PyUnicode_GET_SIZE(*name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                                                                                  ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
                          PyUnicode_WSTR_LENGTH(op)))
                          ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22917:26: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                            (PyUnicode_GET_SIZE(*argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                              ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
                        PyUnicode_WSTR_LENGTH(op) :                                       
                        ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22917:26: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                                                            (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                              ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
                        ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),
                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22917:26: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                            (PyUnicode_GET_SIZE(*argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                              ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
                          PyUnicode_WSTR_LENGTH(op)))
                          ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22917:59: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                            (PyUnicode_GET_SIZE(*argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
                        PyUnicode_WSTR_LENGTH(op) :                                       
                        ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22917:59: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                                                            (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
                        ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),
                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22917:59: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                            (PyUnicode_GET_SIZE(argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
                          PyUnicode_WSTR_LENGTH(op)))
                          ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:23497:16: warning: 'PyUnicode_FromUnicode' is deprecated [-Wdeprecated-declarations]
                            return PyUnicode_FromUnicode(NULL, 0);
                                          ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject
) PyUnicode_FromUnicode(
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            13 warnings and 6 errors generated.
            error: command '/usr/bin/clang' failed with exit code 1
            [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for triangle
    Running setup.py clean for triangle
Failed to build triangle
Installing collected packages: triangle
    Running setup.py install for triangle ... error
    error: subprocess-exited-with-error

    × Running setup.py install for triangle did not run successfully.
    │ exit code: 1
    ╰─> [300 lines of output]
            running install
            running build
            running build_py
            creating build
            creating build/lib.macosx-10.9-universal2-3.10
            creating build/lib.macosx-10.9-universal2-3.10/triangle
            copying triangle/plot.py -> build/lib.macosx-10.9-universal2-3.10/triangle
            copying triangle/version.py -> build/lib.macosx-10.9-universal2-3.10/triangle
            copying triangle/init.py -> build/lib.macosx-10.9-universal2-3.10/triangle
            copying triangle/tri.py -> build/lib.macosx-10.9-universal2-3.10/triangle
            copying triangle/core1_run.py -> build/lib.macosx-10.9-universal2-3.10/triangle
            copying triangle/data.py -> build/lib.macosx-10.9-universal2-3.10/triangle
            creating build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/dots.1.v.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.r.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/bbox.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/face.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/greenland.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex3.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/diamond_02_00009.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.q.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/diamond_02_00009.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.2.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/dots.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.4.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/square_circle_hole.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.2.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/diamond_02_00009.1.v.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.3.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/A.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/ell.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex3.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/la.1.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.2.node -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.2.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/square_circle_hole.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/greenland.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.q.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/face.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex3.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/spiral.r.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/ell.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/A.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.2.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.2.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.3.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/la.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/diamond_02_00009.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.4.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/bbox.1.ele -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/face.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/square_circle_hole.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/A.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex3.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/la.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.4.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex2.2.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.2.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.2.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/la.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/A.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/face.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/box.3.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/double_hex3.1.poly -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/bbox.1.area -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/diamond_02_00009.1.v.edge -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            copying triangle/data/dots.1.v.edge -> build/lib.macosx-10.9-universal2-3.10/triangle/data
            running build_ext
            building 'triangle.core' extension
            creating build/temp.macosx-10.9-universal2-3.10
            creating build/temp.macosx-10.9-universal2-3.10/c
            creating build/temp.macosx-10.9-universal2-3.10/triangle
            clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -DVOID=void -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c c/triangle.c -o build/temp.macosx-10.9-universal2-3.10/c/triangle.o
            c/triangle.c:3956:17: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (alignment > sizeof(VOID *)) {
                        ~~~~~~~~~ ^ ~~~~~~~~~~~~~~
            c/triangle.c:4356:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                        (trisize < 6 * sizeof(triangle) + sizeof(int))) {
                          ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            2 warnings generated.
            c/triangle.c:3956:17: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (alignment > sizeof(VOID *)) {
                        ~~~~~~~~~ ^ ~~~~~~~~~~~~~~
            c/triangle.c:4356:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                        (trisize < 6 * sizeof(triangle) + sizeof(int))) {
                          ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            2 warnings generated.
            clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -DVOID=void -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c triangle/core.c -o build/temp.macosx-10.9-universal2-3.10/triangle/core.o
            triangle/core.c:19390:5: error: expression is not assignable
                    ++Py_REFCNT(o);
                    ^ ~~~~~~~~~~~~
            triangle/core.c:19392:5: error: expression is not assignable
                    --Py_REFCNT(o);
                    ^ ~~~~~~~~~~~~
            triangle/core.c:19701:5: error: expression is not assignable
                    ++Py_REFCNT(o);
                    ^ ~~~~~~~~~~~~
            triangle/core.c:19703:5: error: expression is not assignable
                    --Py_REFCNT(o);
                    ^ ~~~~~~~~~~~~
            triangle/core.c:19951:5: error: expression is not assignable
                    ++Py_REFCNT(o);
                    ^ ~~~~~~~~~~~~
            triangle/core.c:19953:5: error: expression is not assignable
                    --Py_REFCNT(o);
                    ^ ~~~~~~~~~~~~
            triangle/core.c:22901:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                    (PyUnicode_GET_SIZE(*name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
                        PyUnicode_WSTR_LENGTH(op) :                                       
                        ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22901:22: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                                                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
                        ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),
                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22901:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                    (PyUnicode_GET_SIZE(*name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
                          PyUnicode_WSTR_LENGTH(op)))
                          ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22901:52: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                    (PyUnicode_GET_SIZE(*name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                                                                                  ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
                        PyUnicode_WSTR_LENGTH(op) :                                       
                        ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22901:52: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                                                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                                                                                  ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
                        ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),
                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22901:52: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                    (PyUnicode_GET_SIZE(*name) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                                                                                  ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
                          PyUnicode_WSTR_LENGTH(op)))
                          ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22917:26: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                            (PyUnicode_GET_SIZE(*argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                              ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
                        PyUnicode_WSTR_LENGTH(op) :                                       
                        ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22917:26: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                                                            (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                              ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
                        ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),
                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22917:26: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                            (PyUnicode_GET_SIZE(*argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                              ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
                          PyUnicode_WSTR_LENGTH(op)))
                          ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22917:59: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                            (PyUnicode_GET_SIZE(*argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
                        PyUnicode_WSTR_LENGTH(op) :                                       
                        ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22917:59: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                                                            (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
                        ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),
                                      ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:22917:59: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                                                            (PyUnicode_GET_SIZE(argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                                                                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
                          PyUnicode_WSTR_LENGTH(op)))
                          ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
            #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject
)op)
                                                                                ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3)
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            triangle/core.c:23497:16: warning: 'PyUnicode_FromUnicode' is deprecated [-Wdeprecated-declarations]
                            return PyUnicode_FromUnicode(NULL, 0);
                                          ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:551:1: note: 'PyUnicode_FromUnicode' has been explicitly marked deprecated here
            Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject
) PyUnicode_FromUnicode(
            ^
            /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
            #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
                                                                                                                      ^
            13 warnings and 6 errors generated.
            error: command '/usr/bin/clang' failed with exit code 1
            [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> triangle

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

while trying to install the last version
ERROR: Could not find a version that satisfies the requirement triangle==20220202 (from versions: 2013.01.06.linux-x86_64, 0.1, 0.2, 0.3, 2012.7.4, 2013.1.6a0, 2013.1.6, 2
013.1.7, 2013.4.5, 2015.3.28, 2015.12.13, 2015.12.14, 20160202, 20160203, 20170106, 20170429, 20190115, 20190115.1, 20190115.2, 20190115.3, 20200325, 20200404, 20200424)
ERROR: No matching distribution found for triangle==20220202

changelog?

thanks for this nice library. is there a list of changes for each version? im still pinning on 20170429 and would like to know what changed. particularly interested in possible backward incompatible changes.

triangle/core.c:19390:5: error: lvalue required as increment operand

Hi, with python3.10, cython 0.29.26 and gcc compiler 11 and flags

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fPIC -DVOID=void -DREAL=double -DNO_TIMER=1 -DTRILIBRARY=1 -DANSI_DECLARATORS=1 -Ic -I/usr/include/python3.10 -c c/triangle.c -o build/temp.linux-x86_64-3.10/c/triangle.o

we have the minimal errors

triangle/core.c: In function ‘__pyx_tp_dealloc_array’:
triangle/core.c:19390:5: error: lvalue required as increment operand
19390 |     ++Py_REFCNT(o);
      |     ^~
triangle/core.c:19392:5: error: lvalue required as decrement operand
19392 |     --Py_REFCNT(o);
      |     ^~
triangle/core.c: In function ‘__pyx_tp_dealloc_memoryview’:
triangle/core.c:19701:5: error: lvalue required as increment operand
19701 |     ++Py_REFCNT(o);
      |     ^~
triangle/core.c:19703:5: error: lvalue required as decrement operand
19703 |     --Py_REFCNT(o);
      |     ^~
triangle/core.c: In function ‘__pyx_tp_dealloc__memoryviewslice’:
triangle/core.c:19951:5: error: lvalue required as increment operand
19951 |     ++Py_REFCNT(o);
      |     ^~
triangle/core.c:19953:5: error: lvalue required as decrement operand
19953 |     --Py_REFCNT(o);

no errors reported with python 3.9 and the same gcc version.

triangle.load triangle.loads

I want use triangle.load triangle.loads
Can you a example to use triangle.load and triangle.loads. Thank you
triangle is simple to use. It 's perfect

Single precision mode

The triangle C library supports this mode, it would be useful to have a single-precision version of the wrapper.

Help with "loads" function

Hi @drufat. You've really done a great job with this. Super easy to use. On a previous issue, you said that "At the moment triangle only supports loading, and not writing data."

Does that basically mean that the "loads" function isn't working right now? I'm trying to get a list of the neighboring cells for each cell and it looks like the .neigh file would have what I need. Is there a way to get that information without running Jonathan Shewchuk’s code directly? Thanks.

Add edges output

Edges can be output from the underlying library using the "e" option.
All that's required is to add the following to terms in tri.py
('edgelist', 'edges'), ('edgemarkerlist', 'edgemarkers'),

numpy and cython dependencies not installed by pip

Hi, thanks for these bindings.

I'm having an issue where i am installing several packages through pip install -r requirements.txt and my requirements.txt has numpy, cython and triangle listed. it fails however when triangle's compilation complains that either numpy and cython are not installed; workaround is to first pip install numpy and pip install cython .

It looks like this has something to do with distutils vs. setuptools, does this sound familiar/on the right track?

Issue with License / conda forge submission

Hi @drufat,

@badlands-model uses your wrapper and I would like to thank you because it has been very useful.
I am trying to create a conda binary for https://github.com/badlands-model/badlands and I have submitted a python-triangle recipe to conda-forge in the process.
You can see the PR here conda-forge/staged-recipes#12951.

The PR is blocked because we are facing some issues regarding the License you chose for your package.
I am just going to quote @mbargul on this:

I checked the licenses (which we should do, being (re-) distributors) and it looks rather disappointing :(.
The creator of the Python wrapper chose a LGPL for their code but the underlying library has a custom non-commercial license. Since -- AFAIK -- (L)GPL does not work with imposing additional restrictions (such as prohibiting commercial use), it is not possible to distribute both the wrapper as well as Triangle together.
The wrapper also vendors (i.e., includes and not just dynamically links to) Triangle, meaning any form of it (which also includes their PyPI distributions, esp. the wheels) does not have a valid license for distribution.

I understand that this might not be a priority for you but I also do thing it would be good to resolve this.
I have not really looked in details but I believe that an MIT license could work.

Thanks!

Romain

point attributes not properly implemented

A couple of changes needed to work with vertex attributes fully. This allows an attribute such as depth to be attached to a vertex and on each extra vertex insertion the attribute is interpolated by triangle. Not working at the moment. The example I worked with was 'A'. It (not sure why) ignored the attributes. Didnt realise till I made changes to the 2013 code that there was a git repository. These dont seem to be fixed in that repository.

Other wise this is a great way to access triangle through python.

need to add to the fields variable in init

          ('pointattributelist', 'vertex_attributes', 'double', 1),

so that attributes are passed in. We also need to skip the dimension test part later because attributes can be any dimension * no_of_points. Flattened arrays are passed backwards and forwards.

for n0, n1, _, d in fields:
    try:
        value = np.array(getattr(b, n0))
    except ValueError:
        continue
    print 'output reshape',n1,value.shape
    if n1=='vertex_attributes':                                           <<<<<< this skips an upfront definition - could be hard coded as 'variable' in fields.

        d=value.shape[0]/len(r['vertices'])
    r[n1] = value.reshape((-1,d))

return r

In core.pyx need to modify the definition
property pointattributelist:
def get(self):
return <double[:self.c.numberofpoints*self.c.numberofpointattributes]> self.c.pointattributelist
def set(self, double[:] value):
#assert value.size == self.c.numberofpoints
replace_d(&(self.c.pointattributelist), value)
self.c.numberofpointattributes = value.size/self.c.numberofpoints

This latter modification allows multi attributes at each vertex. It deals with total size of the attribute which will be self.c.numberofpoints*self.c.numberofpointattributes.

for help

i use the poly file to produce delaunay triangles, but i don't know how to produce .node, .ege ect. files, can anybody help me?

How to use triangle.triangulate

Hi, I want to use your library but I don't know what to feed the function triangle.triangulate(). I have a sets of dense points in 2d so what kind of transformations should I perform on those points to properly make a constrained delaunay triangulation? Thanks

Can't get edge list from triangulation

Using the triangle option e to return the edge list of the triangulation throws: KeyError: 'edgelist'.

Steps to reproduce

In [13]: v = [[0, 0], [0, 1], [1, 1], [1, 0]]
In [14]: tr.triangulate({'vertices': v}, 'a')
Out[14]:
{'vertices': array([[0., 0.],
        [0., 1.],
        [1., 1.],
        [1., 0.]]),
 'vertex_markers': array([[1],
        [1],
        [1],
        [1]], dtype=int32),
 'triangles': array([[1, 0, 3],
        [3, 2, 1]], dtype=int32)}

In [15]: tr.triangulate({'vertices': v}, 'ea')
--------------------------------------------------------------------
KeyError                           Traceback (most recent call last)
<ipython-input-15-7ebaea6a4a1d> in <module>
----> 1 tr.triangulate({'vertices': v}, 'ea')

/anaconda3/envs/tinerator/lib/python3.6/site-packages/triangle/tri.py in triangulate(tri, opts)
     65     tri = {translate_inv[_]: tri[_] for _ in tri}
     66     tri, _ = triang(tri, opts)
---> 67     tri = {translate_frw[_]: tri[_] for _ in tri}
     68
     69     return tri

/anaconda3/envs/tinerator/lib/python3.6/site-packages/triangle/tri.py in <dictcomp>(.0)
     65     tri = {translate_inv[_]: tri[_] for _ in tri}
     66     tri, _ = triang(tri, opts)
---> 67     tri = {translate_frw[_]: tri[_] for _ in tri}
     68
     69     return tri

KeyError: 'edgelist'

Getting error: unknown file type '.pyx' when installing from source

I'm trying to build on a cluster where I'm having to manually install everything from source. When I run:
python setup.py install --prefix=...
I get the error:

building 'triangle.core' extension
error: unknown file type '.pyx' (from 'triangle/core.pyx')

I'm using:

  • python version 2.7.2
  • numpy version 1.6.2
  • setuptools version 18.4
  • cython version 0.24.1

Using the first answer here I modified setup.py with the attached patch and it worked. I'm not familiar with python setup so can't comment on why this is necessary on this cluster (but isn't necessary on my local machine) but wanted to flag it in case it's useful to anyone else.

Pip install of latest version fails for intel mac with python 3.9

% pip install triangle==20220202                                                                                                       1 ↵ ✹ ✭
ERROR: Could not find a version that satisfies the requirement triangle==20220202 (from versions: 2013.01.06.linux-x86_64, 0.1, 0.2, 0.3, 2012.7.4, 2013.1.6a0, 2013.1.6, 2013.1.7, 2013.4.5, 2015.3.28, 2015.12.13, 2015.12.14, 20160202, 20160203, 20170106, 20170429, 20190115, 20190115.1, 20190115.2, 20190115.3, 20200325, 20200404, 20200424)
ERROR: No matching distribution found for triangle==20220202

However, installing version 20200424 works fine, and building the most recent version from source works fine: pip install git+https://github.com/drufat/triangle.git. I believe that if you just resumed uploading the source tarball to pypi, it would work properly without needing to build more wheels.

Build wheel for Python 3.10 and Apple M1

Hi @drufat!

Thank you for this excellent Triangle wrapper. We use it in sectionproperties and, by extension, concreteproperties.

Your package is quite popular and I think that, as Python 3.10 is becoming more widely adopted, it would be wonderful if you were willing to publish an update in PyPI with wheels built for all platforms with all of the latest versions of Python.

I believe that this can be done automatically through GitHub actions using this tool: https://github.com/pypa/cibuildwheel.

Thank you for taking the time to consider this request and thank you for your contributions which allow us to build great tools from your Triangle wrapper.

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.