-
Notifications
You must be signed in to change notification settings - Fork 311
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
Conversation
…ngleIntersections
…ions between a segment and a triangle
@@ -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, |
There was a problem hiding this comment.
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.
SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/EdgeSetGeometryAlgorithms.inl
Outdated
Show resolved
Hide resolved
SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/EdgeSetGeometryAlgorithms.inl
Outdated
Show resolved
Hide resolved
|
||
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]]; |
There was a problem hiding this comment.
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
SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/EdgeSetGeometryAlgorithms.inl
Outdated
Show resolved
Hide resolved
SofaKernel/modules/SofaBaseTopology/src/SofaBaseTopology/TriangleSetGeometryAlgorithms.inl
Outdated
Show resolved
Hide resolved
[ci-build][with-all-tests] |
* [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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
get intersections between triangle and segment, get intersection between edge and segment.
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