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

*** empty log message ***

parent 7b79f818
No related branches found
No related tags found
No related merge requests found
// $Id: Geo.cpp,v 1.91 2007-08-27 19:27:02 geuzaine Exp $ // $Id: Geo.cpp,v 1.92 2007-08-27 19:52:07 geuzaine Exp $
// //
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
// //
...@@ -2904,23 +2904,21 @@ void Projette(Vertex *v, double mat[3][3]) ...@@ -2904,23 +2904,21 @@ void Projette(Vertex *v, double mat[3][3])
static void intersectCS(int N, double x[], double res[]) static void intersectCS(int N, double x[], double res[])
{ {
//x[1] = u x[2] = v x[3] = w // (x[1], x[2]) = surface params, x[3] = curve param
Vertex s, c; Vertex s = InterpolateSurface(SURFACE, x[1], x[2], 0, 0);
s = InterpolateSurface(SURFACE, x[1], x[2], 0, 0); Vertex c = InterpolateCurve(CURVE, x[3], 0);
c = InterpolateCurve(CURVE, x[3], 0);
res[1] = s.Pos.X - c.Pos.X; res[1] = s.Pos.X - c.Pos.X;
res[2] = s.Pos.Y - c.Pos.Y; res[2] = s.Pos.Y - c.Pos.Y;
res[3] = s.Pos.Z - c.Pos.Z; res[3] = s.Pos.Z - c.Pos.Z;
} }
bool IntersectCurveSurface(Curve *c, Surface *s, double x[]) bool IntersectCurveSurface(Curve *c, Surface *s, double x[4])
{ {
int check; int check;
SURFACE = s; SURFACE = s;
CURVE = c; CURVE = c;
newt(x, 3, &check, intersectCS); newt(x, 3, &check, intersectCS);
if(check) if(check) return false;
return false;
return true; return true;
} }
...@@ -2935,10 +2933,7 @@ bool IntersectCurvesWithSurface(List_T *curve_ids, int surface_id, List_T *point ...@@ -2935,10 +2933,7 @@ bool IntersectCurvesWithSurface(List_T *curve_ids, int surface_id, List_T *point
double curve_id; double curve_id;
List_Read(curve_ids, i, &curve_id); List_Read(curve_ids, i, &curve_id);
Curve *c = FindCurve((int)curve_id); Curve *c = FindCurve((int)curve_id);
if(!c){ if(c){
Msg(GERROR, "Uknown curve %d", (int)curve_id);
}
else{
double x[4] = {0., 0.5, 0.5, 0.5}; double x[4] = {0., 0.5, 0.5, 0.5};
if(IntersectCurveSurface(c, s, x)){ if(IntersectCurveSurface(c, s, x)){
Vertex p = InterpolateCurve(c, x[3], 0); Vertex p = InterpolateCurve(c, x[3], 0);
...@@ -2948,6 +2943,8 @@ bool IntersectCurvesWithSurface(List_T *curve_ids, int surface_id, List_T *point ...@@ -2948,6 +2943,8 @@ bool IntersectCurvesWithSurface(List_T *curve_ids, int surface_id, List_T *point
List_Add(point_ids, &num); List_Add(point_ids, &num);
} }
} }
else
Msg(GERROR, "Uknown curve %d", (int)curve_id);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment