Comments (7)
By volume you mean the enclosed volume (3D) or the surface area?
from pygalmesh.
@nschloe I mean the enclosed volume (3D).
It would also be useful to know the surface area, I suppose. Any information really, but in particular the 3D volume.
from pygalmesh.
I'd simply create the tetrahedral volume mesh with pygalmesh and then sum up the volumes of the tetrahedra, perhaps with https://github.com/nschloe/meshplex.
from pygalmesh.
Awesome, this seems to be exactly what I am looking for. Excuse me for my ignorance, but could you detail how to "create the tetrahedral volume mesh". I tried the following but I am not sure it is right:
mesh = pygalmesh.generate_mesh(verts[faces])
With faces
and verts
as above. I am returned with the error:
File "C:\Users\User\Anaconda3\lib\site-packages\pygalmesh\main.py", line 53, in generate_mesh
verbose=verbose,
TypeError: _generate_mesh(): incompatible function arguments. The following argument types are supported:
1. (domain: _pygalmesh.DomainBase, outfile: str, feature_edges: List[List[List[float[3]]]] = [], bounding_sphere_radius: float = 0.0, lloyd: bool = False, odt: bool = False, perturb: bool = True, exude: bool = True, edge_size: float = 0.0, facet_angle: float = 0.0, facet_size: float = 0.0, facet_distance: float = 0.0, cell_radius_edge_ratio: float = 0.0, cell_size: float = 0.0, verbose: bool = True) -> None
Invoked with: array([[[0. , 1. , 1.9],
[1. , 0. , 1.9],
[0. , 0. , 1.9]],
[[0. , 1. , 1.9],
[1. , 1. , 1.9],
[1. , 0. , 1.9]],
[[0. , 1.9, 0. ],
[1. , 1.9, 1. ],
[0. , 1.9, 1. ]],
[[1. , 1.9, 0. ],
[1. , 1.9, 1. ],
[0. , 1.9, 0. ]],
[[0. , 1. , 1.9],
[0. , 1.9, 1. ],
[1. , 1. , 1.9]],
[[1. , 1. , 1.9],
[0. , 1.9, 1. ],
[1. , 1.9, 1. ]],
[[1.9, 1. , 1. ],
[1.9, 0. , 0. ],
[1.9, 0. , 1. ]],
[[1.9, 1. , 0. ],
[1.9, 0. , 0. ],
[1.9, 1. , 1. ]],
[[1. , 1. , 1.9],
[1.9, 1. , 1. ],
[1. , 0. , 1.9]],
[[1. , 0. , 1.9],
[1.9, 1. , 1. ],
[1.9, 0. , 1. ]],
[[1. , 1.9, 0. ],
[1.9, 1. , 0. ],
[1. , 1.9, 1. ]],
[[1. , 1.9, 1. ],
[1.9, 1. , 0. ],
[1.9, 1. , 1. ]],
[[1. , 1.9, 1. ],
[1.9, 1. , 1. ],
[1. , 1. , 1.9]]], dtype=float32), 'C:\\Users\\User\\AppData\\Local\\Temp\\tmpjm5w3m1i.mesh'; kwargs: feature_edges=[], bounding_sphere_radius=0.0, lloyd=False, odt=False, perturb=True, exude=True, edge_size=0.0, facet_angle=0.0, facet_size=0.0, facet_distance=0.0, cell_radius_edge_ratio=0.0, cell_size=0.0, verbose=True
from pygalmesh.
https://github.com/nschloe/pygalmesh#volume-meshes-from-surface-meshes
from pygalmesh.
Can you explain to me how to get my surface mesh in the correct form? This is how I am doing it:
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
mesh = Poly3DCollection(verts[faces])
mesh = pygalmesh.generate_volume_mesh_from_surface_mesh(mesh)
returns
Traceback (most recent call last):
File "c:\Users\User\weather\MS\MS_cubes.py", line 137, in <module>
File "C:\Users\User\Anaconda3\lib\site-packages\pygalmesh\main.py", line 189, in generate_volume_mesh_from_surface_mesh
mesh = meshio.read(filename)
File "C:\Users\User\Anaconda3\lib\site-packages\meshio\_helpers.py", line 55, in read
path = pathlib.Path(filename)
File "C:\Users\User\Anaconda3\lib\pathlib.py", line 1003, in __new__
self = cls._from_parts(args, init=False)
File "C:\Users\User\Anaconda3\lib\pathlib.py", line 658, in _from_parts
File "C:\Users\User\Anaconda3\lib\pathlib.py", line 642, in _parse_args
a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not Poly3DCollection
I have a numpy array which I convert into a mesh using Poly3DCollection. It is not in the '.vtu' format. Is there something I am missing. The tutorial for pygalmesh is not self-explanatory.
from pygalmesh.
import meshio
meshio.write('out.vtu', xyz, {'tetra': tets})
from pygalmesh.
Related Issues (20)
- Maximum boundary size? HOT 1
- Parallel build HOT 2
- Release archives do not contain git-lfs files HOT 1
- extra_feature_edges does not seem to have any effect HOT 4
- Unstructured grid HOT 1
- pygalmesh installation in anaconda (windows) HOT 1
- SyntaxError: future feature annotations is not defined HOT 3
- How to use a closed stl file to generate the volume mesh? HOT 1
- install on windows HOT 1
- Calculate Union on meshes from meshio
- Labels on generated mesh HOT 2
- Question about converting volume to surface HOT 1
- [README] The images in the README.md are not rendering HOT 2
- Release v0.10.7 missing on GitHub
- M1 Apple Silicon support HOT 5
- generation from array HOT 4
- Compiler assumption on MacOS
- install broken for non-default install locations
- Fix `generate_from_array` signature
- Non manifold interface between two meshes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygalmesh.