mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
occ - fix meshing in parameter space, fix edge curve parameters
This commit is contained in:
parent
564237032a
commit
1818ffd152
@ -478,7 +478,7 @@ namespace netgen
|
|||||||
|
|
||||||
if(edge->primary == edge)
|
if(edge->primary == edge)
|
||||||
{
|
{
|
||||||
DivideEdge(edge, mparam, mesh, edge_points, edge_params);
|
DivideEdge(edge, mparam, mesh, edge_points, params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -505,22 +505,25 @@ namespace netgen
|
|||||||
swap(edge_points[i], edge_points[np-3-i]);
|
swap(edge_points[i], edge_points[np-3-i]);
|
||||||
swap(edge_params[i], edge_params[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.SetSize(edge_points.Size() + 2);
|
||||||
pnums[0] = startp;
|
pnums[0] = startp;
|
||||||
pnums.Last() = endp;
|
pnums.Last() = endp;
|
||||||
|
|
||||||
params.SetSize(edge_points.Size()+2);
|
|
||||||
params[0] = 0.;
|
|
||||||
params.Last() = 1.;
|
|
||||||
|
|
||||||
for(auto i : Range(edge_points))
|
for(auto i : Range(edge_points))
|
||||||
{
|
{
|
||||||
auto pi = mesh.AddPoint(edge_points[i]);
|
auto pi = mesh.AddPoint(edge_points[i]);
|
||||||
tree.Insert(mesh[pi], pi);
|
tree.Insert(mesh[pi], pi);
|
||||||
pnums[i+1] = pi;
|
pnums[i+1] = pi;
|
||||||
params[i+1] = edge_params[i];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto i : Range(pnums.Size()-1))
|
for(auto i : Range(pnums.Size()-1))
|
||||||
|
@ -102,14 +102,12 @@ namespace netgen
|
|||||||
double s0, s1;
|
double s0, s1;
|
||||||
auto cof = BRep_Tool::CurveOnSurface (edge, face, 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 };
|
double s[2] = { seg.epgeominfo[0].dist, seg.epgeominfo[1].dist };
|
||||||
|
|
||||||
// fixes normal-vector roundoff problem when endpoint is cone-tip
|
// 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];
|
double delta = s[1]-s[0];
|
||||||
s[0] += 1e-10*delta;
|
s[0] += 1e-10*delta;
|
||||||
s[1] -= 1e-10*delta;
|
s[1] -= 1e-10*delta;
|
||||||
|
@ -443,7 +443,6 @@ namespace netgen
|
|||||||
res = MESHING2_GIVEUP;
|
res = MESHING2_GIVEUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
projecttype = PARAMETERSPACE;
|
|
||||||
static Timer t1("rest of loop"); RegionTimer reg1(t1);
|
static Timer t1("rest of loop"); RegionTimer reg1(t1);
|
||||||
|
|
||||||
bool meshing_failed = res != MESHING2_OK;
|
bool meshing_failed = res != MESHING2_OK;
|
||||||
|
@ -198,9 +198,9 @@ namespace netgen
|
|||||||
bool OCCGeometry :: MeshFace(Mesh& mesh,
|
bool OCCGeometry :: MeshFace(Mesh& mesh,
|
||||||
const MeshingParameters& mparam, int nr, FlatArray<int, PointIndex> glob2loc) const
|
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)
|
if(failed)
|
||||||
failed = OCCMeshFace(*this, mesh, glob2loc, mparam, nr, PARAMETERSPACE, false);
|
failed = OCCMeshFace(*this, mesh, glob2loc, mparam, nr, PLANESPACE, false);
|
||||||
|
|
||||||
if(failed)
|
if(failed)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user