1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0031050: Data Exchange - XmlXCAF persistence stores triangulation-only Faces without any geometry

BRepTools_ShapeSet now ignores myWithTriangles flag in case if triangulation is the only geometry representation.
This commit is contained in:
kgv
2019-10-09 18:18:14 +03:00
committed by apn
parent 44fafc477f
commit 8c787b5fa9
3 changed files with 51 additions and 12 deletions

View File

@@ -215,7 +215,7 @@ void BRepTools_ShapeSet::AddGeometry(const TopoDS_Shape& S)
Handle(BRep_TFace) TF = Handle(BRep_TFace)::DownCast(S.TShape());
if (!TF->Surface().IsNull()) mySurfaces.Add(TF->Surface());
if (myWithTriangles) { // for XML Persistence
if (myWithTriangles || TF->Surface().IsNull()) { // for XML Persistence
Handle(Poly_Triangulation) Tr = TF->Triangulation();
if (!Tr.IsNull()) myTriangulations.Add(Tr);
}
@@ -751,7 +751,7 @@ void BRepTools_ShapeSet::WriteGeometry(const TopoDS_Shape& S,
OS << " " << 0;
OS << "\n";
}
if (myWithTriangles) { // for XML Persistence
if (myWithTriangles || TF->Surface().IsNull()) { // for XML Persistence
if (!(TF->Triangulation()).IsNull()) {
OS << 2;
OS << " ";