PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
IntersectorMesh3DSegment.hpp
Go to the documentation of this file.
1// _LICENSE_HEADER_
2//
3// Copyright (C) 2019 - 2025.
4// Terms register on the GPL-3.0 license.
5//
6// This file can be redistributed and/or modified under the license terms.
7//
8// See top level LICENSE file for more details.
9//
10// This file can be used citing references in CITATION.cff file.
11
12#ifndef __IntersectorMesh3DSegment_H
13#define __IntersectorMesh3DSegment_H
14
15#include "Eigen/Eigen"
16#include "GeometryUtilities.hpp"
17#include "IMeshDAO.hpp"
18#include "MeshUtilities.hpp"
19
20namespace Gedim
21{
23{
24 public:
26 {
28 {
30 std::vector<unsigned int> Cell3DIds;
31 std::vector<GeometryUtilities::PointPolyhedronPositionResult> Positions;
32 };
33
35 {
36 std::array<unsigned int, 2> PointsIndex;
37 std::vector<unsigned int> Cell3DIds;
38 std::vector<GeometryUtilities::SegmentPolyhedronPositionResult> Positions;
39 };
40
41 std::vector<IntersectionMeshPoint> Points;
42 std::vector<IntersectionMeshSegment> Segments;
43 };
44
46 {
47 std::set<unsigned int> Cell3DIds;
48 };
49
56
57 private:
58 const Gedim::GeometryUtilities &geometryUtilities;
59 const Gedim::MeshUtilities &meshUtilities;
60
61 IntersectionPoint &CreateOrFindNewIntersection(const double &curvilinearCoordinate,
62 std::map<double, IntersectionPoint> &points,
63 bool &found) const;
64
65 bool CheckSegmentPolyhedronIntersection(const double &segment_intersection_coordinate,
66 const Eigen::Vector3d &segment_vertex,
67 const IMeshDAO &mesh3D,
68 const unsigned int cell3D_index,
69 const Eigen::MatrixXd &cell3D_BoundingBox,
70 const std::vector<Eigen::MatrixXi> &cell3D_faces,
71 const std::vector<Eigen::MatrixXd> &cell3D_faces_3D_vertices,
72 const std::vector<Eigen::MatrixXd> &cell3D_faces_2D_vertices,
73 const std::vector<Eigen::Vector3d> &cell3D_faces_normal,
74 const std::vector<bool> &cell3D_faces_normal_direction,
75 const std::vector<Eigen::Vector3d> &cell3D_faces_translation,
76 const std::vector<Eigen::Matrix3d> &cell3D_faces_rotation,
77 const std::vector<Eigen::MatrixXd> &cell3D_tetrahedrons,
78 std::map<double, IntersectionPoint> &mesh1D_intersections,
79 std::list<unsigned int> &cell3Ds_index) const;
80
81 bool CheckSegmentFaceIntersection(const Eigen::Vector3d &segment_origin,
82 const Eigen::Vector3d &segment_tangent,
85 const Eigen::Matrix3d &face_rotation,
86 const Eigen::Vector3d &face_translation,
87 const Eigen::MatrixXd &face_2D_vertices,
88 const IMeshDAO &mesh3D,
89 const unsigned int cell3D_index,
90 const unsigned int cell2D_index,
91 std::map<double, IntersectionPoint> &mesh1D_intersections,
92 std::list<unsigned int> &cell3Ds_index) const;
93
97 const unsigned int cell3D_index,
98 const unsigned int cell2D_index,
99 std::map<double, IntersectionPoint> &mesh1D_intersections,
100 std::list<unsigned int> &cell3Ds_index) const;
101
102 void InsertNewIntersection(const double &segment_intersection_coordinate,
103 const IMeshDAO &mesh3D,
104 const unsigned int cell3D_index,
105 const unsigned int cell2D_index,
106 std::map<double, IntersectionPoint> &mesh1D_intersections,
107 std::list<unsigned int> &cell3Ds_index) const;
108
109 std::vector<IntersectionMesh::IntersectionMeshSegment> CreateIntersectionSegments(
110 const Gedim::IMeshDAO &mesh3D,
111 const std::vector<IntersectionMesh::IntersectionMeshPoint> &mesh1D_points) const;
112
113 std::vector<IntersectionMesh::IntersectionMeshPoint> FindSegmentIntersectionPoints(
114 const Eigen::Vector3d &segmentOrigin,
115 const Eigen::Vector3d &segmentEnd,
116 const Eigen::Vector3d &segmentTangent,
117 const Gedim::IMeshDAO &mesh3D,
119 const unsigned int starting_cell3D_index) const;
120
121 void SegmentCell3DIntersection(const Eigen::Vector3d &segmentOrigin,
122 const Eigen::Vector3d &segmentEnd,
123 const Eigen::Vector3d &segmentTangent,
124 const Gedim::IMeshDAO &mesh3D,
126 const unsigned int cell3D_index,
127 std::map<double, IntersectionPoint> &mesh1D_intersections,
128 std::list<unsigned int> &cell3Ds_index) const;
129
130 public:
131 IntersectorMesh3DSegment(const Gedim::GeometryUtilities &geometryUtilities, const Gedim::MeshUtilities &meshUtilities);
133
135 static std::vector<std::vector<unsigned int>> MeshSegmentsCell3Ds(const IntersectorMesh3DSegment::IntersectionMesh &intersectingMesh);
137
139 const Eigen::Vector3d &segmentEnd,
140 const Eigen::Vector3d &segmentTangent,
141 const Gedim::IMeshDAO &mesh3D,
143
145 const Eigen::Vector3d &segmentEnd,
146 const Gedim::IMeshDAO &mesh3D,
148};
149} // namespace Gedim
150
151#endif
Eigen column vector.
Definition Eigen_Array.hpp:23
The GeometryUtilities class intersects 3D segments.
Definition GeometryUtilities.hpp:37
PointSegmentPositionTypes
Definition GeometryUtilities.hpp:68
The IMeshDAO (mesh data access object) class to read and write mesh data.
Definition IMeshDAO.hpp:24
Definition IntersectorMesh3DSegment.hpp:23
FindSegmentStartingCell3DResult FindSegmentStartingCell3D(const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd, const Gedim::IMeshDAO &mesh3D, const Gedim::MeshUtilities::MeshGeometricData3D &mesh3D_geometricData) const
Definition IntersectorMesh3DSegment.cpp:557
static std::vector< std::vector< unsigned int > > MeshSegmentsCell3Ds(const IntersectorMesh3DSegment::IntersectionMesh &intersectingMesh)
Definition IntersectorMesh3DSegment.cpp:38
~IntersectorMesh3DSegment()
Definition IntersectorMesh3DSegment.cpp:24
static std::string ToString(const IntersectorMesh3DSegment::IntersectionMesh &intersectingMesh)
Definition IntersectorMesh3DSegment.cpp:48
static std::vector< double > ToCurvilinearCoordinates(const IntersectorMesh3DSegment::IntersectionMesh &intersectingMesh)
Definition IntersectorMesh3DSegment.cpp:28
IntersectionMesh CreateIntersectionMesh(const Eigen::Vector3d &segmentOrigin, const Eigen::Vector3d &segmentEnd, const Eigen::Vector3d &segmentTangent, const Gedim::IMeshDAO &mesh3D, const Gedim::MeshUtilities::MeshGeometricData3D &mesh3D_geometricData) const
Definition IntersectorMesh3DSegment.cpp:915
MeshUtilities.
Definition MeshUtilities.hpp:23
Definition Eigen_Array.cpp:22
bool SegmentFullInsideCell3D
Definition IntersectorMesh3DSegment.hpp:53
GeometryUtilities::PointPolyhedronPositionResult Position
Definition IntersectorMesh3DSegment.hpp:54
unsigned int StartingCell3DIndex
Definition IntersectorMesh3DSegment.hpp:52
std::vector< GeometryUtilities::PointPolyhedronPositionResult > Positions
Definition IntersectorMesh3DSegment.hpp:31
double CurvilinearCoordinate
Definition IntersectorMesh3DSegment.hpp:29
std::vector< unsigned int > Cell3DIds
Definition IntersectorMesh3DSegment.hpp:30
std::array< unsigned int, 2 > PointsIndex
Definition IntersectorMesh3DSegment.hpp:36
std::vector< unsigned int > Cell3DIds
Definition IntersectorMesh3DSegment.hpp:37
std::vector< GeometryUtilities::SegmentPolyhedronPositionResult > Positions
Definition IntersectorMesh3DSegment.hpp:38
Definition IntersectorMesh3DSegment.hpp:26
std::vector< IntersectionMeshPoint > Points
Definition IntersectorMesh3DSegment.hpp:41
std::vector< IntersectionMeshSegment > Segments
Definition IntersectorMesh3DSegment.hpp:42
Definition IntersectorMesh3DSegment.hpp:46
std::set< unsigned int > Cell3DIds
Definition IntersectorMesh3DSegment.hpp:47
Definition MeshUtilities.hpp:215