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

*** empty log message ***

parent f806b05c
No related branches found
No related tags found
No related merge requests found
// $Id: ExtrudeParams.cpp,v 1.19 2006-11-25 16:52:43 geuzaine Exp $ // $Id: ExtrudeParams.cpp,v 1.20 2006-11-26 19:30:23 geuzaine Exp $
// //
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
// //
...@@ -44,7 +44,6 @@ ExtrudeParams::ExtrudeParams(int ModeEx) ...@@ -44,7 +44,6 @@ ExtrudeParams::ExtrudeParams(int ModeEx)
mesh.Recombine = false; mesh.Recombine = false;
} }
void ExtrudeParams::fill(int type, void ExtrudeParams::fill(int type,
double T0, double T1, double T2, double T0, double T1, double T2,
double A0, double A1, double A2, double A0, double A1, double A2,
......
// $Id: meshGFaceExtruded.cpp,v 1.2 2006-11-26 16:24:04 geuzaine Exp $ // $Id: meshGFaceExtruded.cpp,v 1.3 2006-11-26 19:30:23 geuzaine Exp $
// //
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
// //
...@@ -31,6 +31,30 @@ ...@@ -31,6 +31,30 @@
#include "Context.h" #include "Context.h"
#include "Message.h" #include "Message.h"
int extrudeVertex(GFace *gf, MVertex *v)
{
ExtrudeParams *ep = gf->meshAttributes.extrude;
for(int i = 0; i < ep->mesh.NbLayer; i++) {
for(int j = 1; j < ep->mesh.NbElmLayer[i]; j++) {
double x = v->x(), y = v->y(), z = v->z();
ep->Extrude(i, j, x, y, z);
gf->mesh_vertices.push_back(new MVertex(x, y, z, gf));
}
}
}
int copyMesh(GFace *gf, GFace *from)
{
ExtrudeParams *ep = gf->meshAttributes.extrude;
for(unsigned int i = 0; i < from->mesh_vertices.size(); i++){
MVertex *v = from->mesh_vertices[i];
double x = v->x(), y = v->y(), z = v->z();
ep->Extrude(ep->mesh.NbLayer - 1, ep->mesh.NbElmLayer[ep->mesh.NbLayer - 1],
x, y, z);
gf->mesh_vertices.push_back(new MVertex(x, y, z, gf));
}
}
int MeshExtrudedSurface(GFace *gf) int MeshExtrudedSurface(GFace *gf)
{ {
ExtrudeParams *ep = gf->meshAttributes.extrude; ExtrudeParams *ep = gf->meshAttributes.extrude;
...@@ -40,32 +64,18 @@ int MeshExtrudedSurface(GFace *gf) ...@@ -40,32 +64,18 @@ int MeshExtrudedSurface(GFace *gf)
if(ep->geo.Mode == EXTRUDED_ENTITY) { if(ep->geo.Mode == EXTRUDED_ENTITY) {
// extruded from a curve // extruded from a curve
GEdge *ge = gf->model()->edgeByTag(ep->geo.Source); GEdge *e = gf->model()->edgeByTag(std::abs(ep->geo.Source));
if(!ge) return 0; if(!e) return 0;
for(unsigned int i = 0; i < ge->mesh_vertices.size(); i++) { for(unsigned int i = 0; i < e->mesh_vertices.size(); i++)
//printf("extruding vertex %d\n", i); extrudeVertex(gf, e->mesh_vertices[i]);
} // get bounding edges and create quads/tris
/*
c = FindCurve(abs(ep->geo.Source));
if(!c)
return false;
for(int i = 0; i < List_Nbr(c->Vertices); i++) {
List_Read(c->Vertices, i, &v1);
Extrude_Vertex(&v1, NULL);
}
Extrude_Curve(&c, NULL);
*/
} }
else { else {
// copy of a surface ("chapeau") // copy of a surface ("chapeau")
/* GFace *f = gf->model()->faceByTag(std::abs(ep->geo.Source));
source = FindSurface(ep->geo.Source); if(!f) return 0;
if(!source) copyMesh(gf, f);
return false;
copy_mesh(ss, s);
*/
} }
return 1; return 1;
} }
// $Id: meshGFaceTransfinite.cpp,v 1.5 2006-11-26 16:24:04 geuzaine Exp $ // $Id: meshGFaceTransfinite.cpp,v 1.6 2006-11-26 19:30:23 geuzaine Exp $
// //
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
// //
...@@ -93,6 +93,8 @@ int MeshTransfiniteSurface( GFace *gf) ...@@ -93,6 +93,8 @@ int MeshTransfiniteSurface( GFace *gf)
int Lb = N4 - N3; int Lb = N4 - N3;
int Hb = m_vertices.size() - N4; int Hb = m_vertices.size() - N4;
// FIXME need to reimplement 3-side transfinite interpolation!
if(Lb != L || Hb != H){ if(Lb != L || Hb != H){
Msg(GERROR,"Surface %d cannot be meshed using the transfinite algo", gf->tag()); Msg(GERROR,"Surface %d cannot be meshed using the transfinite algo", gf->tag());
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment