// commercial license or contractual agreement.
//=======================================================================
-#include <StlTransfer.ixx>
-#include <Standard_ErrorHandler.hxx>
-#include <Standard_Failure.hxx>
-#include <TopoDS_Face.hxx>
-#include <Poly_Connect.hxx>
-#include <TColgp_Array1OfDir.hxx>
-#include <Poly_Triangulation.hxx>
-#include <BRepAdaptor_Surface.hxx>
-#include <TopLoc_Location.hxx>
-#include <Geom_Surface.hxx>
+
#include <BRep_Tool.hxx>
-#include <gp_Vec.hxx>
-#include <gp_Pnt.hxx>
-#include <CSLib.hxx>
-#include <TColgp_Array1OfPnt2d.hxx>
+#include <BRepAdaptor_Surface.hxx>
+#include <BRepMesh_IncrementalMesh.hxx>
#include <CSLib.hxx>
+#include <Geom_Surface.hxx>
#include <gp_Dir.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Vec.hxx>
#include <gp_XYZ.hxx>
-#include <BRepMesh_IncrementalMesh.hxx>
-#include <TopAbs.hxx>
+#include <Poly_Connect.hxx>
+#include <Poly_Triangulation.hxx>
#include <Precision.hxx>
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_Failure.hxx>
+#include <StlMesh_Mesh.hxx>
+#include <StlTransfer.hxx>
+#include <TColgp_Array1OfDir.hxx>
+#include <TColgp_Array1OfPnt2d.hxx>
+#include <TColgp_SequenceOfXYZ.hxx>
+#include <TopAbs.hxx>
#include <TopExp_Explorer.hxx>
+#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
-#include <TColgp_SequenceOfXYZ.hxx>
-//function computes normals for surface
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
+//function computes normals for surface
static void Normal(const TopoDS_Face& aFace,
Poly_Connect& pc,
TColgp_Array1OfDir& Nor)
gp_Vec D2U,D2V,D2UV;
gp_Pnt P;
Standard_Real U, V;
- CSLib_DerivativeStatus Status;
+ CSLib_DerivativeStatus aStatus;
CSLib_NormalStatus NStat;
S.Initialize(aFace, Standard_False);
const TColgp_Array1OfPnt2d& UVNodes = T->UVNodes();
U = UVNodes(i).X();
V = UVNodes(i).Y();
S.D1(U,V,P,D1U,D1V);
- CSLib::Normal(D1U,D1V,Precision::Angular(),Status,Nor(i));
- if (Status != CSLib_Done) {
+ CSLib::Normal (D1U, D1V, Precision::Angular(), aStatus, Nor (i));
+ if (aStatus != CSLib_Done) {
S.D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
CSLib::Normal(D1U,D1V,D2U,D2V,D2UV,Precision::Angular(),OK,NStat,Nor(i));
}
U = UVNodes(UVNodes.Lower()).X();
V = UVNodes(UVNodes.Lower()).Y();
S.D1(U,V,P,D1U,D1V);
- CSLib::Normal(D1U,D1V,Precision::Angular(),Status,NPlane);
- if (Status != CSLib_Done) {
+ CSLib::Normal (D1U, D1V, Precision::Angular(), aStatus, NPlane);
+ if (aStatus != CSLib_Done) {
S.D2(U,V,P,D1U,D1V,D2U,D2V,D2UV);
CSLib::Normal(D1U,D1V,D2U,D2V,D2UV,Precision::Angular(),OK,NStat,NPlane);
}
}
}
-void StlTransfer::BuildIncrementalMesh (const TopoDS_Shape& Shape,
- const Standard_Real Deflection,
- const Standard_Boolean InParallel,
+void StlTransfer::RetrieveMesh (const TopoDS_Shape& Shape,
const Handle(StlMesh_Mesh)& Mesh)
{
- if (Deflection <= Precision::Confusion ()) {
- Standard_ConstructionError::Raise ("StlTransfer::BuildIncrementalMesh");
- }
-
- BRepMesh_IncrementalMesh aMesher(Shape, Deflection, Standard_False, 0.5, InParallel);
for (TopExp_Explorer itf(Shape,TopAbs_FACE); itf.More(); itf.Next()) {
TopoDS_Face face = TopoDS::Face(itf.Current());
TopLoc_Location Loc, loc;
if (theTriangulation.IsNull()) continue; //Meshing was not done for this face!
Poly_Array1OfTriangle theTriangles(1,theTriangulation->NbTriangles());
theTriangles.Assign(theTriangulation->Triangles());
- Mesh->AddDomain (Deflection);
+ Mesh->AddDomain (theTriangulation->Deflection());
TColgp_Array1OfPnt thePoints(1, theTriangulation->NbNodes());
thePoints.Assign(theTriangulation->Nodes());