mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-11 16:06:04 -06:00
#2122 Intersection clip surface on tighter bounds than bounding box
This commit is contained in:
parent
e765a9ad59
commit
181871f970
@ -127,7 +127,6 @@ void RivIntersectionGeometryGenerator::calculateArrays()
|
|||||||
sectionBBox.add(p1 - maxHeightVec);
|
sectionBBox.add(p1 - maxHeightVec);
|
||||||
sectionBBox.add(p2 + maxHeightVec);
|
sectionBBox.add(p2 + maxHeightVec);
|
||||||
sectionBBox.add(p2 - maxHeightVec);
|
sectionBBox.add(p2 - maxHeightVec);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -165,6 +164,38 @@ void RivIntersectionGeometryGenerator::calculateArrays()
|
|||||||
&hexPlaneCutTriangleVxes,
|
&hexPlaneCutTriangleVxes,
|
||||||
&isTriangleEdgeCellContour);
|
&isTriangleEdgeCellContour);
|
||||||
|
|
||||||
|
if (m_crossSection->type == RimIntersection::CS_AZIMUTHLINE)
|
||||||
|
{
|
||||||
|
bool hasAnyPointsOnSurface = false;
|
||||||
|
for (caf::HexGridIntersectionTools::ClipVx vertex : hexPlaneCutTriangleVxes)
|
||||||
|
{
|
||||||
|
cvf::Vec3d temp = vertex.vx - p1;
|
||||||
|
double dot = temp.dot(m_extrusionDirection);
|
||||||
|
double lengthCheck;
|
||||||
|
//if (vertex.vx.z() > p1.z())
|
||||||
|
|
||||||
|
if (dot < 0)
|
||||||
|
{
|
||||||
|
lengthCheck = maxSectionHeightUp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lengthCheck = maxSectionHeightDown;
|
||||||
|
}
|
||||||
|
|
||||||
|
double distance = cvf::Math::sqrt(cvf::GeometryTools::linePointSquareDist(p1, p2, vertex.vx));
|
||||||
|
if (distance < lengthCheck)
|
||||||
|
{
|
||||||
|
hasAnyPointsOnSurface = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!hasAnyPointsOnSurface)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<caf::HexGridIntersectionTools::ClipVx> clippedTriangleVxes;
|
std::vector<caf::HexGridIntersectionTools::ClipVx> clippedTriangleVxes;
|
||||||
std::vector<bool> isClippedTriEdgeCellContour;
|
std::vector<bool> isClippedTriEdgeCellContour;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user