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

Added Ellipsoid Geometry #203

Merged
merged 11 commits into from
Feb 12, 2021
Merged

Added Ellipsoid Geometry #203

merged 11 commits into from
Feb 12, 2021

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Jan 20, 2021

Added Ellipsoid geometry. Related with this issue #198

Ogre 2

Selección_095

Ogre:

Selección_094

Signed-off-by: ahcorde ahcorde@gmail.com

Signed-off-by: ahcorde <ahcorde@gmail.com>
@ahcorde ahcorde added the 🏢 edifice Ignition Edifice label Jan 20, 2021
@ahcorde ahcorde requested a review from iche033 January 20, 2021 14:33
@ahcorde ahcorde self-assigned this Jan 20, 2021
@ahcorde ahcorde added this to Inbox in Core development via automation Jan 20, 2021
Signed-off-by: ahcorde <ahcorde@gmail.com>
Signed-off-by: ahcorde <ahcorde@gmail.com>
@codecov
Copy link

codecov bot commented Jan 20, 2021

Codecov Report

Merging #203 (2d3b459) into main (c6fc79f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #203   +/-   ##
=======================================
  Coverage   57.01%   57.01%           
=======================================
  Files         151      151           
  Lines       15010    15010           
=======================================
  Hits         8558     8558           
  Misses       6452     6452           
Impacted Files Coverage Δ
include/ignition/rendering/Scene.hh 0.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6fc79f...2d3b459. Read the comment docs.

@chapulina chapulina moved this from Inbox to In review in Core development Jan 21, 2021
Signed-off-by: ahcorde <ahcorde@gmail.com>
@ahcorde
Copy link
Contributor Author

ahcorde commented Jan 21, 2021

Depends on gazebosim/gz-common#154

@ahcorde ahcorde added the needs upstream release Blocked by a release of an upstream library label Jan 21, 2021
@ahcorde ahcorde moved this from In review to In progress in Core development Jan 25, 2021
Signed-off-by: ahcorde <ahcorde@gmail.com>
EllipsoidPtr Ogre2Scene::CreateEllipsoidImpl(unsigned int _id,
const std::string &_name)
{
Ogre2EllipsoidPtr ellipsoid(new Ogre2Ellipsoid);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious, why did you create an Ogre2Ellipsoid class instead of following the same pattern as sphere, cylinder, box, plane, and using CreateMeshImpl?

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 created an implementation without having a look how the basic shapes were done. I can remove the code in both shapes (capsule and ellipsoid) probably is going to be easy to maintain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@iche033 any thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 on using CreateMeshImpl. We could add a unit_ellipsoid in ign-common and make use of that here in ign-rendering.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update 61644e4

Signed-off-by: ahcorde <ahcorde@gmail.com>
@ahcorde ahcorde linked an issue Feb 4, 2021 that may be closed by this pull request
MeshPtr OgreScene::CreateEllipsoidImpl(
unsigned int _id, const std::string &_name)
{
return this->CreateMeshImpl(_id, _name, "unit_ellipsoid");
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed in gazebosim/gz-common#165, this could just be unit_sphere

// create ellipsoid visual
VisualPtr ellipsoidVisual = _scene->CreateVisual();
auto ellipsoid = _scene->CreateEllipsoid();
ellipsoid->SetRadii(ignition::math::Vector3d(1.2, 0.7, 0.5));
Copy link
Contributor

Choose a reason for hiding this comment

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

This example needs to be updated now that there's no ellipsoid class. The ellipsoid's size will be defined using SetLocalScale, the same way as the sphere above.

Which brings the question of whether special API is needed for the ellipsoid at all. Despite its name, ign-rendering's "sphere" already behaves like an "ellipsoid", because it can be scaled in 3 dimensions.

At this point, my suggestion would be to:

  • remove all the ellipsoid logic added in this PR
  • update CreateSphere's documentation to say that it can be used to create ellipsoids
  • update this example to create an "ellipsoid" through the CreateSphere function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the bullet points 👷

Core development automation moved this from In progress to In review Feb 11, 2021
Signed-off-by: ahcorde <ahcorde@gmail.com>
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Thanks for iterating! The demo is very suspenseful 😆 I'm staring asking "where's the green ellipsoid 👀 😅

ellipsoid

@chapulina chapulina merged commit 37db54a into main Feb 12, 2021
Core development automation moved this from In review to Done Feb 12, 2021
@chapulina chapulina deleted the ahcorde/feature/ellipsoid branch February 12, 2021 20:30
@chapulina chapulina removed the needs upstream release Blocked by a release of an upstream library label Feb 12, 2021
@j-rivero j-rivero removed this from Done in Core development May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏢 edifice Ignition Edifice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support ellipsoid geometry
3 participants