Skip to content
Snippets Groups Projects
Commit bf8dfe5b authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fixes for discrete curves/surfaces
parent 9b933a5c
No related branches found
No related tags found
No related merge requests found
// $Id: SecondOrder.cpp,v 1.30 2005-02-20 06:36:54 geuzaine Exp $
// $Id: SecondOrder.cpp,v 1.31 2005-02-20 16:41:24 geuzaine Exp $
//
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
//
......@@ -60,9 +60,10 @@ Vertex *onCurve(Vertex * v1, Vertex * v2)
int ok1 = 1, ok2 = 1;
double u1 = 0., u2 = 0.;
if(!THEC->beg || !THEC->end)
if(!THEC->beg || !THEC->end){
ok1 = ok2 = 0;
}
else{
if(List_Nbr(v1->ListCurves) == 1){
u1 = v1->u;
}
......@@ -95,6 +96,7 @@ Vertex *onCurve(Vertex * v1, Vertex * v2)
u2 == THEC->ubeg || u2 == THEC->uend)){
ok1 = ok2 = 0;
}
}
if(ok1 && ok2){
v = InterpolateCurve(THEC, 0.5 * (u1 + u2), 0);
......@@ -122,7 +124,7 @@ Vertex *onSurface(Vertex * v1, Vertex * v2)
if(!THES)
return NULL;
if(THES->Typ == MSH_SURF_PLAN)
if(THES->Typ == MSH_SURF_PLAN || THES->Typ == MSH_SURF_DISCRETE)
return NULL;
XYZtoUV(THES, v1->Pos.X, v1->Pos.Y, v1->Pos.Z, &U1, &V1, 1.0);
......@@ -144,7 +146,7 @@ Vertex *onSurface(Vertex * v1, Vertex * v2, Vertex * v3, Vertex * v4)
if(!THES)
return NULL;
if(THES->Typ == MSH_SURF_PLAN)
if(THES->Typ == MSH_SURF_PLAN || THES->Typ == MSH_SURF_DISCRETE)
return NULL;
XYZtoUV(THES, v1->Pos.X, v1->Pos.Y, v1->Pos.Z, &U1, &V1, 1.0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment