mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0026897: BRepBuilderAPI_Copy does not copy polygons
1. Implemented copying for 3D polygons and polygons on surfaces 2. Added test case bugs/modalg_6/bug26897
This commit is contained in:
@@ -68,6 +68,7 @@ public:
|
||||
if (T.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
// mesh is copied if and only if the geometry need to be copied too
|
||||
if (myCopyGeom)
|
||||
T = T->Copy();
|
||||
return Standard_True;
|
||||
@@ -88,6 +89,46 @@ public:
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//! Returns true to indicate the need to copy polygon;
|
||||
//! copies it if required
|
||||
Standard_Boolean NewPolygon(const TopoDS_Edge& E, Handle(Poly_Polygon3D)& P)
|
||||
{
|
||||
if (!myCopyMesh)
|
||||
return Standard_False;
|
||||
|
||||
TopLoc_Location aLoc;
|
||||
P = BRep_Tool::Polygon3D(E, aLoc);
|
||||
|
||||
if (P.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
// polygon is copied if and only if the geometry need to be copied too
|
||||
if (myCopyGeom)
|
||||
P = P->Copy();
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//! Returns true to indicate the need to copy polygon;
|
||||
//! copies it if required
|
||||
Standard_Boolean NewPolygonOnTriangulation(const TopoDS_Edge& E, const TopoDS_Face& F,
|
||||
Handle(Poly_PolygonOnTriangulation)& P)
|
||||
{
|
||||
if (!myCopyMesh)
|
||||
return Standard_False;
|
||||
|
||||
TopLoc_Location aLoc;
|
||||
Handle(Poly_Triangulation) aTria = BRep_Tool::Triangulation(F, aLoc);
|
||||
P = BRep_Tool::PolygonOnTriangulation(E, aTria, aLoc);
|
||||
|
||||
if (P.IsNull())
|
||||
return Standard_False;
|
||||
|
||||
// polygon is copied if and only if the geometry need to be copied too
|
||||
if (myCopyGeom)
|
||||
P = P->Copy();
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//! Returns true to indicate the need to copy vertex
|
||||
Standard_Boolean NewPoint (const TopoDS_Vertex& V, gp_Pnt& P,
|
||||
Standard_Real& Tol) Standard_OVERRIDE
|
||||
|
Reference in New Issue
Block a user