Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SofaBaseTopology] add intersection methods #2131

Merged
merged 11 commits into from
Jun 10, 2021

Conversation

Mrbunbun
Copy link
Contributor

@Mrbunbun Mrbunbun commented May 27, 2021

get intersections between triangle and segment, get intersection between edge and segment.

  • computeEdgeSegmentIntersection
  • computeIntersectionsLineTriangle

EDIT from @guparan : this PR also fixes #2107 (STC#11 coding sprint)


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@epernod epernod added pr: new feature Implement a new feature pr: status to review To notify reviewers to review this pull-request labels May 28, 2021
@@ -157,6 +157,11 @@ class EdgeSetGeometryAlgorithms : public PointSetGeometryAlgorithms<DataTypes>
/** return a pointer to the container of cubature points */
NumericalIntegrationDescriptor<Real,1> &getEdgeNumericalIntegrationDescriptor();

bool computeEdgeSegmentIntersection(EdgeID edgeID,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the point of the PR as it is also done in the existing code but it would be better to use Real instead of double.


const Edge& e = this->m_topology->getEdge(edgeID);
const VecCoord& p = (this->object->read(core::ConstVecCoordId::position())->getValue());
const typename DataTypes::Coord& c0 = p[e[0]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a requirement but using 'auto' is more readable

@guparan guparan added pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels Jun 8, 2021
@Mrbunbun Mrbunbun requested a review from fredroy June 9, 2021 12:18
@fredroy fredroy added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Jun 9, 2021
@fredroy
Copy link
Contributor

fredroy commented Jun 9, 2021

[ci-build][with-all-tests]

@fredroy fredroy added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Jun 10, 2021
@fredroy fredroy merged commit 914729b into sofa-framework:master Jun 10, 2021
hugtalbot pushed a commit to hugtalbot/sofa that referenced this pull request Jun 14, 2021
* [sofaBaseTopology] add computeRestTriangleBarycoef method

* [TearingEngine] save

* [TearingEngine] begin setting up fracture path algo

* [TriangleSetGeometryAlgorithms.inl] get intersectionS between a segment and a point

* Test commit

* [TriangleSetAlgorithms] add output vecCoordKmin in computeSegmentTriangleIntersections

* [TriangleSetGeometryAlgorithms] add function to compute all intersections between a segment and a triangle

* [SofaGuiQt] remove useless line (sofa-framework#2107)

* [Topology] apply request changes (sofa-framework#2131)

Co-authored-by: epernod <erik.pernod@gmail.com>

Real deno, num;
deno = d1010 * dbaba - dba10 * dba10;
if (!abs(deno) <= EPS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect a logic issue here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EdgeSetGeometryAlgorithms.inl:935:9: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
if (!abs(deno) <= EPS)

@guparan guparan changed the title [Topology] add intersection methods [SofaBaseTopology] add intersection methods Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: new feature Implement a new feature pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unreachable code
5 participants