occ - fix meshing in parameter space, fix edge curve parameters

This commit is contained in:
mhochsteger@cerbsim.com 2021-11-29 16:01:55 +01:00
parent 564237032a
commit 1818ffd152
4 changed files with 13 additions and 13 deletions

View File

@ -478,7 +478,7 @@ namespace netgen
if(edge->primary == edge)
{
DivideEdge(edge, mparam, mesh, edge_points, edge_params);
DivideEdge(edge, mparam, mesh, edge_points, params);
}
else
{
@ -505,22 +505,25 @@ namespace netgen
swap(edge_points[i], edge_points[np-3-i]);
swap(edge_params[i], edge_params[np-3-i]);
}
params.SetSize(edge_params.Size()+2);
params[0] = 0.;
params.Last() = 1.;
for(auto i : Range(edge_params))
params[i+1] = edge_params[i];
}
pnums.SetSize(edge_points.Size() + 2);
pnums[0] = startp;
pnums.Last() = endp;
params.SetSize(edge_points.Size()+2);
params[0] = 0.;
params.Last() = 1.;
for(auto i : Range(edge_points))
{
auto pi = mesh.AddPoint(edge_points[i]);
tree.Insert(mesh[pi], pi);
pnums[i+1] = pi;
params[i+1] = edge_params[i];
}
for(auto i : Range(pnums.Size()-1))

View File

@ -102,14 +102,12 @@ namespace netgen
double s0, s1;
auto cof = BRep_Tool::CurveOnSurface (edge, face, s0, s1);
for(auto i : Range(2))
{
Point<3> p = mesh[seg[i]];
gedge.ProjectPoint(p, &seg.epgeominfo[i]);
}
double s[2] = { seg.epgeominfo[0].dist, seg.epgeominfo[1].dist };
// fixes normal-vector roundoff problem when endpoint is cone-tip
s[0] = s0 + s[0]*(s1-s0);
s[1] = s0 + s[1]*(s1-s0);
double delta = s[1]-s[0];
s[0] += 1e-10*delta;
s[1] -= 1e-10*delta;

View File

@ -443,7 +443,6 @@ namespace netgen
res = MESHING2_GIVEUP;
}
projecttype = PARAMETERSPACE;
static Timer t1("rest of loop"); RegionTimer reg1(t1);
bool meshing_failed = res != MESHING2_OK;

View File

@ -198,9 +198,9 @@ namespace netgen
bool OCCGeometry :: MeshFace(Mesh& mesh,
const MeshingParameters& mparam, int nr, FlatArray<int, PointIndex> glob2loc) const
{
bool failed = OCCMeshFace(*this, mesh, glob2loc, mparam, nr, PLANESPACE, true);
bool failed = OCCMeshFace(*this, mesh, glob2loc, mparam, nr, PARAMETERSPACE, true);
if(failed)
failed = OCCMeshFace(*this, mesh, glob2loc, mparam, nr, PARAMETERSPACE, false);
failed = OCCMeshFace(*this, mesh, glob2loc, mparam, nr, PLANESPACE, false);
if(failed)
{