L
L
LonelyDeer2016-05-16 15:20:41
Python
LonelyDeer, 2016-05-16 15:20:41

How to create a triangular\quad grid on an arbitrary 2D area?

Good afternoon.
I must say right away that I am not an IT specialist, I am engaged in calculations of industrial structures and transport facilities. VBA, Python experience. I am writing a program for calculating the strength of reinforced concrete elements, taking into account the non-linearity of the material. For the calculation, it is necessary to split an arbitrary area (possibly with cavities) with the boundary of the described broken curve, and this must be done for a couple of hundred sections.
I searched on this topic for a long time, read articles. As a result, I found a couple of python libraries from free solutions ( MeshPy and DistMesh ), but with such documentation that it’s impossible to figure it out (beginner + half-empty documentation + almost no examples). Of the generally recognized tools, I found the Triangle program written in C, authored byJonathan Shewchuk . The documentation for it is decent, the file types are described, and I can even write a script that would generate the source code and run this program, but this is where my question was born?
Is it possible? (and how would it be better to do it?) to write a macro that would sequentially feed files to the program to the mesher (we work in Linux) through the console, wait until it processes these files (well, will it be so that I just hang the mesher by stuffing new files into it, or is it impossible in principle?) and then perform further actions with the files (would start calculating the characteristics of the sections)?
Maybe it's better to sit down and try to write to the developers of the library to sort it out and try to solve it inside Python?
There is a third option, maybe you can somehow wrap the C algorithm into a plug-in module in python (although this is from the realm of fantasy, I think I won’t master it)?
Well, the fourth option is to write your own bike and try to implement Delaunay triangulation in python, but it seems to me that I won’t be able to do it either.
Maybe someone dealt with such a problem as creating an automatic grid for FEM or something similar. If you have experience, could you share it?
UPD.
Decided to use this one ! . Thank you very much again angru .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
angru, 2016-05-17
@LonelyDeer

by the phrase: " delaunay triangulation python " a lot of things are googled:
pure python
wrapper over qhull
one of the many features of a very popular library for scientific calculations - scipy
wrapper over the mentioned Triangle
and so on. did nothing come up?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question