Skip to content

Commit

Permalink
plane-poly intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
t-weber committed Jun 1, 2022
1 parent 7bf915b commit f815c1e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libs/math_algos.h
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,16 @@ requires is_vec<t_vec>
lineOrg, lineDir, planeNorm, plane_d, eps);

if(ty == 1 && lam >= 0. && lam < 1.)
{
// add intersection point
edgeInters.emplace_back(std::move(pos));
}
else if(ty == 2)
{
// line collinear to plane: add full line
edgeInters.push_back(lineOrg);
edgeInters.push_back(lineOrg + lineDir);
}
}

return edgeInters;
Expand Down

0 comments on commit f815c1e

Please sign in to comment.