Code Monkey home page Code Monkey logo

meshpy's Introduction

MeshPy: Simplicial Mesh Generation from Python

Gitlab Build Status

Github Build Status

Python Package Index Release Page

Zenodo DOI for latest release

MeshPy offers quality triangular and tetrahedral mesh generation for Python. Meshes of this type are chiefly used in finite-element simulation codes, but also have many other applications ranging from computer graphics to robotics.

In order to generate 2D and 3D meshes, MeshPy provides Python interfaces to three well-regarded mesh generators, Triangle by J. Shewchuk, TetGen by Hang Si The former two are included in the package in slightly modified versions. A generic mesh reader for the latter is included, as is an easy way to run gmsh from a Python script.

For an interface to gmsh by Christophe Geuzaine and Jean-Francois Remacle, see gmsh_interop.

MeshPy has no dependencies other than a C++ compiler, pybind11, and a working Python installation. Before installing meshpy, you may install pybind11 using the command:

pip install pybind11

Online resources

meshpy's People

Contributors

alexfikl avatar cgohlke avatar dependabot[bot] avatar dnkrtz avatar ecoon avatar goxberry avatar hiaselhans avatar inducer avatar jove1 avatar liubenyuan avatar looooo avatar majosm avatar mattwala avatar peter17 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meshpy's Issues

Delaunay triangulation on 2D data using meshpy

Hi! Thanks for writing this package!

I'm wanting to perform Delaunay triangulation on (large, ~10 million) 2D scatter points, for purposes of interpolation of new points. I was intending to benchmark meshpy / triangle's implementation, but I'm not sure how to get it to work!

With Scipy's Delaunay function (based on qhull), one gives it a number of points and it returns (among other things) a list of integers, where each row lists the indices of the three points that are connected to the point associated with the row index (that sentence came out possibly a bit confusing).

But how does one do something similar with meshpy?

points = np.array([[0, 0], [0, 1.1], [1, 0], [1, 1]])
from scipy.spatial import Delaunay
tri = Delaunay(points)
tri.vertices
array([[2, 3, 0],
       [3, 1, 0]], dtype=int32)

I can't seem to get any output when trying the following, and I am not sure how to proceed.

points = np.array([[0, 0], [0, 1.1], [1, 0], [1, 1]])

mesh_info = MeshInfo()
mesh_info.set_points(points)
mesh = build(mesh_info)
print(np.array(mesh.neighbors))
print(np.array(mesh.facets))
print(np.array(mesh.faces))
print(np.array(mesh.elements))
print(np.array(mesh.points))
print(np.array(mesh.element_volumes))
print(np.array(mesh.point_attributes))
# all return []

Trouble installing with spack

Trying to use meshpy on a cluster with spack.

After installing spack, I install and load several standard and necessary packages: gcc, python, py-pip, etc. Just the default version of each that is available.

Using spack's version of pip, I install pybind11. Then I clone meshpy from GitHub and try to install it. This seems to work, at least initially. Using, e.g., python setup.py install --user or pip install . leads to the same error. Namely (encountered while trying to import meshpy.triangle as triangle):

In [1]: import meshpy._internals
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-4f0d2eb1fac4> in <module>
----> 1 import meshpy._internals

ImportError: /home/sfp8544/.local/lib/python3.9/site-packages/MeshPy-2020.1-py3.9-linux-x86_64.egg/meshpy/_internals.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZNSt15__exception_ptr13exception_ptr10_M_releaseEv

Looks like the C++ standard library isn't getting linked. Presumably this is because of some version mismatch along the way. Any thoughts?

BUG: Neighbor list is not allocated (with patch)

Dear developers,

the library 'triangle' requires the extra option 'n' in order to enable generation of the neighbor list. However, the your function "meshpy.triangle.build()" has no flag which would enable this. I have fixed this problem by manually applying the following patch

137c137
< opts = "pzjn"

opts = "pzj"

could you please commit this into the master branch?

Thanks & Best regards

Build function Error Process finished with exit code -1073741819 (0xC0000005)

Hi,

I am using meshpy on Windows 10 machine. I occationally get error " Process finished with exit code -1073741819 (0xC0000005)" when I run meshpy.build() or meshpy.triangle.build() function. I searched this error in google, but most of the solutions does not work for me. I am not sure if this is a issue with meshpy. I appreciate it if anyone can help me out.

Install uses clang-specific compiler flags on MacOS

I'm on MacOS Catalina and using GCC (actual GCC, not clang). When installing I encounter the following error:

=== Installing git module meshpy https://github.com/inducer/meshpy.git 
Cloning into 'meshpy'...
remote: Enumerating objects: 45, done.
remote: Counting objects: 100% (45/45), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 1599 (delta 17), reused 32 (delta 11), pack-reused 1554
Receiving objects: 100% (1599/1599), 1.35 MiB | 5.63 MiB/s, done.
Resolving deltas: 100% (919/919), done.
running develop
running egg_info
creating MeshPy.egg-info
writing MeshPy.egg-info/PKG-INFO
writing dependency_links to MeshPy.egg-info/dependency_links.txt
writing requirements to MeshPy.egg-info/requires.txt
writing top-level names to MeshPy.egg-info/top_level.txt
writing manifest file 'MeshPy.egg-info/SOURCES.txt'
reading manifest file 'MeshPy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'doc/_static/*.css'
warning: no files found matching 'doc/_templates/*.html'
writing manifest file 'MeshPy.egg-info/SOURCES.txt'
running build_ext
creating path
creating path/to
creating path/to/T
/path/to/gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fwrapv -Wall -O1 -DNDEBUG -I/path/to/include/python3.8 -c /path/to/T/tmpdh0adfh8.cpp -o path/to/T/tmpdh0adfh8.o -std=gnu++14
/path/to/gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fwrapv -Wall -O1 -DNDEBUG -I/path/to/include/python3.8 -c /path/to/T/tmpnx_3uj06.cpp -o path/to/T/tmpnx_3uj06.o -fvisibility=hidden
building 'meshpy._internals' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
creating build/temp.macosx-10.9-x86_64-3.8/src/cpp
/path/to/gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fwrapv -Wall -O1 -DNDEBUG -DEXTERNAL_TEST=1 -DANSI_DECLARATORS=1 -DTRILIBRARY=1 -DTETLIBRARY=1 -DSELF_CHECK=1 -I/path/to/lib/python3.8/site-packages/pybind11/include -I/path/to/pybind11/include -Isrc/cpp -I/path/to/include/python3.8 -c src/cpp/wrapper.cpp -o build/temp.macosx-10.9-x86_64-3.8/src/cpp/wrapper.o -stdlib=libc++ -mmacosx-version-min=10.7 -DVERSION_INFO="2020.1" -std=gnu++14 -fvisibility=hidden
gcc: error: unrecognized command line option '-stdlib=libc++'

I think -stdlib=libc++ is clang-specific (maybe -mmacosx-version-min=10.7 too?).

Looks like it might be coming from here? Is there a way to check the compiler type in addition to the platform?

Also, side-note: something looks weird about those first two compile commands; note the lack of leading / in the output paths (those are obviously not the real paths, but the real ones show this behavior too). For all I know this is intentional, but I just wanted to bring it to your attention in case it's not. ๐Ÿ™‚

Incompatible with python 3.7?

When installing meshpy on python 3.7 i get the following compiler error:

bpl-subset/bpl_subset/libs/python/src/converter/builtin_converters.cpp:51:35: error: invalid conversion from โ€˜const void*โ€™ to โ€˜void*โ€™

It doesn't happen when i install it with python 3.6, so it looks like some kind of compatibility issue. It would appreciate if this was fixed, thanks! :)

Define attributes for regions

Hello,
In this example, there is a rectangle inside a circle. Region 1 is inside the rectangle, region 2 is between the rectangle and circle. How can to set attributes for the two regions? And then, how to collect elements in each region and theirs correspond attributes?
Thank you!

Provided by Liu Benyuan in #11

from future import division

import meshpy.triangle as triangle
import numpy as np
from matplotlib.path import Path

def round_trip_connect(start, end):
return [(i, i+1) for i in range(start, end)] + [(end, start)]

def main():
points = [(1, 0), (1, 1), (-1, 1), (-1, -1), (1, -1), (1, 0)]
facets = round_trip_connect(0, len(points)-1)

circ_start = len(points)
points.extend(
        (3 * np.cos(angle), 3 * np.sin(angle))
        for angle in np.linspace(0, 2*np.pi, 30, endpoint=False))
facets.extend(round_trip_connect(circ_start, len(points)-1))

markers = [2,2,2,2,2,2]
markers.extend(list(np.ones(30, dtype='int')))
markers = [int(i) for i in markers]

info = triangle.MeshInfo()
info.set_points(points)
info.set_facets(facets, facet_markers=markers)
#
info.regions.resize(1)
# points [x,y] in region, + region number, + regional area constraints
info.regions[0] = ([0,0] + [1,0.05])

mesh = triangle.build(info, volume_constraints=True, max_volume=0.1)

mesh_points = np.array(mesh.points)
mesh_tris = np.array(mesh.elements)
mesh_attr = np.array(mesh.point_markers)
print(mesh_attr)

import matplotlib.pyplot as plt
plt.triplot(mesh_points[:, 0], mesh_points[:, 1], mesh_tris)
plt.xlabel('x')
plt.ylabel('y')
plt.show()
#
fig = plt.gcf()
fig.set_size_inches(4.2, 4.2)
plt.savefig('sec5-meshpy-triangle-ex4.pdf')

if name == "main":
main()

Direct Tetgen output different from meshpy output

Hi,
I am trying to make a mesh for unit cube in tetgen (1.4.3) and meshpy. I got different results.
I used the switch in tetgen
-pqfa0.03125

I got 27 points and 48 elements.

I use the following code in meshy:

points  = [(0.0,0.0,0.0), (1.0,0.0,0.0), (1.0,1.0,0.0), (0.0,1.0,0.0),
              (0.0,0.0,1.0), (1.0,0.0,1.0), (1.0,1.0,1.0), (0.0,1.0,1.0)]
point_markers = [1,1,1,1,1,1,1,1]

facets  =  [[0,1,2,3],
            [4,5,6,7],
            [0,1,5,4],
            [1,2,6,5],
            [2,3,7,6],
            [3,0,4,7]]
markers = [1,1,1,1,1,1]

print "Tetrahedralization ..."
opts = Options('pqfa0.03125')

#set meshinfo
mesh_info = MeshInfo()
mesh_info.set_points(points,point_markers)
mesh_info.set_facets(facets,markers)


#build mesh
mesh = build(mesh_info, options=opts)

#print the info of mesh
print "=================== Mesh summary =================="
print "Total points: ",len(mesh.points)
print "Total faces: ",len(mesh.faces)
print "Total elements: ",len(mesh.elements)
print "======================================================="

I got 51 points and 88 elements.

I am wondering if I am missing anything in meshy.
Thanks in advance.

No module named "meshpy._internals"

This module is imported in meshpy.triangle and meshpy.tet, but I cannot find it in meshpy. How come this import error? I checked the git, it does not exists either.

Refine tetrahedral mesh

Hi,
Thanks for such a good package.
I'm using windows10:MeshPyโ€‘2020.1
I'm trying to refine existing tetrahedral mesh by inserting additional points ('-i').
In https://documen.tician.de/meshpy/tri-tet.html it is said that paramteter insert_points โ€“ a MeshInfo object specifying additional points to be inserted. However, using the insert_point parameter does not give the expected result (the number of points in the grid does not change).

I use the following code:

import meshpy.tet as tet
import numpy as np

facets = [[0, 4, 5], [0, 3, 4], [0, 1, 3], [1, 2, 3], [1, 2, 8], [1, 7, 8], [2, 3, 9], [2, 8, 9],
          [3, 4, 10], [3, 9, 10], [4, 5, 11], [4, 10, 11], [0, 5, 11], [0, 6, 11], [0, 1, 6], [1, 6, 7],
          [6, 10, 11], [6, 9, 10], [6, 7, 9], [7, 8, 9]]

nodes = [[0., 0., 0.], [4., 0., 0.], [4., 2., 0.], [2., 2., 0.], [2., 6., 0.], [0., 6., 0.],
         [0., 0., 2.], [4., 0., 2.], [4., 2., 2.], [2., 2., 2.], [2., 6., 2.], [0., 6., 2.]]

inp_mesh = tet.MeshInfo()
inp_mesh.set_points(nodes)
inp_mesh.set_facets(facets)

mesh = tet.build(inp_mesh, options=tet.Options("pq"))

addin = tet.MeshInfo()
addin.set_points(np.array([[1., 1., 1.]]))

refined_mesh = tet.build(mesh, options=tet.Options("ri"), insert_points=addin)

print(mesh.points.__len__()) # 14
print(mesh.elements.__len__()) # 15

old_points = np.array(mesh.points)
old_elements = np.array(mesh.elements)
old_faces = np.array(mesh.faces)

print(refined_mesh.points.__len__()) # 14
print(refined_mesh.elements.__len__()) # 18

new_points = np.array(refined_mesh.points)
new_elements = np.array(refined_mesh.elements)
new_faces = np.array(refined_mesh.faces)

print((old_points == new_points).all()) # True

print('done')

What I'm doing wrong?
Thanks in advance

meshpy reports gmsh failure when warnings occur

The meshpy error processing is a bit too sensitive in that it simply scans for the word 'error' in the stderr of the gmsh output (https://github.com/inducer/meshpy/blob/master/meshpy/gmsh.py#L182). This is problematic if some warning occurs during the gmsh run, which typically leads to output like this:

Warning : ------------------------------
Warning : Mesh generation error summary
Warning : 6 warnings
Warning : 0 errors
Warning : Check the full log for details
Warning : ------------------------------

Clearly, there was no error, but meshpy still throws a GmshError.

TetGen segfault (memorypool destructor)

Getting a segmentation fault in tetrahedralize on this stanford_bunny.stl. Here's the gdb backtrace:

``
#0 0x00007fffe6548708 in tetgenmesh::memorypool::~memorypool() ()

from /home/dnkrtz/anaconda3/lib/python3.5/site-packages/meshpy/_tetgen.cpython-35m-x86_64-linux-gnu.so
``

``
#1 0x00007fffe65976a1 in tetgenmesh::freememory() ()

from /home/dnkrtz/anaconda3/lib/python3.5/site-packages/meshpy/_tetgen.cpython-35m-x86_64-linux-gnu.so
``

``
#2 0x00007fffe659680c in tetrahedralize(tetgenbehavior_, tetgenio_, tetgenio_, tetgenio_, tetgenio*) ()

from /home/dnkrtz/anaconda3/lib/python3.5/site-packages/meshpy/_tetgen.cpython-35m-x86_64-linux-gnu.so
``

``
#3 0x00007fffe65c0ef8 in (anonymous namespace)::tetrahedralizeWrapper(tetgenbehavior&, (anonymous namespace)::tMeshInfo&, (anonymous namespace)::tMeshInfo&, (anonymous namespace)::tMeshInfo*) ()

from /home/dnkrtz/anaconda3/lib/python3.5/site-packages/meshpy/_tetgen.cpython-35m-x86_64-linux-gnu.so
``

``
#4 0x00007fffe65b93eb in meshpyboost::python::objects::caller_py_function_impl<meshpyboost::python::detail::caller<void ()(tetgenbehavior&, (anonymous namespace)::tMeshInfo&, (anonymous namespace)::tMeshInfo&, (anonymous namespace)::tMeshInfo), meshpyboost::python::default_call_policies, meshpyboost::mpl::vector5<void, tetgenbehavior&, (anonymous namespace)::tMeshInfo&, (anonymous namespace)::tMeshInfo&, (anonymous namespace)::tMeshInfo*> > >::operator()(object, object) ()

``

mesh build crash

I'm using windows:MeshPyโ€‘2016.1.2+unstableโ€‘cp35โ€‘cp35mโ€‘win_amd64.whl.
Following code crash python:

from meshpy.tet import MeshInfo, build
mesh_info = MeshInfo()
mesh_info.set_points([(0,0,0), (2,0,0), (2,2,0)])
mesh_info.set_facets([[0,1,2]])
mesh = build(mesh_info)

What I'm doing wrong?

tetrahedral mesh from 3d numpy array

Hi,

My structure of interest is bounded in 3d numpy boolean array (m x n x p), such that it holds a 1(True) for the structure of interest and a 0(False) elsewhere.

Can this be volume-meshed (tetrahedrally) in meshpy?

Any help is appreciated.

pip fails due to missing boost/python.hpp

Hi, I cannot install meshpy on my Windows 10 machine due to the following error:

src/cpp/wrap_triangle.cpp(2): fatal error C1083: Cannot open include file: 'boost/python.hpp': No such file or directory

This seems to be because the boost libraries are missing. When I downloaded the source from github, the bpl-subset directory was empty. Is this the problem? I tried downloading the bpl-subset contents and putting in the appropriate path, then running setup.py, but this didn't help either...

I have Visual Studio 2017 community edition installed which I think is being used as the cpp compiler.

Any clues as to how I could install would be appreciated.

Thanks.

Export 3D mesh with Gmsh - export

First of all - thank you for such an excellent package!

A question - currently, is there a way to export the 3D mesh to different formats that are supported in gmsh within meshpy?

As I read through the code, I noticed the write_vtk. For example, would it be possible to export to formats like ABAQUS INP file (supported within gmsh)?

Hexahedron Cube as element

I have built a solver for my undergraduate problem and i am battling with the meshing... but that's not something new to the FEM world :P

At the moment i use simple cube elements and i would like to automate the meshing part of my code and i found your package but you only use tetrahedron elements. I mean sometimes cubes perform better than tetrahedron and have less tendencies for hour glass problems, maybe the implementation of the cube could be something useful for the FEM community.

meshpy.tet.build's insert_points keyword argument isn't implemented?

I'd like to use TetGen through meshpy. I have a PLC describing my domain's boundary, and I'd like to add some additional points (in the interior of the domain) to the mesh, so that after meshing I'll have a mesh which satisfies a maximum volume constraint on the tetrahedra, and which will additionally include my extra points among the mesh's vertices.

I believe the way to do this is by using the feature described in section 4.2.8 of TetGen's manual.

Judging from the documentation for meshpy.tet.build from these docs, it appears that build takes a keyword argument insert_points which is a MeshInfo specifying the extra points. I checked the implementation of build in the source, and insert_points doesn't appear to be used for anything other than setting a flag in options at the moment.

I'm also not sure how to use insert_points. Something like this?

main_info = ... # set up this MeshInfo already...
insert_info = MeshInfo()
insert_info.set_points([my_special_point])
mesh = build(main_info, ..., insert_points=insert_info)

No module 'pyvtk' error in 'test_tetgen.py'

Both the 'test_tetgen.py' and 'test_tetgen_2.py' examples/tests try to use 'pyvtk' (which isn't listed as a dependency in the setup.py) and throw a 'No module named pyvtk' exception.

The import is only located under the 'tet.py' file in the 'MeshInfo' class and the 'write_vtk' method.

Any plans on updating meshpy to work with an existing installation of VTK or perhaps PyEVTK?

memory crash

Hello,
I got this error when I run meshpy.build()
"Process finished with exit code -1073741819 (0xC0000005)",
I noticed this warning but I didn't understand what is it
"recommend non- switches for crash-free meshing"
how can I solve it?

test_torus failing on run

I've been trying to update MeshPY to latest on Gentoo and am running the tests to check if the package is installed correctly.

It fails with the following log

 * python3_7: running distutils-r1_run_phase python_test
===================================================================== test session starts ======================================================================
platform linux -- Python 3.7.9, pytest-6.0.2, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python3.7
cachedir: .pytest_cache
rootdir: /var/tmp/portage/dev-python/meshpy-2018.2.1_p1/work/meshpy-6f4f9418f5f02b414d561bd8de710c4f1349ea72
plugins: flaky-3.7.0
collecting ... collected 5 items

test/test_meshpy.py::test_triangle_refine PASSED                                                                                                         [ 20%]
test/test_meshpy.py::test_point_attributes PASSED                                                                                                        [ 40%]
test/test_meshpy.py::test_tetgen PASSED                                                                                                                  [ 60%]
test/test_meshpy.py::test_torus Fatal Python error: Aborted

Current thread 0x00007f04dd287740 (most recent call first):
  File "/var/tmp/portage/dev-python/meshpy-2018.2.1_p1/work/meshpy-6f4f9418f5f02b414d561bd8de710c4f1349ea72-python3_7/lib/meshpy/tet.py", line 162 in tetrahedralize
  File "/var/tmp/portage/dev-python/meshpy-2018.2.1_p1/work/meshpy-6f4f9418f5f02b414d561bd8de710c4f1349ea72-python3_7/lib/meshpy/tet.py", line 190 in build
  File "/var/tmp/portage/dev-python/meshpy-2018.2.1_p1/work/meshpy-6f4f9418f5f02b414d561bd8de710c4f1349ea72/test/test_meshpy.py", line 150 in test_torus
  File "/usr/lib/python3.7/site-packages/_pytest/python.py", line 180 in pytest_pyfunc_call
  File "/usr/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/usr/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
  File "/usr/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/usr/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/usr/lib/python3.7/site-packages/_pytest/python.py", line 1570 in runtest
  File "/usr/lib/python3.7/site-packages/_pytest/runner.py", line 153 in pytest_runtest_call
  File "/usr/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/usr/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
  File "/usr/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/usr/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/usr/lib/python3.7/site-packages/_pytest/runner.py", line 247 in <lambda>
  File "/usr/lib/python3.7/site-packages/_pytest/runner.py", line 294 in from_call
  File "/usr/lib/python3.7/site-packages/_pytest/runner.py", line 247 in call_runtest_hook
  File "/usr/lib/python3.7/site-packages/flaky/flaky_pytest_plugin.py", line 138 in call_and_report
  File "/usr/lib/python3.7/site-packages/_pytest/runner.py", line 117 in runtestprotocol
  File "/usr/lib/python3.7/site-packages/_pytest/runner.py", line 100 in pytest_runtest_protocol
  File "/usr/lib/python3.7/site-packages/flaky/flaky_pytest_plugin.py", line 94 in pytest_runtest_protocol
  File "/usr/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/usr/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
  File "/usr/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/usr/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/usr/lib/python3.7/site-packages/_pytest/main.py", line 321 in pytest_runtestloop
  File "/usr/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/usr/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
  File "/usr/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/usr/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/usr/lib/python3.7/site-packages/_pytest/main.py", line 296 in _main
  File "/usr/lib/python3.7/site-packages/_pytest/main.py", line 240 in wrap_session
  File "/usr/lib/python3.7/site-packages/_pytest/main.py", line 289 in pytest_cmdline_main
  File "/usr/lib/python3.7/site-packages/pluggy/callers.py", line 187 in _multicall
  File "/usr/lib/python3.7/site-packages/pluggy/manager.py", line 87 in <lambda>
  File "/usr/lib/python3.7/site-packages/pluggy/manager.py", line 93 in _hookexec
  File "/usr/lib/python3.7/site-packages/pluggy/hooks.py", line 286 in __call__
  File "/usr/lib/python3.7/site-packages/_pytest/config/__init__.py", line 158 in main
  File "/usr/lib/python3.7/site-packages/_pytest/config/__init__.py", line 180 in console_main
  File "/usr/lib/python-exec/python3.7/pytest", line 11 in <module>
/var/tmp/portage/dev-python/meshpy-2018.2.1_p1/temp/environment: line 2908:  3117 Aborted                 pytest -vv

Please let me know what else I should give out to get this working!

tet module does not compute mesh after calling "build"

I have a huge model as a KML file which has been extracted from CAD data (don't ask ;) ). To get a mesh representation I parse the KML manually and collect all the polygon information, writing it out to .stl. This works fine for most polys as they have 3 or 4 vertices, which can be written to .stl directly. 30% of the model are polygons with > 4 vertices, however. My intent was to throw those polygons to meshpy and let it build tri-meshes for the polygons. Here's a code excerpt:

              mesh_info = MeshInfo()
              
              mesh_info.set_points(vertices)
            
              # Add a single facet with all the vertices
              mesh_info.set_facets([list(range(0,len(vertices)))])
              print '-----'
              mesh_info.dump()
              print '-----'
              
              mesh = build(mesh_info)
              
              mesh.dump()

and this is example output:

-----
array points: 5 elements, 3 values per element
  0: 0.00190297736144,0.00352662518731,15.4685
  1: 0.00190145604044,0.00352675828543,15.4684
  2: 0.00190145606727,0.00352675833519,15.3784
  3: 0.0019029773883,0.00352662523708,15.3785
  4: 0.00190297736144,0.00352662518731,15.4685
-----
array points: 0 elements, 3 values per element

My expectation was to get some mesh back with multiple facets, but instead the mesh has 0 elements after 'build' was called. It appears the MeshInfo input looks plausible. I hence have two questions:

  • Does my approach make sense or did I miss something and what I try isn't what the 'tet' module is supposed to do?

  • Would it be possible to provide some output and/or documentation on why just something empty is returned such as in my case? This would make it easier to understand what to look for.

airfoil3d.py : cannot import name generate_naca

How may I help in solving these problems in the +example+ folder?

$ python2 airfoil3d.py 
Traceback (most recent call last):
  File "airfoil3d.py", line 69, in <module>
    main()
  File "airfoil3d.py", line 8, in main
    from meshpy.naca import generate_naca
ImportError: cannot import name generate_naca

segfault again, meshpy.triangle before and after numpy.

Hi, in the following script, if I put import meshpy.triangle as triangle before import numpy as np, everything goes fine. However, if I put it after numpy, there will be a segfault.

the versions are

ipython-2.3.1
python-2.7.8
numpy-1.9.1

and using the meshpy-git version.

PS, thanks for the help in the mailing list in generating the facet_markers.

from __future__ import division

import meshpy.triangle as triangle
import numpy as np

def round_trip_connect(start, end):
    return [(i, i+1) for i in range(start, end)] + [(end, start)]

def refinement_func(tri_points, area):
    max_area=0.1
    return bool(area>max_area);

def main():
    points = [(1, 0), (1, 1), (-1, 1), (-1, -1), (1, -1), (1, 0)]
    facets = round_trip_connect(0, len(points)-1)
    markers = [2,2,2,2,2,2]

    outter_start = len(points)
    points.extend([(2, 0), (2, 2), (-2, 2), (-2, -2), (2, -2), (2, 0)])
    facets.extend(round_trip_connect(outter_start, len(points) - 1))
    markers.extend([3,3,3,3,3,3])

    # build
    info = triangle.MeshInfo()
    info.set_points(points)
    info.set_holes([(0, 0)])
    info.set_facets(facets, facet_markers=markers)

    #
    mesh = triangle.build(info, refinement_func=refinement_func)

    #
    mesh_points = np.array(mesh.points)
    mesh_tris = np.array(mesh.elements)
    mesh_attr = np.array(mesh.point_markers)

    print mesh_attr

    import matplotlib.pyplot as plt
    plt.triplot(mesh_points[:, 0], mesh_points[:, 1], mesh_tris)
    plt.xlabel('x')
    plt.ylabel('y')
    #
    n = np.size(mesh_attr);
    inner_nodes = [i for i in range(n) if mesh_attr[i]==2]
    outer_nodes = [i for i in range(n) if mesh_attr[i]==3]
    plt.plot(mesh_points[inner_nodes, 0], mesh_points[inner_nodes, 1], 'ro')
    plt.plot(mesh_points[outer_nodes, 0], mesh_points[outer_nodes, 1], 'go')
    plt.axis([-2.5, 2.5, -2.5, 2.5])
    #plt.show()
    #
    fig = plt.gcf()
    fig.set_size_inches(4.2, 4.2)
    plt.savefig('../../figs/sec5-meshpy-triangle-ex5.pdf')

if __name__ == "__main__":
    main()

triangle meshes

Hi,
I'm having a little trouble creating surface meshes.
So far I've had good success with creating tet meshes using:

import meshpy.tet as tet
from meshpy.tet import MeshInfo

verts, faces= marching_cubes_lewiner(stack, step_size=19)
tetmesh_info = MeshInfo()
tetmesh_info.set_points(verts)
tetmesh_info.set_facets(faces)
tetmesh = tet.build(tetmesh_info)
tetmesh.write_vtk("Output\Meshes\{}_tetrahedral_mesh.vtk".format(name))

But when I try to create a triangle using:

import meshpy.triangle as tri
from meshpy.triangle import MeshInfo

trimesh_info = tri.MeshInfo()
trimesh_info.set_points(verts)
trimesh_info.set_facets(faces)
trimesh = tri.build(trimesh_info)

I get the error "ValueError: value must be a sequence of length self.unit"

Is there something I'm missing?
Also is it possible to feed a surface mesh built with triangle into tetgen?

How could I extract only the 2D triangle mesh functions from meshpy ?

Hi,

Nice package !

I am now learning inverse problems for electrical impedance tomography. The focus is on 2D triangle mesh (with exclusion and refinement). How could I extract only the 2D functions and wrappers from meshpy ? We will use them for some 2D FEM code to solve the forward and inverse problem.

With my best regards !

liubenyuan

It isn't actually necessary to use insert_points...?

I spent a little more time looking into how to add points to the mesh, and appears that using insert_points (see #60, #68, and #69) may be unnecessary.

In section 5.1.1 of the TetGen manual, it mentions that polygons in the PLC may be degenerate (only consist of one or two nodes), in which case they can be used to specify constrained points or edges. I tried this out, and it appears that while assembling the points and facets of a meshpy.tet.MeshInfo, just adding an extra point that isn't included in a facet has the desired effect. I guess I should have read the section titled "Useful Things to Know" earlier. ๐Ÿ˜จ

Maybe the -i switch makes more sense when using TetGen from the command-line... But it would be helpful to indicate that there are different ways to go about adding constrained features to a mesh in meshpy's docs.

The facet_markers can not handle numpy.int64

I create the facet_markers via

markers = [2,2,2,2,2,2]
markers.extend(list(np.ones(30, dtype='int')))

info.set_facets(facets, facet_markers=markers)

and meshpy.triangle reports

  File "/home/postgres/iresearch/cem/note/codes/chap05/triangle-ex4.py", line 34, in main
    info.set_facets(facets, facet_markers=markers)

  File "/usr/lib/python3.4/site-packages/MeshPy-2014.1-py3.4-linux-x86_64.egg/meshpy/triangle.py", line 59, in set_facets
    self.facet_markers[i] = mark

TypeError: No registered converter was able to produce a C++ rvalue of type int from this Python object of type numpy.int64

one way to work around this is to add a converter

markers = [int(i) for i in markers]

to manually convert numpy.int64 to integer, the question is

  • can meshpy directly supports more types numpy data types ? besides the list data type used in the examples, could we add more support using numpy.ndarray data types ?
  • when a subregion is enclosed within a shape, can I get the element markers which indicates whether an element is belonging (or not) to this sub-region ? or how could I refine further within the sub-region as well as near the region boundaries ?

load_stl() creates redundant points

I'm confused about how load_stl() is behaving. It seems to be creating redundant points when reading the STL. In the example below, the VTK polydata contains 26 points. When saved and loaded as PLY MeshPy reads 26 points. But when done as STL it sees 144 (26 of which are unique).

Example:

import vtk
import numpy as np
from meshpy.tet import MeshInfo

sphere = vtk.vtkSphereSource()
sphere.SetThetaResolution(6)
sphere.SetPhiResolution(6)
sphere.Update()

# Write to STL
writer = vtk.vtkSTLWriter()
writer.SetInputData(sphere.GetOutput())
writer.SetFileName('sphere.stl')
writer.Write()

# Write to PLY
writer = vtk.vtkPLYWriter()
writer.SetInputData(sphere.GetOutput())
writer.SetFileName('sphere.ply')
writer.SetFileTypeToASCII()
writer.Write()

mesh_info1 = MeshInfo()
mesh_info1.load_stl('sphere.stl')


mesh_info2 = MeshInfo()
mesh_info2.load_ply('sphere.ply')

print('Number of Sphere Points VTK: {}'.format(sphere.GetOutput().GetNumberOfPoints()))
print('Number of MeshPy STL Points: {}'.format(len(list(mesh_info1.points))))
print('Number of MeshPy PLY Points: {}'.format(len(list(mesh_info2.points))))

print('Number of unique STL Points: {}'.format(np.unique(np.array(mesh_info1.points), axis=0).shape[0]))

Output:

Opening sphere.stl.
Opening sphere.ply.
Number of Sphere Points VTK: 26
Number of MeshPy STL Points: 144
Number of MeshPy PLY Points: 26
Number of unique STL Points: 26

Any idea what may be going on?

Best,
Scott

TetGen Segmentation fault

tetGen_mesh_sizing_function_Scaphoid_Lunate.m.zip

Scaphoid_improved_surface.stl.zip

I am using TetGen to create the mesh for STL file. While running TetGen in MatLab I get following error

`Warning: The 1-th region point lies outside the convex hull.
"/Users/s2986149/Desktop/GIBBON/lib_ext/tetGen/mac64/tetgen" -pq1.2AaY "/Users/s2986149/Desktop/GIBBON/data/temp/tetgenmodel.smesh": Segmentation fault
--- Done --- 08-Feb-2019 14:58:06

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--- Importing TetGen files --- 08-Feb-2019 14:58:06
Warning: /Users/s2986149/Desktop/GIBBON/data/temp/tetgenmodel.1.node import unsuccesful

In importTETGEN (line 29)
In runTetGen (line 345)
In tetGen_mesh_sizing_function_Scaphoid_Lunate (line 79)
--- Done --- 08-Feb-2019 14:58:06`

I will appreciate any comments on it.
Cheers,
NataCalc

segfault

The following piece of code segfaults for me. Not sure if I did anything wrong, but in any case a segfault should never happen.

import math
from meshpy.geometry import (
    EXT_OPEN,
    GeometryBuilder,
    generate_surface_of_revolution,
)
from meshpy.tet import MeshInfo, build


h = 0.02
r = 3.0
polar_subdivision = int(math.pi / h)
dphi = math.pi / polar_subdivision


def truncate(val):
    return 0 if abs(val) < 1e-10 else val


rz = [
    [truncate(r * math.sin(i * dphi)), r * math.cos(i * dphi)]
    for i in range(polar_subdivision + 1)
]

geob = GeometryBuilder()
radial_subdivision = int(2 * math.pi / h)
geob.add_geometry(
    *generate_surface_of_revolution(
        rz, closure=EXT_OPEN, radial_subdiv=radial_subdivision
    )
)

mesh_info = MeshInfo()
geob.set(mesh_info)

build(mesh_info)
[1]    2685424 segmentation fault (core dumped)  python3 v.py

segfault with triangle.refine

Dear @inducer

I encounter a segfault again when calling triangle.refine to refine a generated mesh (maybe, it is my compiler's problem ?)

The codes are posted below. A short description of the codes, I generated mesh from a circle (a small square is within the circle) and I want to further refine the already generated mesh by imposing a more strict refinement_func, and the gdb debug information is posted after the code.

BTW, can i pass more parameters to the refinement_func ? for example, the polygon in refinement_func_square, so that I could write more compact refinement functions for different regions of the mesh.

Best!

from __future__ import division

import meshpy.triangle as triangle
import numpy as np
from matplotlib.path import Path

def round_trip_connect(start, end):
    return [(i, i+1) for i in range(start, end)] + [(end, start)]

def needs_refinement(tri_points, area):
    return bool(area > 0.1)

def needs_refinement2(tri_points, area):
    return bool(area > 0.05)

def needs_refinement_square(tri_points, area):
    points = [(1, 0), (1, 1), (-1, 1), (-1, -1), (1, -1), (1, 0)]
    psquare = Path(points)
    center_tri = np.sum(np.array(tri_points), axis=0)/3.
    if psquare.contains_point(center_tri):
        if bool(area > 0.05):
            return True
    elif area>0.1:
        return True
    else:
        return False

def main():
    points = [(1, 0), (1, 1), (-1, 1), (-1, -1), (1, -1), (1, 0)]
    facets = round_trip_connect(0, len(points)-1)

    circ_start = len(points)
    points.extend(
            (3 * np.cos(angle), 3 * np.sin(angle))
            for angle in np.linspace(0, 2*np.pi, 30, endpoint=False))
    facets.extend(round_trip_connect(circ_start, len(points)-1))

    markers = [2,2,2,2,2,2]
    markers.extend(list(np.ones(30, dtype='int')))
    markers = [int(i) for i in markers]

    info = triangle.MeshInfo()
    info.set_points(points)
    #info.set_holes([(0, 0)])
    info.set_facets(facets, facet_markers=markers)

    mesh = triangle.build(info, refinement_func=needs_refinement)
    mesh = triangle.refine(mesh, refinement_func=needs_refinement2)

    mesh_points = np.array(mesh.points)
    mesh_tris = np.array(mesh.elements)
    mesh_attr = np.array(mesh.point_markers)
    print(mesh_attr)

    import matplotlib.pyplot as plt
    plt.triplot(mesh_points[:, 0], mesh_points[:, 1], mesh_tris)
    plt.xlabel('x')
    plt.ylabel('y')
    plt.show()
    #
    fig = plt.gcf()
    fig.set_size_inches(4.2, 4.2)
    #plt.savefig('../../figs/sec5-meshpy-triangle-ex4.pdf')

if __name__ == "__main__":
    main()
(gdb) file python
Reading symbols from python...(no debugging symbols found)...done.
(gdb) run triangle-ex4.py 
Starting program: /usr/bin/python triangle-ex4.py
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff60efcdc in reconstruct () from /usr/lib/python3.4/site-packages/MeshPy-2014.1-py3.4-linux-x86_64.egg/meshpy/_triangle.cpython-34m.so
(gdb) bt
#0  0x00007ffff60efcdc in reconstruct () from /usr/lib/python3.4/site-packages/MeshPy-2014.1-py3.4-linux-x86_64.egg/meshpy/_triangle.cpython-34m.so
#1  0x00007ffff60f4e5b in triangulate () from /usr/lib/python3.4/site-packages/MeshPy-2014.1-py3.4-linux-x86_64.egg/meshpy/_triangle.cpython-34m.so
#2  0x00007ffff60d0602 in triangulateWrapper(char*, tMeshInfo&, tMeshInfo&, tMeshInfo&, _object*) () from /usr/lib/python3.4/site-packages/MeshPy-2014.1-py3.4-linux-x86_64.egg/meshpy/_triangle.cpython-34m.so
#3  0x00007ffff60d8ec7 in meshpyboost::python::objects::caller_py_function_impl<meshpyboost::python::detail::caller<void (*)(char*, tMeshInfo&, tMeshInfo&, tMeshInfo&, _object*), meshpyboost::python::default_call_policies, meshpyboost::mpl::vector6<void, char*, tMeshInfo&, tMeshInfo&, tMeshInfo&, _object*> > >::operator()(_object*, _object*) ()
   from /usr/lib/python3.4/site-packages/MeshPy-2014.1-py3.4-linux-x86_64.egg/meshpy/_triangle.cpython-34m.so
#4  0x00007ffff60ff552 in meshpyboost::python::objects::function::call(_object*, _object*) const () from /usr/lib/python3.4/site-packages/MeshPy-2014.1-py3.4-linux-x86_64.egg/meshpy/_triangle.cpython-34m.so
#5  0x00007ffff60ff657 in meshpyboost::detail::function::void_function_ref_invoker0<meshpyboost::python::objects::(anonymous namespace)::bind_return, void>::invoke(meshpyboost::detail::function::function_buffer&)
    () from /usr/lib/python3.4/site-packages/MeshPy-2014.1-py3.4-linux-x86_64.egg/meshpy/_triangle.cpython-34m.so
#6  0x00007ffff610cf0d in meshpyboost::python::handle_exception_impl(meshpyboost::function0<void>) () from /usr/lib/python3.4/site-packages/MeshPy-2014.1-py3.4-linux-x86_64.egg/meshpy/_triangle.cpython-34m.so
#7  0x00007ffff60fce7f in function_call () from /usr/lib/python3.4/site-packages/MeshPy-2014.1-py3.4-linux-x86_64.egg/meshpy/_triangle.cpython-34m.so
#8  0x00007ffff79a6ff8 in PyObject_Call (func=func@entry=0x721cf0, arg=arg@entry=0x7ffff7ef6990, kw=kw@entry=0x0) at Objects/abstract.c:2067
#9  0x00007ffff7a57393 in do_call (nk=<optimized out>, na=5, pp_stack=0x7fffffffdd30, func=<optimized out>) at Python/ceval.c:4463
#10 call_function (oparg=<optimized out>, pp_stack=0x7fffffffdd30) at Python/ceval.c:4261
#11 PyEval_EvalFrameEx (f=0x7ffff010f048, throwflag=<optimized out>) at Python/ceval.c:2836
#12 0x00007ffff7a5d859 in PyEval_EvalCodeEx (_co=0x7ffffffe9670, _co@entry=0x7ffff7e4a660, globals=0x7ffff7e48db0, locals=0x7ffff010f1c0, args=0x7ffff7eaadc8, argcount=170096, argcount@entry=1, kws=0x29fe0, 
    kwcount=0, defs=0x7ffff7e496f0, defcount=4, kwdefs=0x0, closure=0x0) at Python/ceval.c:3585
#13 0x00007ffff7a5b95f in fast_function (nk=1, na=1, n=<optimized out>, pp_stack=0x7fffffffdf30, func=<optimized out>) at Python/ceval.c:4341
#14 call_function (oparg=<optimized out>, pp_stack=0x7fffffffdf30) at Python/ceval.c:4259
#15 PyEval_EvalFrameEx (f=f@entry=0xc0b0d8, throwflag=throwflag@entry=0) at Python/ceval.c:2836
#16 0x00007ffff7a5c2b2 in fast_function (nk=<optimized out>, na=<optimized out>, n=0, pp_stack=0x7fffffffe050, func=<optimized out>) at Python/ceval.c:4331
#17 call_function (oparg=<optimized out>, pp_stack=0x7fffffffe050) at Python/ceval.c:4259
#18 PyEval_EvalFrameEx (f=0x7ffff7f45438, throwflag=<optimized out>) at Python/ceval.c:2836
#19 0x00007ffff7a5d859 in PyEval_EvalCodeEx (_co=0x7ffffffe9670, _co@entry=0x7ffff7ed6c00, globals=0x0, locals=0x7ffff7f455b0, args=0x0, argcount=170096, argcount@entry=0, kws=0x29fe0, kws@entry=0x0, kwcount=0, 
    defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3585
#20 0x00007ffff7a5d8fb in PyEval_EvalCode (co=co@entry=0x7ffff7ed6c00, globals=globals@entry=0x7ffff7f42508, locals=locals@entry=0x7ffff7f42508) at Python/ceval.c:773
#21 0x00007ffff7a79bb4 in run_mod (mod=mod@entry=0x6fb3a8, filename=filename@entry=0x7ffff7e489b0, globals=globals@entry=0x7ffff7f42508, locals=locals@entry=0x7ffff7f42508, flags=flags@entry=0x7fffffffe2d0, 
    arena=arena@entry=0x6c8fe0) at Python/pythonrun.c:2180
#22 0x00007ffff7a7bde5 in PyRun_FileExFlags (fp=0x677850, filename_str=<optimized out>, start=<optimized out>, globals=0x7ffff7f42508, locals=0x7ffff7f42508, closeit=1, flags=0x7fffffffe2d0)
    at Python/pythonrun.c:2133
#23 0x00007ffff7a7cdb3 in PyRun_SimpleFileExFlags (fp=0x7ffffffe9670, filename=0x7ffff7f393b0 "triangle-ex4.py", closeit=1, flags=0xc38780) at Python/pythonrun.c:1606
#24 0x00007ffff7a9301c in run_file (p_cf=<optimized out>, filename=<optimized out>, fp=<optimized out>) at Modules/main.c:319
#25 Py_Main (argc=-136017680, argv=0x7ffff7f39390) at Modules/main.c:751
#26 0x0000000000400af6 in main ()
(gdb) 

box-in-box.py core dumped

Hi,

there is a core dump when running box-in-box.py (both python2 and python3), where

python-2.7.8
python-3.4.2
numpy-1.9.1
scipy-0.14.0
matplotlib-1.4.2
$ python2 box-in-box.py 
*** Error in `python2': free(): invalid pointer: 0x00007f5be1b31dc8 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x7361e)[0x7f5be180761e]
/usr/lib/libc.so.6(+0x78a9e)[0x7f5be180ca9e]
/usr/lib/libc.so.6(+0x7925b)[0x7f5be180d25b]
/usr/lib/python2.7/site-packages/meshpy/_tetgen.so(_ZN10tetgenmesh10memorypoolD1Ev+0x18)[0x7f5bdaeed1ac]
/usr/lib/python2.7/site-packages/meshpy/_tetgen.so(_ZN10tetgenmesh10freememoryEv+0x30b)[0x7f5bdaf3b84b]
/usr/lib/python2.7/site-packages/meshpy/_tetgen.so(_Z14tetrahedralizeP14tetgenbehaviorP8tetgenioS2_S2_S2_+0x2bef)[0x7f5bdaf3a9c9]
/usr/lib/python2.7/site-packages/meshpy/_tetgen.so(+0xbce63)[0x7f5bdaf68e63]
/usr/lib/python2.7/site-packages/meshpy/_tetgen.so(+0xb146e)[0x7f5bdaf5d46e]
/usr/lib/python2.7/site-packages/meshpy/_tetgen.so(_ZNK11meshpyboost6python7objects8function4callEP7_objectS4_+0x363)[0x7f5bdaf743b7]
/usr/lib/python2.7/site-packages/meshpy/_tetgen.so(+0xc84d1)[0x7f5bdaf744d1]
/usr/lib/python2.7/site-packages/meshpy/_tetgen.so(_ZN11meshpyboost6python21handle_exception_implENS_9function0IvEE+0x9f)[0x7f5bdaf8bf8b]
/usr/lib/python2.7/site-packages/meshpy/_tetgen.so(+0xc5800)[0x7f5bdaf71800]
/usr/lib/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7f5be1d9d773]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x3b07)[0x7f5be1e32ba7]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5043)[0x7f5be1e340e3]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x830)[0x7f5be1e35a90]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x4f37)[0x7f5be1e33fd7]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5043)[0x7f5be1e340e3]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x830)[0x7f5be1e35a90]
/usr/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7f5be1e35b89]
/usr/lib/libpython2.7.so.1.0(+0xfbfef)[0x7f5be1e4efef]
/usr/lib/libpython2.7.so.1.0(PyRun_FileExFlags+0x72)[0x7f5be1e50212]
/usr/lib/libpython2.7.so.1.0(PyRun_SimpleFileExFlags+0xe7)[0x7f5be1e51427]
/usr/lib/libpython2.7.so.1.0(Py_Main+0xc7a)[0x7f5be1e627ca]
/usr/lib/libc.so.6(__libc_start_main+0xf0)[0x7f5be17b4040]
python2[0x40073e]
======= Memory map: ========
00400000-00401000 r-xp 00000000 00:12 4719040                            /usr/bin/python2.7
00600000-00601000 r--p 00000000 00:12 4719040                            /usr/bin/python2.7
00601000-00602000 rw-p 00001000 00:12 4719040                            /usr/bin/python2.7
01a8e000-0210c000 rw-p 00000000 00:00 0                                  [heap]
7f5bda957000-7f5bda95b000 r-xp 00000000 00:12 4715497                    /usr/lib/python2.7/lib-dynload/_locale.so
7f5bda95b000-7f5bdab5a000 ---p 00004000 00:12 4715497                    /usr/lib/python2.7/lib-dynload/_locale.so
7f5bdab5a000-7f5bdab5b000 r--p 00003000 00:12 4715497                    /usr/lib/python2.7/lib-dynload/_locale.so
7f5bdab5b000-7f5bdab5c000 rw-p 00004000 00:12 4715497                    /usr/lib/python2.7/lib-dynload/_locale.so
7f5bdab5c000-7f5bdac4c000 r-xp 00000000 00:12 5001649                    /usr/lib/libstdc++.so.6.0.20
7f5bdac4c000-7f5bdae4c000 ---p 000f0000 00:12 5001649                    /usr/lib/libstdc++.so.6.0.20
7f5bdae4c000-7f5bdae54000 r--p 000f0000 00:12 5001649                    /usr/lib/libstdc++.so.6.0.20
7f5bdae54000-7f5bdae56000 rw-p 000f8000 00:12 5001649                    /usr/lib/libstdc++.so.6.0.20
7f5bdae56000-7f5bdae6b000 rw-p 00000000 00:00 0 
7f5bdae6c000-7f5bdaeac000 rw-p 00000000 00:00 0 
7f5bdaeac000-7f5bdafc7000 r-xp 00000000 00:12 5081444                    /usr/lib/python2.7/site-packages/meshpy/_tetgen.so
7f5bdafc7000-7f5bdb1c6000 ---p 0011b000 00:12 5081444                    /usr/lib/python2.7/site-packages/meshpy/_tetgen.so
7f5bdb1c6000-7f5bdb1d0000 rw-p 0011a000 00:12 5081444                    /usr/lib/python2.7/site-packages/meshpy/_tetgen.so
7f5bdb1d0000-7f5bdb211000 rw-p 00000000 00:00 0 
7f5bdb211000-7f5bdb218000 r-xp 00000000 00:12 4715514                    /usr/lib/python2.7/lib-dynload/_struct.so
7f5bdb218000-7f5bdb417000 ---p 00007000 00:12 4715514                    /usr/lib/python2.7/lib-dynload/_struct.so
7f5bdb417000-7f5bdb418000 r--p 00006000 00:12 4715514                    /usr/lib/python2.7/lib-dynload/_struct.so
7f5bdb418000-7f5bdb41a000 rw-p 00007000 00:12 4715514                    /usr/lib/python2.7/lib-dynload/_struct.so
7f5bdb41a000-7f5bdb421000 r-xp 00000000 00:12 5028234                    /usr/lib/libffi.so.6.0.2
7f5bdb421000-7f5bdb621000 ---p 00007000 00:12 5028234                    /usr/lib/libffi.so.6.0.2
7f5bdb621000-7f5bdb622000 r--p 00007000 00:12 5028234                    /usr/lib/libffi.so.6.0.2
7f5bdb622000-7f5bdb623000 rw-p 00008000 00:12 5028234                    /usr/lib/libffi.so.6.0.2
7f5bdb624000-7f5bdb664000 rw-p 00000000 00:00 0 
7f5bdb664000-7f5bdb67e000 r-xp 00000000 00:12 4715469                    /usr/lib/python2.7/lib-dynload/_ctypes.so
7f5bdb67e000-7f5bdb87d000 ---p 0001a000 00:12 4715469                    /usr/lib/python2.7/lib-dynload/_ctypes.so
7f5bdb87d000-7f5bdb87e000 r--p 00019000 00:12 4715469                    /usr/lib/python2.7/lib-dynload/_ctypes.so
7f5bdb87e000-7f5bdb883000 rw-p 0001a000 00:12 4715469                    /usr/lib/python2.7/lib-dynload/_ctypes.so
7f5bdb883000-7f5bdb8c3000 rw-p 00000000 00:00 0 
7f5bdb8c3000-7f5bdb91d000 r-xp 00000000 00:12 5061773                    /usr/lib/python2.7/site-packages/numpy/random/mtrand.so
7f5bdb91d000-7f5bdbb1c000 ---p 0005a000 00:12 5061773                    /usr/lib/python2.7/site-packages/numpy/random/mtrand.so
7f5bdbb1c000-7f5bdbb1d000 r--p 00059000 00:12 5061773                    /usr/lib/python2.7/site-packages/numpy/random/mtrand.so
7f5bdbb1d000-7f5bdbb56000 rw-p 0005a000 00:12 5061773                    /usr/lib/python2.7/site-packages/numpy/random/mtrand.so
7f5bdbb56000-7f5bdbb97000 rw-p 00000000 00:00 0 
7f5bdbb97000-7f5bdbba0000 r-xp 00000000 00:12 5061809                    /usr/lib/python2.7/site-packages/numpy/fft/fftpack_lite.so
7f5bdbba0000-7f5bdbda0000 ---p 00009000 00:12 5061809                    /usr/lib/python2.7/site-packages/numpy/fft/fftpack_lite.so
7f5bdbda0000-7f5bdbda1000 r--p 00009000 00:12 5061809                    /usr/lib/python2.7/site-packages/numpy/fft/fftpack_lite.so
7f5bdbda1000-7f5bdbda2000 rw-p 0000a000 00:12 5061809                    /usr/lib/python2.7/site-packages/numpy/fft/fftpack_lite.so
7f5bdbda2000-7f5bdbda3000 r-xp 00000000 00:12 4715493                    /usr/lib/python2.7/lib-dynload/future_builtins.so
7f5bdbda3000-7f5bdbfa2000 ---p 00001000 00:12 4715493                    /usr/lib/python2.7/lib-dynload/future_builtins.so
7f5bdbfa2000-7f5bdbfa3000 r--p 00000000 00:12 4715493                    /usr/lib/python2.7/lib-dynload/future_builtins.so
7f5bdbfa3000-7f5bdbfa4000 rw-p 00001000 00:12 4715493                    /usr/lib/python2.7/lib-dynload/future_builtins.so
7f5bdbfa4000-7f5bdbfc4000 r-xp 00000000 00:12 5061789                    /usr/lib/python2.7/site-packages/numpy/linalg/_umath_linalg.so
7f5bdbfc4000-7f5bdc1c3000 ---p 00020000 00:12 5061789                    /usr/lib/python2.7/site-packages/numpy/linalg/_umath_linalg.so
7f5bdc1c3000-7f5bdc1c4000 r--p 0001f000 00:12 5061789                    /usr/lib/python2.7/site-packages/numpy/linalg/_umath_linalg.so
7f5bdc1c4000-7f5bdc1c5000 rw-p 00020000 00:12 5061789                    /usr/lib/python2.7/site-packages/numpy/linalg/_umath_linalg.so
7f5bdc1c5000-7f5bdc202000 r-xp 00000000 00:12 5001662                    /usr/lib/libquadmath.so.0.0.0
7f5bdc202000-7f5bdc401000 ---p 0003d000 00:12 5001662                    /usr/lib/libquadmath.so.0.0.0
7f5bdc401000-7f5bdc402000 rw-p 0003c000 00:12 5001662                    /usr/lib/libquadmath.so.0.0.0
7f5bdc402000-7f5bdc418000 r-xp 00000000 00:12 5001645                    /usr/lib/libgcc_s.so.1
7f5bdc418000-7f5bdc617000 ---p 00016000 00:12 5001645                    /usr/lib/libgcc_s.so.1
7f5bdc617000-7f5bdc618000 rw-p 00015000 00:12 5001645                    /usr/lib/libgcc_s.so.1
7f5bdc618000-7f5bdc73d000 r-xp 00000000 00:12 5001655                    /usr/lib/libgfortran.so.3.0.0
7f5bdc73d000-7f5bdc93d000 ---p 00125000 00:12 5001655                    /usr/lib/libgfortran.so.3.0.0
7f5bdc93d000-7f5bdc93f000 rw-p 00125000 00:12 5001655                    /usr/lib/libgfortran.so.3.0.0
7f5bdc93f000-7f5bdc996000 r-xp 00000000 00:12 2419838                    /usr/lib/libblas.so
7f5bdc996000-7f5bdcb95000 ---p 00057000 00:12 2419838                    /usr/lib/libblas.so
7f5bdcb95000-7f5bdcb96000 r--p 00056000 00:12 2419838                    /usr/lib/libblas.so
7f5bdcb96000-7f5bdcb97000 rw-p 00057000 00:12 2419838                    /usr/lib/libblas.so
7f5bdcb97000-7f5bdd12f000 r-xp 00000000 00:12 2420263                    /usr/lib/liblapack.so
7f5bdd12f000-7f5bdd32e000 ---p 00598000 00:12 2420263                    /usr/lib/liblapack.so
7f5bdd32e000-7f5bdd32f000 r--p 00597000 00:12 2420263                    /usr/lib/liblapack.so
7f5bdd32f000-7f5bdd332000 rw-p 00598000 00:12 2420263                    /usr/lib/liblapack.so
7f5bdd332000-7f5bdd440000 rw-p 00000000 00:00 0 
7f5bdd441000-7f5bdd481000 rw-p 00000000 00:00 0 
7f5bdd481000-7f5bdd484000 r-xp 00000000 00:12 5061788                    /usr/lib/python2.7/site-packages/numpy/linalg/lapack_lite.so
7f5bdd484000-7f5bdd684000 ---p 00003000 00:12 5061788                    /usr/lib/python2.7/site-packages/numpy/linalg/lapack_lite.so
7f5bdd684000-7f5bdd685000 r--p 00003000 00:12 5061788                    /usr/lib/python2.7/site-packages/numpy/linalg/lapack_lite.so
7f5bdd685000-7f5bdd686000 rw-p 00004000 00:12 5061788                    /usr/lib/python2.7/site-packages/numpy/linalg/lapack_lite.so
7f5bdd686000-7f5bdd68c000 r-xp 00000000 00:12 5061887                    /usr/lib/python2.7/site-packages/numpy/lib/_compiled_base.so
7f5bdd68c000-7f5bdd88c000 ---p 00006000 00:12 5061887                    /usr/lib/python2.7/site-packages/numpy/lib/_compiled_base.so
7f5bdd88c000-7f5bdd88d000 r--p 00006000 00:12 5061887                    /usr/lib/python2.7/site-packages/numpy/lib/_compiled_base.so
7f5bdd88d000-7f5bdd88e000 rw-p 00007000 00:12 5061887                    /usr/lib/python2.7/site-packages/numpy/lib/_compiled_base.so
7f5bdd88e000-7f5bdd891000 r-xp 00000000 00:12 4715525                    /usr/lib/python2.7/lib-dynload/fcntl.so
7f5bdd891000-7f5bdda90000 ---p 00003000 00:12 4715525                    /usr/lib/python2.7/lib-dynload/fcntl.so
7f5bdda90000-7f5bdda91000 r--p 00002000 00:12 4715525                    /usr/lib/python2.7/lib-dynload/fcntl.so
7f5bdda91000-7f5bdda93000 rw-p 00003000 00:12 4715525                    /usr/lib/python2.7/lib-dynload/fcntl.so
7f5bdda93000-7f5bdda96000 r-xp 00000000 00:12 4715517                    /usr/lib/python2.7/lib-dynload/_random.so
7f5bdda96000-7f5bddc95000 ---p 00003000 00:12 4715517                    /usr/lib/python2.7/lib-dynload/_random.so
7f5bddc95000-7f5bddc96000 r--p 00002000 00:12 4715517                    /usr/lib/python2.7/lib-dynload/_random.so
7f5bddc96000-7f5bddc97000 rw-p 00003000 00:12 4715517                    /usr/lib/python2.7/lib-dynload/_random.so
7f5bddc97000-7f5bdde7d000 r-xp 00000000 00:12 4839855                    /usr/lib/libcrypto.so.1.0.0
7f5bdde7d000-7f5bde07d000 ---p 001e6000 00:12 4839855                    /usr/lib/libcrypto.so.1.0.0
7f5bde07d000-7f5bde099000 r--p 001e6000 00:12 4839855                    /usr/lib/libcrypto.so.1.0.0
7f5bde099000-7f5bde0a5000 rw-p 00202000 00:12 4839855                    /usr/lib/libcrypto.so.1.0.0
7f5bde0a5000-7f5bde0a9000 rw-p 00000000 00:00 0 
7f5bde0aa000-7f5bde0ea000 rw-p 00000000 00:00 0 
7f5bde0ea000-7f5bde0ee000 r-xp 00000000 00:12 4715473                    /usr/lib/python2.7/lib-dynload/_hashlib.so
7f5bde0ee000-7f5bde2ed000 ---p 00004000 00:12 4715473                    /usr/lib/python2.7/lib-dynload/_hashlib.so
7f5bde2ed000-7f5bde2ee000 r--p 00003000 00:12 4715473                    /usr/lib/python2.7/lib-dynload/_hashlib.so
7f5bde2ee000-7f5bde2ef000 rw-p 00004000 00:12 4715473                    /usr/lib/python2.7/lib-dynload/_hashlib.so
7f5bde2ef000-7f5bde304000 r-xp 00000000 00:12 1742774                    /usr/lib/libz.so.1.2.8
7f5bde304000-7f5bde503000 ---p 00015000 00:12 1742774                    /usr/lib/libz.so.1.2.8
7f5bde503000-7f5bde504000 r--p 00014000 00:12 1742774                    /usr/lib/libz.so.1.2.8
7f5bde504000-7f5bde505000 rw-p 00015000 00:12 1742774                    /usr/lib/libz.so.1.2.8
7f5bde506000-7f5bde546000 rw-p 00000000 00:00 0 
7f5bde546000-7f5bde54b000 r-xp 00000000 00:12 4715503                    /usr/lib/python2.7/lib-dynload/binascii.so
7f5bde54b000-7f5bde74a000 ---p 00005000 00:12 4715503                    /usr/lib/python2.7/lib-dynload/binascii.so
7f5bde74a000-7f5bde74b000 r--p 00004000 00:12 4715503                    /usr/lib/python2.7/lib-dynload/binascii.so
7f5bde74b000-7f5bde74c000 rw-p 00005000 00:12 4715503                    /usr/lib/python2.7/lib-dynload/binascii.so
7f5bde74c000-7f5bde768000 r-xp 00000000 00:12 4715518                    /usr/lib/python2.7/lib-dynload/_io.so
7f5bde768000-7f5bde968000 ---p 0001c000 00:12 4715518                    /usr/lib/python2.7/lib-dynload/_io.so
7f5bde968000-7f5bde969000 r--p 0001c000 00:12 4715518                    /usr/lib/python2.7/lib-dynload/_io.so
7f5bde969000-7f5bde973000 rw-p 0001d000 00:12 4715518                    /usr/lib/python2.7/lib-dynload/_io.so
7f5bde973000-7f5bde975000 r-xp 00000000 00:12 4715467                    /usr/lib/python2.7/lib-dynload/grp.so
7f5bde975000-7f5bdeb74000 ---p 00002000 00:12 4715467                    /usr/lib/python2.7/lib-dynload/grp.so
7f5bdeb74000-7f5bdeb75000 r--p 00001000 00:12 4715467                    /usr/lib/python2.7/lib-dynload/grp.so
7f5bdeb75000-7f5bdeb76000 rw-p 00002000 00:12 4715467                    /usr/lib/python2.7/lib-dynload/grp.so
7f5bdeb76000-7f5bdebb6000 rw-p 00000000 00:00 0 
7f5bdebb6000-7f5bdebba000 r-xp 00000000 00:12 4715481                    /usr/lib/python2.7/lib-dynload/time.so
7f5bdebba000-7f5bdedb9000 ---p 00004000 00:12 4715481                    /usr/lib/python2.7/lib-dynload/time.so
7f5bdedb9000-7f5bdedba000 r--p 00003000 00:12 4715481                    /usr/lib/python2.7/lib-dynload/time.so
7f5bdedba000-7f5bdedbc000 rw-p 00004000 00:12 4715481                    /usr/lib/python2.7/lib-dynload/time.so
7f5bdedbc000-7f5bdeebd000 rw-p 00000000 00:00 0 
7f5bdeebd000-7f5bdeee9000 r-xp 00000000 00:12 5061972                    /usr/lib/python2.7/site-packages/numpy/core/scalarmath.so
7f5bdeee9000-7f5bdf0e8000 ---p 0002c000 00:12 5061972                    /usr/lib/python2.7/site-packages/numpy/core/scalarmath.so
7f5bdf0e8000-7f5bdf0e9000 r--p 0002b000 00:12 5061972                    /usr/lib/python2.7/site-packages/numpy/core/scalarmath.so
7f5bdf0e9000-7f5bdf0eb000 rw-p 0002c000 00:12 5061972                    /usr/lib/python2.7/site-packages/numpy/core/scalarmath.so
7f5bdf0eb000-7f5bdf12b000 rw-p 00000000 00:00 0 
7f5bdf12b000-7f5bdf12e000 r-xp 00000000 00:12 4715477                    /usr/lib/python2.7/lib-dynload/_functools.so
7f5bdf12e000-7f5bdf32d000 ---p 00003000 00:12 4715477                    /usr/lib/python2.7/lib-dynload/_functools.so
7f5bdf32d000-7f5bdf32e000 r--p 00002000 00:12 4715477                    /usr/lib/python2.7/lib-dynload/_functools.so
7f5bdf32e000-7f5bdf32f000 rw-p 00003000 00:12 4715477                    /usr/lib/python2.7/lib-dynload/_functools.so
7f5bdf32f000-7f5bdf333000 r-xp 00000000 00:12 4715494                    /usr/lib/python2.7/lib-dynload/cStringIO.so
7f5bdf333000-7f5bdf532000 ---p 00004000 00:12 4715494                    /usr/lib/python2.7/lib-dynload/cStringIO.so
7f5bdf532000-7f5bdf533000 r--p 00003000 00:12 4715494                    /usr/lib/python2.7/lib-dynload/cStringIO.so
7f5bdf533000-7f5bdf535000 rw-p 00004000 00:12 4715494                    /usr/lib/python2.7/lib-dynload/cStringIO.so
7f5bdf535000-7f5bdf548000 r-xp 00000000 00:12 4715498                    /usr/lib/python2.7/lib-dynload/cPickle.so
7f5bdf548000-7f5bdf747000 ---p 00013000 00:12 4715498                    /usr/lib/python2.7/lib-dynload/cPickle.so
7f5bdf747000-7f5bdf748000 r--p 00012000 00:12 4715498                    /usr/lib/python2.7/lib-dynload/cPickle.so
7f5bdf748000-7f5bdf749000 rw-p 00013000 00:12 4715498                    /usr/lib/python2.7/lib-dynload/cPickle.so
7f5bdf749000-7f5bdf74c000 r-xp 00000000 00:12 4715464                    /usr/lib/python2.7/lib-dynload/_heapq.so
7f5bdf74c000-7f5bdf94b000 ---p 00003000 00:12 4715464                    /usr/lib/python2.7/lib-dynload/_heapq.so
7f5bdf94b000-7f5bdf94c000 r--p 00002000 00:12 4715464                    /usr/lib/python2.7/lib-dynload/_heapq.so
7f5bdf94c000-7f5bdf94e000 rw-p 00003000 00:12 4715464                    /usr/lib/python2.7/lib-dynload/_heapq.so
7f5bdf94e000-7f5bdf958000 r-xp 00000000 00:12 4715480                    /usr/lib/python2.7/lib-dynload/itertools.so
7f5bdf958000-7f5bdfb57000 ---p 0000a000 00:12 4715480                    /usr/lib/python2.7/lib-dynload/itertools.so
7f5bdfb57000-7f5bdfb58000 r--p 00009000 00:12 4715480                    /usr/lib/python2.7/lib-dynload/itertools.so
7f5bdfb58000-7f5bdfb5d000 rw-p 0000a000 00:12 4715480                    /usr/lib/python2.7/lib-dynload/itertools.so
7f5bdfb5d000-7f5bdfb9d000 rw-p 00000000 00:00 0 
7f5bdfb9d000-7f5bdfba6000 r-xp 00000000 00:12 4715488                    /usr/lib/python2.7/lib-dynload/operator.so
7f5bdfba6000-7f5bdfda5000 ---p 00009000 00:12 4715488                    /usr/lib/python2.7/lib-dynload/operator.so
7f5bdfda5000-7f5bdfda6000 r--p 00008000 00:12 4715488                    /usr/lib/python2.7/lib-dynload/operator.so
7f5bdfda6000-7f5bdfda8000 rw-p 00009000 00:12 4715488                    /usr/lib/python2.7/lib-dynload/operator.so
7f5bdfda8000-7f5bdfdae000 r-xp 00000000 00:12 4715521                    /usr/lib/python2.7/lib-dynload/_collections.so
7f5bdfdae000-7f5bdffad000 ---p 00006000 00:12 4715521                    /usr/lib/python2.7/lib-dynload/_collections.so
7f5bdffad000-7f5bdffae000 r--p 00005000 00:12 4715521                    /usr/lib/python2.7/lib-dynload/_collections.so
7f5bdffae000-7f5bdffb0000 rw-p 00006000 00:12 4715521                    /usr/lib/python2.7/lib-dynload/_collections.so
7f5bdffb0000-7f5be0026000 r-xp 00000000 00:12 5061971                    /usr/lib/python2.7/site-packages/numpy/core/umath.so
7f5be0026000-7f5be0226000 ---p 00076000 00:12 5061971                    /usr/lib/python2.7/site-packages/numpy/core/umath.so
7f5be0226000-7f5be0227000 r--p 00076000 00:12 5061971                    /usr/lib/python2.7/site-packages/numpy/core/umath.so
7f5be0227000-7f5be022c000 rw-p 00077000 00:12 5061971                    /usr/lib/python2.7/site-packages/numpy/core/umath.so
7f5be022c000-7f5be022e000 rw-p 00000000 00:00 0 
7f5be022e000-7f5be023f000 r-xp 00000000 00:12 4715461                    /usr/lib/python2.7/lib-dynload/datetime.so
7f5be023f000-7f5be043f000 ---p 00011000 00:12 4715461                    /usr/lib/python2.7/lib-dynload/datetime.so
7f5be043f000-7f5be0440000 r--p 00011000 00:12 4715461                    /usr/lib/python2.7/lib-dynload/datetime.so
7f5be0440000-7f5be0444000 rw-p 00012000 00:12 4715461                    /usr/lib/python2.7/lib-dynload/datetime.so
7f5be0444000-7f5be05aa000 r-xp 00000000 00:12 5061970                    /usr/lib/python2.7/site-packages/numpy/core/multiarray.so
7f5be05aa000-7f5be07aa000 ---p 00166000 00:12 5061970                    /usr/lib/python2.7/site-packages/numpy/core/multiarray.so
7f5be07aa000-7f5be07ac000 r--p 00166000 00:12 5061970                    /usr/lib/python2.7/site-packages/numpy/core/multiarray.so
7f5be07ac000-7f5be07ba000 rw-p 00168000 00:12 5061970                    /usr/lib/python2.7/site-packages/numpy/core/multiarray.so
7f5be07ba000-7f5be07cc000 rw-p 00000000 00:00 0 
7f5be07cc000-7f5be07d3000 r-xp 00000000 00:12 4715516                    /usr/lib/python2.7/lib-dynload/math.so
7f5be07d3000-7f5be09d2000 ---p 00007000 00:12 4715516                    /usr/lib/python2.7/lib-dynload/math.so
7f5be09d2000-7f5be09d3000 r--p 00006000 00:12 4715516                    /usr/lib/python2.7/lib-dynload/math.so
7f5be09d3000-7f5be09d5000 rw-p 00007000 00:12 4715516                    /usr/lib/python2.7/lib-dynload/math.so
7f5be09d5000-7f5be1088000 r--p 00000000 00:12 5036759                    /usr/lib/locale/locale-archive
7f5be1088000-7f5be118b000 r-xp 00000000 00:12 5072453                    /usr/lib/libm-2.20.so
7f5be118b000-7f5be138b000 ---p 00103000 00:12 5072453                    /usr/lib/libm-2.20.so
7f5be138b000-7f5be138c000 r--p 00103000 00:12 5072453                    /usr/lib/libm-2.20.so
7f5be138c000-7f5be138d000 rw-p 00104000 00:12 5072453                    /usr/lib/libm-2.20.so
7f5be138d000-7f5be138f000 r-xp 00000000 00:12 5072496                    /usr/lib/libutil-2.20.so
7f5be138f000-7f5be158e000 ---p 00002000 00:12 5072496                    /usr/lib/libutil-2.20.so
7f5be158e000-7f5be158f000 r--p 00001000 00:12 5072496                    /usr/lib/libutil-2.20.so
7f5be158f000-7f5be1590000 rw-p 00002000 00:12 5072496                    /usr/lib/libutil-2.20.so
7f5be1590000-7f5be1593000 r-xp 00000000 00:12 5072427                    /usr/lib/libdl-2.20.so
7f5be1593000-7f5be1792000 ---p 00003000 00:12 5072427                    /usr/lib/libdl-2.20.so
7f5be1792000-7f5be1793000 r--p 00002000 00:12 5072427                    /usr/lib/libdl-2.20.so
7f5be1793000-7f5be1794000 rw-p 00003000 00:12 5072427                    /usr/lib/libdl-2.20.so
7f5be1794000-7f5be192e000 r-xp 00000000 00:12 5072454                    /usr/lib/libc-2.20.so
7f5be192e000-7f5be1b2d000 ---p 0019a000 00:12 5072454                    /usr/lib/libc-2.20.so
7f5be1b2d000-7f5be1b31000 r--p 00199000 00:12 5072454                    /usr/lib/libc-2.20.so
7f5be1b31000-7f5be1b33000 rw-p 0019d000 00:12 5072454                    /usr/lib/libc-2.20.so
7f5be1b33000-7f5be1b37000 rw-p 00000000 00:00 0 
7f5be1b37000-7f5be1b4e000 r-xp 00000000 00:12 5072434                    /usr/lib/libpthread-2.20.so
7f5be1b4e000-7f5be1d4d000 ---p 00017000 00:12 5072434                    /usr/lib/libpthread-2.20.so
7f5be1d4d000-7f5be1d4e000 r--p 00016000 00:12 5072434                    /usr/lib/libpthread-2.20.so
7f5be1d4e000-7f5be1d4f000 rw-p 00017000 00:12 5072434                    /usr/lib/libpthread-2.20.so
7f5be1d4f000-7f5be1d53000 rw-p 00000000 00:00 0 
7f5be1d53000-7f5be1ecd000 r-xp 00000000 00:12 4714557                    /usr/lib/libpython2.7.so.1.0
7f5be1ecd000-7f5be20cd000 ---p 0017a000 00:12 4714557                    /usr/lib/libpython2.7.so.1.0
7f5be20cd000-7f5be20ce000 r--p 0017a000 00:12 4714557                    /usr/lib/libpython2.7.so.1.0
7f5be20ce000-7f5be2111000 rw-p 0017b000 00:12 4714557                    /usr/lib/libpython2.7.so.1.0
7f5be2111000-7f5be2120000 rw-p 00000000 00:00 0 
7f5be2120000-7f5be2142000 r-xp 00000000 00:12 5072431                    /usr/lib/ld-2.20.so
7f5be214a000-7f5be224a000 rw-p 00000000 00:00 0 
7f5be227a000-7f5be2300000 rw-p 00000000 00:00 0 
7f5be2300000-7f5be2301000 rwxp 00000000 00:00 0 
7f5be2301000-7f5be2341000 rw-p 00000000 00:00 0 
7f5be2341000-7f5be2342000 r--p 00021000 00:12 5072431                    /usr/lib/ld-2.20.so
7f5be2342000-7f5be2343000 rw-p 00022000 00:12 5072431                    /usr/lib/ld-2.20.so
7f5be2343000-7f5be2344000 rw-p 00000000 00:00 0 
7fff2b2d9000-7fff2b311000 rw-p 00000000 00:00 0                          [stack]
7fff2b3fc000-7fff2b3fe000 r-xp 00000000 00:00 0                          [vdso]
7fff2b3fe000-7fff2b400000 r--p 00000000 00:00 0                          [vvar]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)

generate tuples for quadrilateral elements

Hello,

I'm trying to work on adding support for quadrilateral elements
(Quadrangle, Quadrangle8, Quadrangle9)

How can I generate appropriate tuples with generate_nonnegative_integer_tuples_summing_to_at_most tool?

I have added

def generate_quadrangle_vertex_tuples(order):
    yield (0, 0)
    yield (order, 0)
    yield (order,order)
    yield (0, order)


def generate_quadrangle_edge_tuples(order):
    for i in range(1, order):
        yield (i, 0)
    for i in range(1, order):
        yield (order, i)
    for i in range(1, order):
        yield (i, order)
    for i in range(1, order):
        yield (0, i)


def generate_quadrangle_volume_tuples(order):
    for i in range(1, order):
        for j in range(1, order):
            yield (j, i)

and

class GmshIncompleteQuadrilateralElement(GmshElementBase):
    dimensions = 2

    def __init__(self, order):
        self.order = order

    @memoize_method
    def gmsh_node_tuples(self):
        result = []
        for tup in generate_quadrangle_vertex_tuples(self.order):
            result.append(tup)
        for tup in generate_quadrangle_edge_tuples(self.order):
            result.append(tup)
        return result


class GmshQuadrilateralElement(GmshElementBase):
    dimensions = 2

    @memoize_method
    def gmsh_node_tuples(self):
        result = []
        for tup in generate_quadrangle_vertex_tuples(self.order):
            result.append(tup)
        for tup in generate_quadrangle_edge_tuples(self.order):
            result.append(tup)
        for tup in generate_quadrangle_volume_tuples(self.order):
            result.append(tup)
        return result

which generate:

el = GmshQuadrilateralElement(1)
el.gmsh_node_tuples()

[(0, 0), (1, 0), (1, 1), (0, 1)]

el = GmshQuadrilateralElement(2)
el.gmsh_node_tuples()

[(0, 0), (2, 0), (2, 2), (0, 2), (1, 0), (2, 1), (1, 2), (0, 1), (1, 1)]

el = GmshIncompleteQuadrilateralElement(2)
el.gmsh_node_tuples()

[(0, 0), (2, 0), (2, 2), (0, 2), (1, 0), (2, 1), (1, 2), (0, 1)]

but the node numbering is not compatible (sum of integers > self.order | self.dimension) with tuples returned by lexicographic_node_tuples.

Thanks

TetGen - edge adjacent tet list

In the src/cpp/tetgen files I see the "edgeadjtetlist" that is set as it should be when the -nn switch is set, but I can't seem to find where this data gets dumped on the Python side. How can I access it?

Thanks!

Build fails on Win10

Case 1
Tried to install today MessPy as part of a lot of other packages.

But I always end up with an error message:

Using legacy 'setup.py install' for meshpy, since package 'wheel' is not installed.
Installing collected packages: meshpy, OpenGlider
    Running setup.py install for meshpy ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\user\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-_nudxgj2\\meshpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-_nudxgj2\\meshpy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\user\AppData\Local\Temp\pip-record-n7qi04l7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\user\appdata\local\programs\python\python38\Include\meshpy'
         cwd: C:\Users\user\AppData\Local\Temp\pip-install-_nudxgj2\meshpy\
    Complete output (24 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.8
    creating build\lib.win-amd64-3.8\meshpy
    copying meshpy\common.py -> build\lib.win-amd64-3.8\meshpy
    copying meshpy\geometry.py -> build\lib.win-amd64-3.8\meshpy
    copying meshpy\gmsh.py -> build\lib.win-amd64-3.8\meshpy
    copying meshpy\gmsh_reader.py -> build\lib.win-amd64-3.8\meshpy
    copying meshpy\naca.py -> build\lib.win-amd64-3.8\meshpy
    copying meshpy\ply.py -> build\lib.win-amd64-3.8\meshpy
    copying meshpy\tet.py -> build\lib.win-amd64-3.8\meshpy
    copying meshpy\tools.py -> build\lib.win-amd64-3.8\meshpy
    copying meshpy\triangle.py -> build\lib.win-amd64-3.8\meshpy
    copying meshpy\__init__.py -> build\lib.win-amd64-3.8\meshpy
    running build_ext
    building 'meshpy._internals' extension
    creating build\temp.win-amd64-3.8
    creating build\temp.win-amd64-3.8\Release
    creating build\temp.win-amd64-3.8\Release\src
    creating build\temp.win-amd64-3.8\Release\src\cpp
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DEXTERNAL_TEST=1 -DANSI_DECLARATORS=1 -DTRILIBRARY=1 -DTETLIBRARY=1 -DSELF_CHECK=1 -Ic:\users\user\appdata\local\programs\python\python38\lib\site-packages\pybind11\include -Ic:\users\user\appdata\local\programs\python\python38\lib\site-packages\pybind11\include -Isrc/cpp -Ic:\users\user\appdata\local\programs\python\python38\include -Ic:\users\user\appdata\local\programs\python\python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /EHsc /Tpsrc/cpp/wrapper.cpp /Fobuild\temp.win-amd64-3.8\Release\src/cpp/wrapper.obj /EHsc /DVERSION_INFO=\"2020.1\"
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status -1073741701
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\user\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-_nudxgj2\\meshpy\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-_nudxgj2\\meshpy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\user\AppData\Local\Temp\pip-record-n7qi04l7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\user\appdata\local\programs\python\python38\Include\meshpy' Check the logs for full command output.

Therefore I've tried to go further and download, compile, .. directly from github. But struggled there as well as you can see below:

Case 2
Synced today from github the master branch.

Then

 .\configure.py
python setup.py install

What I get as output is:

---------------------------------------------------------------------------
Trouble invoking git
---------------------------------------------------------------------------
The package directory appears to be a git repository, but I could
not invoke git to check whether my submodules are up to date.

The error was:
(OS error, likely git not found)
Hit Ctrl-C now if you'd like to think about the situation.
---------------------------------------------------------------------------

running install
running bdist_egg
running egg_info
creating MeshPy.egg-info
writing MeshPy.egg-info\PKG-INFO
writing dependency_links to MeshPy.egg-info\dependency_links.txt
writing requirements to MeshPy.egg-info\requires.txt
writing top-level names to MeshPy.egg-info\top_level.txt
writing manifest file 'MeshPy.egg-info\SOURCES.txt'
reading manifest file 'MeshPy.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'doc\_static\*.css'
warning: no files found matching 'doc\_templates\*.html'
writing manifest file 'MeshPy.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\meshpy
copying meshpy\common.py -> build\lib.win-amd64-3.8\meshpy
copying meshpy\geometry.py -> build\lib.win-amd64-3.8\meshpy
copying meshpy\gmsh.py -> build\lib.win-amd64-3.8\meshpy
copying meshpy\gmsh_reader.py -> build\lib.win-amd64-3.8\meshpy
copying meshpy\naca.py -> build\lib.win-amd64-3.8\meshpy
copying meshpy\ply.py -> build\lib.win-amd64-3.8\meshpy
copying meshpy\tet.py -> build\lib.win-amd64-3.8\meshpy
copying meshpy\tools.py -> build\lib.win-amd64-3.8\meshpy
copying meshpy\triangle.py -> build\lib.win-amd64-3.8\meshpy
copying meshpy\__init__.py -> build\lib.win-amd64-3.8\meshpy
running build_ext
building 'meshpy._internals' extension
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\src
creating build\temp.win-amd64-3.8\Release\src\cpp
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DEXTERNAL_TEST=1 -DANSI_DECLARATORS=1 -DTRILIBRARY=1 -DTETLIBRARY=1 -DSELF_CHECK=1 -IC:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pybind11\include -IC:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\pybind11\include -Isrc/cpp -IC:\Users\user\AppData\Local\Programs\Python\Python38\include -IC:\Users\user\AppData\Local\Programs\Python\Python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /EHsc /Tpsrc/cpp/wrapper.cpp /Fobuild\temp.win-amd64-3.8\Release\src/cpp/wrapper.obj /EHsc /DVERSION_INFO=\"2020.1\"
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status -1073741701

So the question is where to go on:

  • meshpy problem?
  • my environment?
  • myself ;-)?

Installation on windows

It looks like to install meshpy you need a UNIX machine. Is there the possibility of getting a windows supported meshpy release? I am not sure how many things had to be changed, but I think that just taking out the timing (sys/time.h does not exist on windows) may be enough.

I can help with that but I am quite new to python and don't know much about UNIX-WINDOWS differences at this level. I offer my help anyways.

version -> __version__

meshpy publishes its version under meshpy.version, but more common would be

meshpy.__version__

Basically all major Python software packages do this.

How to make 2D mesh?

I find myself needing to create a mesh, I have never really been working with this kind of software before.

I though this should work

from meshpy.triangle import MeshInfo, build, write_gnuplot_mesh

meshinfo = MeshInfo()

meshinfo.set_points([(0, 0), (1, 0), (1, 1), (0, 1)])
meshinfo.set_facets([[0, 1, 2, 3]])

result = build(meshinfo, verbose=True)
write_gnuplot_mesh("plot", result)

Basically the result I was hoping for was to get the square subdivided by triangles. But the program threw this error

Traceback (most recent call last):
  File "/home/jonas/tmp/testmeshpy/test.py", line 6, in <module>
    meshinfo.set_facets([[0, 1, 2, 3]])
  File "/home/jonas/tmp/testmeshpy/.venv/lib/python3.6/site-packages/meshpy/triangle.py", line 54, in set_facets
    self.facets[i] = facet
ValueError: value must be a sequence of length self.unit

Could you please provide a 2D example, such as the 3D one provided here? https://mathema.tician.de/software/meshpy/. For a new-comer I find it very difficulty understanding the terminology and the documentation, I am for example assuming that a facet is a surface?

My logic for the code above is that I am assuming that with set_points i define the edges of my surfaces and then with set_facets i define the points that make up some surface?

tet.write_vtk() fails when using load_stl()

When I use load_stl() to import a geometry (I checked the syntax of the stl file), tet.build() seems to give elements with point numbers starting from 1, not from 0. As a result, write_vtk() systematically fails with the following error (thrown by pyvtk):

ValueError: In cell tetra: must be (seq of seq|seq) integers less than NNN

where NNN is the total number of vertices. The following workaround resolves the problem:

for (i, p) in enumerate (mesh.elements):
    mesh.elements[i] = [(p[j] - 1) for j in range(4)]

Cannot create a copy of a built MeshInfo object

Python crashes after trying to copy a MeshInfo object in which the triangular mesh has been built.

In the below example I am able to create a copy of mesh with mesh2. However when trying to create a copy of the built mesh mesh3 with mesh4, python crashes.

Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from meshpy import triangle
>>> points = [(0, 0), (50, 0), (50, 50), (0, 50)]
>>> facets = [(0, 1), (1, 2), (2, 3), (3, 0)]
>>> holes = []
>>> mesh = triangle.MeshInfo()
>>> mesh.set_points(points)
>>> mesh.set_facets(facets)
>>> mesh.set_holes(holes)
>>> mesh2 = mesh.copy()
>>> mesh3 = triangle.build(mesh)
>>> mesh4 = mesh3.copy()
Segmentation fault: 11

gmsh_read fails to read quadratic triangular mesh

Hello and thank you for your great work,
I have generated a quadratic triangular mesh file:
tcav.txt

but gmsh_read parses it as linear triangular mesh file. Here is the code I used to parse the mesh:

from meshpy import gmsh_reader

mesh_info = gmsh_reader.GmshMeshReceiverNumPy()
filename = gmsh_reader.FileSource("./mesh/tcav.txt")
gmsh_reader.read_gmsh(mesh_info,filename.filename,force_dimension=None)
mesh_info.elements

result:

[array([0]),
array([1]),
array([2]),
array([0, 3]),
array([3, 4]),
array([4, 5]),
array([5, 6]),
array([6, 1]),
array([ 1, 12]),
array([12, 13]),
array([13, 14]),
array([14, 15]),
array([15, 2]),
array([ 2, 21]),
array([21, 22]),
array([22, 23]),
array([23, 24]),
array([24, 0]),
array([15, 21, 32]),
array([ 6, 12, 33]),
array([21, 22, 32]),
array([ 5, 6, 33]),
array([12, 13, 33]),
array([14, 15, 32]),
array([21, 15, 2]),
array([ 0, 3, 24]),
array([ 6, 1, 12]),
array([ 3, 31, 24]),
array([23, 24, 31]),
array([ 3, 4, 31]),
array([23, 31, 35]),
array([ 4, 34, 31]),
array([22, 23, 35]),
array([ 4, 5, 34]),
array([22, 35, 32]),
array([ 5, 33, 34]),
array([30, 35, 31]),
array([30, 31, 34]),
array([30, 36, 32]),
array([30, 33, 36]),
array([13, 14, 36]),
array([14, 32, 36]),
array([13, 36, 33]),
array([30, 32, 35]),
array([30, 34, 33])]

as you see there're three-node interior elements and two-node boundary elements instead of six-node interior elements and three-node boundary elements.

meshpy missing dependencies gcc and pybind11 with 'conda install meshpy'

as i say in the title, when i tried to $ pip install meshpy,

  1. i had an error with libstd++.h (??) I dont remember the exact name of .h missing)
  2. i installed gcc : $ conda install gcc
  3. Then i tried $ pip uninstall meshpy followed by $ pip install meshpy the installation complains about some clang++ and pybind11 missing
  4. I installed pybind11 with $ conda install pybind11
  5. finally $ pip uninstall conda followed by $ pip install conda succeeded.
    and that's it, meshpy is installed

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.