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

Add threePlanesIntersection #571

Merged
merged 1 commit into from
Mar 15, 2014
Merged

Add threePlanesIntersection #571

merged 1 commit into from
Mar 15, 2014

Conversation

VictorLamoine
Copy link
Contributor

This new function allow the user to get the intersection point between three planes :

  • True is returned and the point is filled in case of success
  • False is returned if two or more planes are parallel

EXPECT_EQ(1.0f, plane_a.x());
EXPECT_EQ(0.0f, plane_a.y());
EXPECT_EQ(0.0f, plane_a.z());
EXPECT_EQ(-0.5f, plane_a.w());
Copy link
Member

Choose a reason for hiding this comment

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

What is the purpose of these checks? Do you suspect that assignment won't work for Eigen::Vector4f? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounded weird to me; in the original files it is done several times to check the assignement. Lines 207->210 etc.. Should I remove it ?

Copy link
Member

Choose a reason for hiding this comment

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

Well... sometimes existing code-base is not the best example. These checks are totally useless (apart from the fact that EXPECT_FLOAT_EQ should be used to check floating point numbers).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the useless assignement check and replaced checks to EXPECT_FLOAT_EQ

@taketwo
Copy link
Member

taketwo commented Mar 14, 2014

I am not sure if the function name is good. It sounds like it will compute an intersection of three planes and a point (which of course does not make sense).

Hmm, planeWithPlaneWithPlaneIntersection() describes the purpose well, but sounds stupid. What else...

  • planeWithTwoPlanesIntersection()
  • threePlanesIntersection()
  • intersectionOfThreePlanes()

Any other ideas?

@VictorLamoine
Copy link
Contributor Author

I like threePlanesIntersection(), it looks like the other names and describe well what is does.
Makes me think there's the case when the 3 planes intersects in a line; my code would find any point on this line; I added this to the documentation notes !

@taketwo
Copy link
Member

taketwo commented Mar 14, 2014

Nice :) Okay, then let's go with threePlanesIntersection().

@VictorLamoine
Copy link
Contributor Author

Everything looks fine now:
Documentation: http://i.imgur.com/3ugtaUp.png

Should I change anything else @taketwo ?
I squashed/renamed the commits

plane_a.x() = x;
plane_a.y() = y;
plane_a.z() = z;
plane_a.w() = w;
Copy link
Member

Choose a reason for hiding this comment

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

I understand that you copied over from the other test, but this really looks bizarre. These 9 lines could be replaced with just

Eigen::Vector4f plane_a (1.0f, 0.0f, 0.0f, -0.5f);

@taketwo
Copy link
Member

taketwo commented Mar 15, 2014

There are a few missing spaces between function names and braces that should be added to conform to PCL style guide.

Apart from that I think we are pretty close to merging.

@VictorLamoine
Copy link
Contributor Author

I corrected the spaces.
Sorry I'm not yet acquainted to the coding style.

}

double determinant = normals_in_lines.determinant ();
if (fabs(determinant) < determinant_tolerance)
Copy link
Member

Choose a reason for hiding this comment

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

The last one survived :)

@VictorLamoine
Copy link
Contributor Author

Done, the test function is now much shorter and readable!

@taketwo
Copy link
Member

taketwo commented Mar 15, 2014

Oh yeah, looks great now.

So let's give Travis a chance to verify everything is all right. Once it's done I'll merge.

taketwo added a commit that referenced this pull request Mar 15, 2014
@taketwo taketwo merged commit 7525218 into PointCloudLibrary:master Mar 15, 2014
@taketwo
Copy link
Member

taketwo commented Mar 15, 2014

Thanks!

@VictorLamoine VictorLamoine deleted the intersections branch March 15, 2014 19:23
@VictorLamoine VictorLamoine restored the intersections branch April 11, 2014 11:02
@VictorLamoine VictorLamoine deleted the intersections branch April 11, 2014 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants