mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-13 06:30:34 +05:00
Merge branch 'edge_midpoint_without_geo_edge' into 'master'
if PointBetweenEdge gets invalid edgenr, return midpoint See merge request jschoeberl/netgen!419
This commit is contained in:
commit
46a6062bdf
@ -1442,12 +1442,13 @@ namespace netgen
|
|||||||
{
|
{
|
||||||
double s0, s1;
|
double s0, s1;
|
||||||
|
|
||||||
Point<3> hnewp = p1+secpoint*(p2-p1);
|
newp = p1+secpoint*(p2-p1);
|
||||||
gp_Pnt pnt(hnewp(0), hnewp(1), hnewp(2));
|
if(ap1.edgenr > emap.Size() || ap1.edgenr == 0)
|
||||||
|
return;
|
||||||
|
gp_Pnt pnt(newp(0), newp(1), newp(2));
|
||||||
GeomAPI_ProjectPointOnCurve proj(pnt, BRep_Tool::Curve(TopoDS::Edge(emap(ap1.edgenr)), s0, s1));
|
GeomAPI_ProjectPointOnCurve proj(pnt, BRep_Tool::Curve(TopoDS::Edge(emap(ap1.edgenr)), s0, s1));
|
||||||
pnt = proj.NearestPoint();
|
pnt = proj.NearestPoint();
|
||||||
hnewp = Point<3> (pnt.X(), pnt.Y(), pnt.Z());
|
newp = Point<3> (pnt.X(), pnt.Y(), pnt.Z());
|
||||||
newp = hnewp;
|
|
||||||
newgi = ap1;
|
newgi = ap1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user