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

In 2d, why is Triangular not implementing Shape? #339

Open
robinmoussu opened this issue Jun 12, 2020 · 4 comments
Open

In 2d, why is Triangular not implementing Shape? #339

robinmoussu opened this issue Jun 12, 2020 · 4 comments

Comments

@robinmoussu
Copy link

I think I don't understand what the use of Triangular is since it doesn't implements the trait Shape. After reading #202, it feels that the right shape to use is ConvexPolygon, but in that case, I don't see why Triangular exists at all (and I'm sure there is a reason). I think that the documentation could be more explicit.

@sebcrozet
Copy link
Member

Hi!

Yes, Triangle does not implements the trait Shape because that would be redundant with ConvexPolygon.

Yet, triangles exist because they are used by triangle-meshes to simply their collision detection. So basically, they are not expected to be used directly by the end-user, but are useful for algorithmic reasons.

I agree the documentation should be more explicit. Or event better: you should consider putting in the shape module only geometries actually implementing the Shape trait.

@robinmoussu
Copy link
Author

I also have the same question for Compound. I guess, it's the same answer?

@sebcrozet
Copy link
Member

Shape is implemented for Compound.

@robinmoussu
Copy link
Author

I don't know what I've done, I guess I did a syntax error and was too tired, so I just iterated over my ConvexPolgon manually.

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

No branches or pull requests

2 participants