224
224
N = ge->meshAttributes.nbPointsTransfinite;
227
a = Integration(ge, t_begin, t_end, F_Lc, Points, 1.e-7);
227
a = Integration(ge, t_begin, t_end, F_Lc, Points, 1.e-8);
228
228
N = std::max(ge->minimumMeshSegments() + 1, (int)(a + 1.));
230
231
const double b = a / (double)(N - 1);
232
int count = 1, NUMP = 1;
233
// if the curve is periodic and if the begin vertex is identical to the end vertex
234
// and if this vertex has only one model curve adjacent to it, then the vertex is
235
// not connecting any other curve. So, the mesh vertex and its associated geom vertex
236
// are not necessary at the same location
238
if(ge->getBeginVertex() == ge->getEndVertex() &&
239
ge->getBeginVertex()->edges().size() == 1){
240
end_p = beg_p = ge->point(t_begin);
243
MVertex *v0 = ge->getBeginVertex()->mesh_vertices[0];
244
MVertex *v1 = ge->getEndVertex()->mesh_vertices[0];
245
beg_p = GPoint(v0->x(), v0->y(), v0->z());
246
end_p = GPoint(v1->x(), v1->y(), v1->z());
249
int count = 1, NUMP = 1, NUMP2 = 1;
235
252
// do not consider the first and the last vertex (those are not
236
253
// classified on this mesh edge)
238
255
ge->mesh_vertices.resize(N - 2);
256
GPoint last_p = beg_p;
239
257
while(NUMP < N - 1) {
240
258
List_Read(Points, count - 1, &P1);
241
259
List_Read(Points, count, &P2);
242
260
const double d = (double)NUMP *b;
243
261
if((fabs(P2.p) >= fabs(d)) && (fabs(P1.p) < fabs(d))) {
244
double dt = P2.t - P1.t;
245
double dp = P2.p - P1.p;
246
double t = P1.t + dt / dp * (d - P1.p);
247
GPoint V = ge->point(t);
248
ge->mesh_vertices[NUMP - 1] = new MEdgeVertex(V.x(), V.y(), V.z(), ge, t);
262
double dt = P2.t - P1.t;
263
double dp = P2.p - P1.p;
264
double t = P1.t + dt / dp * (d - P1.p);
265
GPoint V = ge->point(t);
266
if(ge->meshAttributes.Method == TRANSFINI){
267
ge->mesh_vertices[NUMP2 - 1] = new MEdgeVertex(V.x(), V.y(), V.z(), ge, t);
271
double lc = BGM_MeshSize(ge, t, 0, V.x(), V.y(), V.z());
272
if(V.distance(last_p) > 0.7 * lc &&
273
!(NUMP == N - 2 && V.distance(end_p) < 0.7 * lc)){
275
ge->mesh_vertices[NUMP2 - 1] = new MEdgeVertex(V.x(), V.y(), V.z(), ge, t);
285
ge->mesh_vertices.resize(NUMP2 - 1);
256
287
List_Delete(Points);
263
294
ge->lines.push_back(new MLine(v0, v1));
266
// if the curve is periodic and if the begin vertex is identical to the end vertex
267
// and if this vertex has only one model curve adjacent to it, then the vertex is
268
// not connecting any other curve. So, the mesh vertex and its associated geom vertex
269
// are not necessary at the same location
272
// printf("%p %p %d\n",ge->getBeginVertex(),ge->getEndVertex(),ge->getBeginVertex()->edges().size());
274
if (ge->getBeginVertex() == ge->getEndVertex() && ge->getBeginVertex()->edges().size() == 1)
276
MVertex *v0 = ge->getBeginVertex()->mesh_vertices[0];
277
GPoint gp = ge->point (t_begin);
297
if(ge->getBeginVertex() == ge->getEndVertex() &&
298
ge->getBeginVertex()->edges().size() == 1){
299
MVertex *v0 = ge->getBeginVertex()->mesh_vertices[0];