Skip to content

Commit

Permalink
more refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rath3t committed Feb 5, 2024
1 parent e7325ec commit 817e067
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dune/iga/trimmer/defaulttrimmer/elementtrimdata.hh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace Dune::IGANEW::DefaultTrim {

/* this is for testing purposes only */
void drawResult(const std::string& filename, bool inParameterSpace, bool newFig = true) {
if (static_cast<int>(flag_) == 1) return;
if (flag_ == ElementTrimFlag::empty) return;
auto eleGeometry = hostEntity_.geometry();
auto lowerLeftCorner = inParameterSpace ? eleGeometry.corner(0) : Dune::FieldVector<double, 2>({0, 0});
auto upperRightCorner = eleGeometry.corner(3);
Expand Down Expand Up @@ -146,8 +146,9 @@ namespace Dune::IGANEW::DefaultTrim {
}

matplot::axis(matplot::equal);
static int elleC=0;
if (newFig)
matplot::save(filename + (inParameterSpace ? "inParameterSpace" : ""), "gif");
matplot::save(filename +std::to_string(elleC++)+ (inParameterSpace ? "inParameterSpace" : ""), "gif");
}
bool checkInside(const Dune::FieldVector<double, 2>& local) const {
Clipper2Lib::PointD p(local[0], local[1]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ namespace Dune::IGANEW::DefaultTrim::Util {
&& "The points of the trimming curves should be on the same loop");
assert(firstTrimmingCurvePoint.z==secondTrimmingCurvePoint.z or secondTrimmingCurvePoint.z== intersectionPoint.z or firstTrimmingCurvePoint.z== intersectionPoint.z &&
"The indices of the trimming curves should be the same or the intersection point should be on one of the two second curves");
const auto curveZ = secondTrimmingCurvePoint.z;
const auto vertexZValue = secondTrimmingCurvePoint.z;

// Now check that we don't have a parallel intersection
if (checkParallel(patchTrimData.getCurve(curveZ), edgeIdx)) return;
if (checkParallel(patchTrimData.getCurve(vertexZValue), edgeIdx)) {
return;
}

result.addNewVertex(edgeIdx, intersectionPoint, curveZ);
result.addNewVertex(edgeIdx, intersectionPoint, vertexZValue);
});

PathsD resultClosedPaths{};
Expand Down

0 comments on commit 817e067

Please sign in to comment.