How to build myself mesh?
Now, I want to build myself mesh. The mesh is represented as:
points = [
[x0, y0, z0],
[x1, y1, z1],
...
[xn, yn, zn]
]
connections = [
[c11, c12, c13],
[c21, c22, c23],
...
[cm1, cm2, cm3]
]
This connections
indicates many faces in the mesh.
For example, a box is represented as:
points = [
[0, 0, 0],
[1, 0, 0],
[1, 1, 0],
[0, 1, 0],
[0, 0, 1],
[1, 0, 2],
[1, 1, 3],
[0, 1, 4],
]
connections = [
[0, 1, 2, 3],
[4, 5, 6, 7],
[0, 1, 5, 4],
[1, 2, 6, 5],
[2, 3, 7, 6],
[0, 3, 7, 4],
]
If I want to build this box in gmsh
, I must build point
and line
firstly, then build the six faces.
However, there is a problem in building line
: both [0, 1, 2, 3]
and [0, 1, 5, 4]
need line 0-1
. In order to don't build line 0-1
twice, I need to know whether the line 0-1
has been built. If line 0-1
has been built, I need to know the built id. If line 0-1
has not been built, I need to build it, and keep the id.
I can achieve the above process by using a matrix to record the line 0-1
id: matrix[i, j]=id
, where i&j
indicates point i&j
. If matrix[i, j]=0
, line i-j
has not be built, then I need to build it.
Question1 Does gmsh
has a built-in method for this function? For example, idx=gmsh.model.geo.lineId(1, 2)
. If line 1-2
has not been built, the idx
may be -1
or 0
. If line 1-2
has been build, the idx
should be the index of line 1-2
.
Question2 Does gmsh
has a built-in method to import mesh from points&connections
.
Any suggestion is appreciated~~~