yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #14072
Re: Shop::aabbExtrema() : from boost::python::tuple return type to std::vector<Vector3r> ?
Hi Jérôme,
This change would be sensible, seems to me (especially regarding your
second bullet point).
Note that pair<Vector3r,Vector3r> would make more sense than a vector<>.
I would point out that the implementation of this function looks sloppy in
various other ways:
- dereferencing body pointer without checking it
- dynamic cast
- only works for spheres
Isn't there a more generic extrema function somewhere? I'm wondering.
Bruno
On 1 August 2018 at 14:29, Jerome Duriez <jerome.duriez@xxxxxxxxx> wrote:
> Hi again,
>
> I would like changing in pkg/dem/Shop*pp the py::tuple aabbExtrema() [*]
> to std::vector<Vector3r>aabbExtrema() (keeping obviously the Python
> exposure).
>
>
> I think this would
>
> - make the Shop C++ files one (small) step closer from the ideal situation
> discussed at https://www.mail-archive.com/yade-dev@xxxxxxxxxxxxxxxxxxx/ms
> g13308.html
>
> - thus avoiding the back and forth Python-C++ boost conversions in all C++
> uses of aabbExtrema() e.g. [**]
>
> - help me solving easily https://bugs.launchpad.net/yade/+bug/1764424 ;-)
> (thanks Jan for suggestion)
>
> - change (I guess, after py/wrapper/customConverters.cpp) from the user's
> side the aabbExtrema() value (after typed in YADE terminal) from a tuple to
> a list...
>
>
> Thoughts ?
>
> Jérôme
>
> [*] https://github.com/yade/trunk/blob/master/pkg/dem/Shop.hpp#L165 and
> https://github.com/yade/trunk/blob/master/pkg/dem/Shop_02.cpp#L874
> [**] https://github.com/yade/trunk/blob/master/pkg/dem/Shop_02.cpp#L352
> and L353
>
> ------
> Chargé de Recherche / Research Associate
> Irstea, RECOVER
> 3275 route de Cezanne – CS 40061 13182 Aix-en-Provence Cedex 5 FRANCE
> +33 (0)4 42 66 99 21
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp
>
Follow ups
References