Intersect faces of a mesh. More...
Public Member Functions | |
| Algo (SMDS_Mesh *mesh, double tol, const std::vector< gp_XYZ > &normals) | |
| void | Cut (const SMDS_MeshElement *face1, const SMDS_MeshElement *face2, const int nbCommonNodes) |
| Intersect two faces. More... | |
| void | Cut (const SMDS_MeshElement *face, SMESH_NodeXYZ &lineEnd1, int edgeIndex1, SMESH_NodeXYZ &lineEnd2, int edgeIndex2) |
| Store a face cut by a line given by its ends accompanied by indices of intersected face edges. More... | |
| void | MakeNewFaces (TElemIntPairVec &theNew2OldFaces, TNodeIntPairVec &theNew2OldNodes, const double theSign, const bool theOptimize) |
| Split intersected faces. More... | |
| void | IntersectNewEdges (const CutFace &theCFace) |
| Intersect edges added to myCutFaces. More... | |
Data Fields | |
| SMDS_Mesh * | myMesh |
| double | myTol |
| double | myEps |
| const std::vector< gp_XYZ > & | myNormals |
| TCutLinkMap | myCutLinks |
| assure sharing of new nodes More... | |
| TCutFaceMap | myCutFaces |
| TNNMap | myRemove2KeepNodes |
| node merge map More... | |
| const SMDS_MeshElement * | myFace1 |
| const SMDS_MeshElement * | myFace2 |
| std::vector< SMESH_NodeXYZ > | myNodes1 |
| std::vector< SMESH_NodeXYZ > | myNodes2 |
| std::vector< double > | myDist1 |
| std::vector< double > | myDist2 |
| int | myInd1 |
| int | myInd2 |
| int | myNbOnPlane1 |
| int | myNbOnPlane2 |
| TIntPointSet | myIntPointSet |
Private Member Functions | |
| bool | isPlaneIntersected (const gp_XYZ &n2, const double d2, const std::vector< SMESH_NodeXYZ > &nodes1, std::vector< double > &dist1, int &nbOnPlane1, int &iNotOnPlane1) |
| Check if a triangle intersects the plane of another triangle. More... | |
| void | computeIntervals (const std::vector< SMESH_NodeXYZ > &nodes, const std::vector< double > &dist, const int nbOnPln, const int iMaxCoo, double *u, int *iE) |
| Compute parameters on the plane intersection line of intersections of edges of a triangle. More... | |
| void | cutCoplanar () |
| Intersect two co-planar faces. More... | |
| void | addLink (CutLink &link) |
| Store a CutLink. More... | |
| bool | findLink (CutLink &link) |
| Find a CutLink with an intersection point coincident with that of a given link. More... | |
| bool | coincide (const gp_XYZ &p1, const gp_XYZ &p2, const double tol) const |
| gp_XY | p2D (const gp_XYZ &p) const |
| void | intersectLink (const std::vector< SMESH_NodeXYZ > &nodes1, const std::vector< double > &dist1, const int iEdge1, const SMDS_MeshElement *face2, CutLink &link1) |
| Compute intersection point of a link1 with a face2. More... | |
| void | findIntPointOnPlane (const std::vector< SMESH_NodeXYZ > &nodes, const std::vector< double > &dist, CutLink &link) |
| Try to find an intersection node on a link collinear with the plane intersection line. More... | |
| void | replaceIntNode (const SMDS_MeshNode *nToKeep, const SMDS_MeshNode *nToRemove) |
| Store node replacement in myCutFaces. More... | |
| void | computeIntPoint (const double u1, const double u2, const int iE1, const int iE2, CutLink &link, const SMDS_MeshNode *&node1, const SMDS_MeshNode *&node2) |
| Compute intersection point on a link of either of faces by choosing a link whose parameter on the intersection line in maximal. More... | |
| void | cutCollinearLink (const int iNotOnPlane1, const std::vector< SMESH_NodeXYZ > &nodes1, const SMDS_MeshElement *face2, const CutLink &link1, const CutLink &link2) |
| Add intersections to a link collinear with the intersection line. More... | |
| void | setPlaneIndices (const gp_XYZ &planeNorm) |
| Choose indices on an axis-aligned plane. More... | |
| bool | intersectEdgeEdge (const gp_XY s1p0, const gp_XY s1p1, const gp_XY s2p0, const gp_XY s2p1, double &t1, double &t2, bool &isCollinear) |
| Intersect two 2D line segments. More... | |
| bool | intersectEdgeEdge (int iE1, int iE2, IntPoint2D &intPoint) |
| Intersect two edges of co-planar triangles. More... | |
| bool | isPointInTriangle (const gp_XYZ &p, const std::vector< SMESH_NodeXYZ > &nodes) |
| Check if a point is contained in a triangle. More... | |
| const SMDS_MeshNode * | createNode (const gp_XYZ &p) |
| Store a CutLink. More... | |
Intersect faces of a mesh.
| SMESH_MeshAlgos::Intersector::Algo::Algo | ( | SMDS_Mesh * | mesh, |
| double | tol, | ||
| const std::vector< gp_XYZ > & | normals | ||
| ) |
|
private |
Store a CutLink.
|
private |
|
private |
Compute parameters on the plane intersection line of intersections of edges of a triangle.
| [in] | nodes | - triangle nodes |
| [in] | dist | - distance of triangle nodes from the plane of another triangle |
| [in] | nbOnPln | - number of nodes lying on the plane of another triangle |
| [in] | iMaxCoo | - index of coordinate of max component of the plane intersection line |
| [out] | u | - two computed parameters on the plane intersection line |
| [out] | iE | - indices of intersected edges |
|
private |
Compute intersection point on a link of either of faces by choosing a link whose parameter on the intersection line in maximal.
| [in] | u1 | - parameter on the intersection line of link iE1 of myFace1 |
| [in] | u2 | - parameter on the intersection line of link iE2 of myFace2 |
| [in] | iE1 | - index of a link myFace1 |
| [in] | iE2 | - index of a link myFace2 |
| [out] | link | - CutLink storing the intersection point |
| [out] | node1 | - a node of the 2nd link if two links intersect |
| [out] | node2 | - a node of the 2nd link if two links intersect |
|
private |
Store a CutLink.
References SMDS_Mesh::AddNode(), myMesh, and SMDS_MeshElement::setIsMarked().
| void SMESH_MeshAlgos::Intersector::Algo::Cut | ( | const SMDS_MeshElement * | face, |
| SMESH_NodeXYZ & | lineEnd1, | ||
| int | edgeIndex1, | ||
| SMESH_NodeXYZ & | lineEnd2, | ||
| int | edgeIndex2 | ||
| ) |
Store a face cut by a line given by its ends accompanied by indices of intersected face edges.
Edge index is <0 if a line end is inside the face.
| [in] | face | - a face to cut |
| [in,out] | lineEnd1 | - line end coordinates + optional node existing at this point |
| [in] | edgeIndex1 | - index of face edge cut by lineEnd1 |
| [in,out] | lineEnd2 | - line end coordinates + optional node existing at this point |
| [in] | edgeIndex2 | - index of face edge cut by lineEnd2 |
References SMESH_TNodeXYZ::_node, SMDS_MeshElement::GetID(), SMDS_MeshElement::GetNode(), SMDS_MeshElement::GetNodeIndex(), SMDS_MeshElement::GetNodeWrap(), SMESH_TNodeXYZ::Node(), and SMESH_TNodeXYZ::Set().
| void SMESH_MeshAlgos::Intersector::Algo::Cut | ( | const SMDS_MeshElement * | face1, |
| const SMDS_MeshElement * | face2, | ||
| const int | nbCommonNodes | ||
| ) |
Intersect two faces.
References SMDS_MeshElement::begin_nodes(), SMDS_MeshElement::end_nodes(), SMDS_MeshElement::GetID(), SMESH::if(), and SMESH_MeshAlgos::MaxIndex().
Referenced by SMESH_MeshAlgos::Intersector::Cut(), and SMESH_MeshAlgos::Intersector::CutByPlanes().
|
private |
Add intersections to a link collinear with the intersection line.
References Node.
|
private |
Intersect two co-planar faces.
|
private |
Try to find an intersection node on a link collinear with the plane intersection line.
References Node.
|
private |
Find a CutLink with an intersection point coincident with that of a given link.
|
private |
Intersect two 2D line segments.
|
private |
Intersect two edges of co-planar triangles.
| [in,out] | iE1 | - edge index of triangle 1 |
| [in,out] | iE2 | - edge index of triangle 2 |
| [in,out] | intPoints | - intersection points |
| [in,out] | nbIntPoints | - nb of found intersection points |
References Node, and SMESH_TNodeXYZ::Node().
|
private |
Compute intersection point of a link1 with a face2.
References SMESH_TNodeXYZ::Node(), and SMESH_TNodeXYZ::Set().
| void SMESH_MeshAlgos::Intersector::Algo::IntersectNewEdges | ( | const CutFace & | theCFace | ) |
Intersect edges added to myCutFaces.
References Node.
Referenced by SMESH_MeshAlgos::Intersector::CutByPlanes().
|
private |
Check if a triangle intersects the plane of another triangle.
| [in] | nodes1 | - nodes of triangle 1 |
| [in] | n2 | - normal of triangle 2 |
| [in] | d2 | - a constant of the plane equation 2 |
| [out] | dist1 | - distance of nodes1 from the plane 2 |
| [out] | nbOnPlane | - number of nodes1 lying on the plane 2 |
|
private |
Check if a point is contained in a triangle.
References SMESH_MeshAlgos::GetBarycentricCoords().
| void SMESH_MeshAlgos::Intersector::Algo::MakeNewFaces | ( | SMESH_MeshAlgos::TElemIntPairVec & | theNew2OldFaces, |
| SMESH_MeshAlgos::TNodeIntPairVec & | theNew2OldNodes, | ||
| const double | theSign, | ||
| const bool | theOptimize | ||
| ) |
Split intersected faces.
References SMDS_MeshElement::GetID(), SMDS_MeshElement::GetNodeIndex(), SMESH_MeshAlgos::Triangulate::GetTriangles(), SMDS_MeshElement::isMarked(), and SMDS_MeshElement::setIsMarked().
Referenced by SMESH_MeshAlgos::Intersector::MakeNewFaces().
|
private |
|
private |
Store node replacement in myCutFaces.
References SMDS_MeshElement::GetID().
|
private |
Choose indices on an axis-aligned plane.
References SMESH_MeshAlgos::MaxIndex().
| TCutFaceMap SMESH_MeshAlgos::Intersector::Algo::myCutFaces |
Referenced by SMESH_MeshAlgos::Intersector::CutByPlanes().
| TCutLinkMap SMESH_MeshAlgos::Intersector::Algo::myCutLinks |
assure sharing of new nodes
| std::vector< double > SMESH_MeshAlgos::Intersector::Algo::myDist1 |
| std::vector< double > SMESH_MeshAlgos::Intersector::Algo::myDist2 |
| double SMESH_MeshAlgos::Intersector::Algo::myEps |
| const SMDS_MeshElement* SMESH_MeshAlgos::Intersector::Algo::myFace1 |
| const SMDS_MeshElement* SMESH_MeshAlgos::Intersector::Algo::myFace2 |
| int SMESH_MeshAlgos::Intersector::Algo::myInd1 |
Referenced by p2D().
| int SMESH_MeshAlgos::Intersector::Algo::myInd2 |
Referenced by p2D().
| TIntPointSet SMESH_MeshAlgos::Intersector::Algo::myIntPointSet |
| SMDS_Mesh* SMESH_MeshAlgos::Intersector::Algo::myMesh |
Referenced by createNode().
| int SMESH_MeshAlgos::Intersector::Algo::myNbOnPlane1 |
| int SMESH_MeshAlgos::Intersector::Algo::myNbOnPlane2 |
| std::vector< SMESH_NodeXYZ > SMESH_MeshAlgos::Intersector::Algo::myNodes1 |
| std::vector< SMESH_NodeXYZ > SMESH_MeshAlgos::Intersector::Algo::myNodes2 |
| const std::vector< gp_XYZ >& SMESH_MeshAlgos::Intersector::Algo::myNormals |
| TNNMap SMESH_MeshAlgos::Intersector::Algo::myRemove2KeepNodes |
node merge map
| double SMESH_MeshAlgos::Intersector::Algo::myTol |