occ - fix meshing a sphere (need to keep degenerate edges)

This commit is contained in:
mhochsteger@cerbsim.com 2022-01-04 16:09:00 +01:00
parent 44d626f727
commit c63a865ee3
2 changed files with 8 additions and 7 deletions

View File

@ -19,11 +19,14 @@ namespace netgen
if(verts.size() != 2)
throw Exception("OCC edge does not have 2 vertices");
// swap start/end if necessary
double d00 = Dist(GetPoint(0), start->GetPoint());
double d01 = Dist(GetPoint(0), end->GetPoint());
if(d01 < d00)
swap(start, end);
if(start != end)
{
// swap start/end if necessary
double d00 = Dist(GetPoint(0), start->GetPoint());
double d01 = Dist(GetPoint(0), end->GetPoint());
if(d01 < d00)
swap(start, end);
}
}
double OCCEdge::GetLength() const

View File

@ -1130,8 +1130,6 @@ namespace netgen
auto edge = TopoDS::Edge(e);
if(edge_map.count(tshape)!=0)
continue;
if(BRep_Tool::Degenerated(edge))
continue;
edge_map[tshape] = edges.Size();
auto verts = GetVertices(e);
auto occ_edge = make_unique<OCCEdge>(edge, *vertices[vertex_map[verts[0].TShape()]], *vertices[vertex_map[verts[1].TShape()]] );