From a4697d22eee12904a12ef07bda34e88f69ccf181 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 5 Nov 2011 21:41:32 +0000 Subject: [PATCH] 0000460: exporting *stl files from File -> Export git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5095 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- src/Mod/Part/App/TopoShape.cpp | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 0af323e6c..30de452f7 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -1495,11 +1495,11 @@ TopoDS_Shape TopoShape::makeThickSolid(const TopTools_ListOfShape& remFace, TopoDS_Shape TopoShape::makeOffset(double offset, double tol, bool intersection, bool selfInter, short offsetMode, short join) { - BRepOffsetAPI_MakeOffsetShape mkOffset(this->_Shape, offset, tol, BRepOffset_Mode(offsetMode), - intersection ? Standard_True : Standard_False, - selfInter ? Standard_True : Standard_False, - GeomAbs_JoinType(join)); - return mkOffset.Shape(); + BRepOffsetAPI_MakeOffsetShape mkOffset(this->_Shape, offset, tol, BRepOffset_Mode(offsetMode), + intersection ? Standard_True : Standard_False, + selfInter ? Standard_True : Standard_False, + GeomAbs_JoinType(join)); + return mkOffset.Shape(); } void TopoShape::transformGeometry(const Base::Matrix4D &rclMat) @@ -1673,16 +1673,16 @@ bool TopoShape::removeInternalWires(double minArea) } namespace Part { -struct Vertex +struct MeshVertex { Standard_Real x,y,z; Standard_Integer i; - Vertex(Standard_Real X, Standard_Real Y, Standard_Real Z) + MeshVertex(Standard_Real X, Standard_Real Y, Standard_Real Z) : x(X),y(Y),z(Z) { } - Vertex(const gp_Pnt& p) + MeshVertex(const gp_Pnt& p) : x(p.X()),y(p.Y()),z(p.Z()) { } @@ -1690,7 +1690,7 @@ struct Vertex gp_Pnt toPoint() const { return gp_Pnt(x,y,z); } - bool operator < (const Vertex &rclPt) const + bool operator < (const MeshVertex &rclPt) const { if (fabs ( this->x - rclPt.x) >= MESH_MIN_PT_DIST) return this->x < rclPt.x; @@ -1708,7 +1708,7 @@ private: } //const double Vertex::MESH_MIN_PT_DIST = 1.0e-6; -const double Vertex::MESH_MIN_PT_DIST = gp::Resolution(); +const double MeshVertex::MESH_MIN_PT_DIST = gp::Resolution(); #include #include @@ -1721,7 +1721,7 @@ void TopoShape::getFaces(std::vector &aPoints, #if 1 if (this->_Shape.IsNull()) return; - std::set vertices; + std::set vertices; Standard_Real x1, y1, z1; Standard_Real x2, y2, z2; Standard_Real x3, y3, z3; @@ -1733,10 +1733,10 @@ void TopoShape::getFaces(std::vector &aPoints, for (xp.InitTriangle (nbd); xp.MoreTriangle (); xp.NextTriangle ()) { xp.TriangleVertices (x1,y1,z1,x2,y2,z2,x3,y3,z3); Data::ComplexGeoData::Facet face; - std::set::iterator it; + std::set::iterator it; // 1st vertex - Vertex v1(x1,y1,z1); + MeshVertex v1(x1,y1,z1); it = vertices.find(v1); if (it == vertices.end()) { v1.i = vertices.size(); @@ -1748,7 +1748,7 @@ void TopoShape::getFaces(std::vector &aPoints, } // 2nd vertex - Vertex v2(x2,y2,z2); + MeshVertex v2(x2,y2,z2); it = vertices.find(v2); if (it == vertices.end()) { v2.i = vertices.size(); @@ -1760,7 +1760,7 @@ void TopoShape::getFaces(std::vector &aPoints, } // 3rd vertex - Vertex v3(x3,y3,z3); + MeshVertex v3(x3,y3,z3); it = vertices.find(v3); if (it == vertices.end()) { v3.i = vertices.size(); @@ -1781,14 +1781,14 @@ void TopoShape::getFaces(std::vector &aPoints, std::vector points; points.resize(vertices.size()); - for (std::set::iterator it = vertices.begin(); it != vertices.end(); ++it) + for (std::set::iterator it = vertices.begin(); it != vertices.end(); ++it) points[it->i] = it->toPoint(); for (std::vector::iterator it = points.begin(); it != points.end(); ++it) aPoints.push_back(Base::Vector3d(it->X(),it->Y(),it->Z())); #endif #if 0 BRepMesh::Mesh (this->_Shape, accuracy); - std::set vertices; + std::set vertices; for (TopExp_Explorer xp(this->_Shape,TopAbs_FACE); xp.More(); xp.Next()) { TopoDS_Face face = TopoDS::Face(xp.Current()); TopAbs_Orientation orient = face.Orientation(); @@ -1828,12 +1828,12 @@ void TopoShape::getFaces(std::vector &aPoints, std::swap(V1,V2); gp_Pnt P1, P2, P3; Data::ComplexGeoData::Facet face; - std::set::iterator it; + std::set::iterator it; // 1st vertex P1 = Nodes(V1); P1.Transform(myTransf); - Vertex v1(P1); + MeshVertex v1(P1); it = vertices.find(v1); if (it == vertices.end()) { v1.i = vertices.size(); @@ -1847,7 +1847,7 @@ void TopoShape::getFaces(std::vector &aPoints, // 2nd vertex P2 = Nodes(V2); P2.Transform(myTransf); - Vertex v2(P2); + MeshVertex v2(P2); it = vertices.find(v2); if (it == vertices.end()) { v2.i = vertices.size(); @@ -1861,7 +1861,7 @@ void TopoShape::getFaces(std::vector &aPoints, // 3rd vertex P3 = Nodes(V3); P3.Transform(myTransf); - Vertex v3(P3); + MeshVertex v3(P3); it = vertices.find(v3); if (it == vertices.end()) { v3.i = vertices.size(); @@ -1884,7 +1884,7 @@ void TopoShape::getFaces(std::vector &aPoints, } std::map points; - for (std::set::iterator it = vertices.begin(); it != vertices.end(); ++it) + for (std::set::iterator it = vertices.begin(); it != vertices.end(); ++it) points[it->i] = it->toPoint(); for (std::map::iterator it = points.begin(); it != points.end(); ++it) aPoints.push_back(Base::Vector3d(it->second.X(),it->second.Y(),it->second.Z()));