User given Id for Duplicata{...} command
Hi people of gmsh :),
This is more of a question than an issue, but after reading FAQ, tutorials, googleing and just trial and erroring I thought I might ask here.
In the 2nd tutorial t2.geo we have:
Translate {0, 0.1, 0} { Duplicata{ Point{3}; } }
// This command created a new point with an automatically assigned id. This id
The important bit here is automatically assigned id
. The duplicated and translated Point id will be <highest Point id so far>+1
. So pretty much what the newp
command is doing.
Is there a way to prescribe the fresh id which also works for multiple entries. To give a working example:
gs = 1;
Point(1) = {0,0,0,gs};
Point(2) = {1,0,0,gs};
p[] = Translate {0, 1, 0} {
Duplicata { Point{1,2}; }
};
Printf("Point ids: %g, %g",p[]); // -> Point ids: 3, 4
Now I would like to use something like this (syntax Duplicata{existing entities}{new user given ids}
is made up by me):
gs = 1;
Point(1) = {0,0,0,gs};
Point(2) = {1,0,0,gs};
p[] = Translate {0, 1, 0} {
Duplicata { Point{1,2}; } {42,43}
};
Printf("Point ids: %g, %g",p[]); // -> Point ids: 42, 43
Is there a way to achieve this? If there is a more verbose way around to achieve this I am fine as well.
Thanks for the answer, Tobi