Discreprancies between the results given by the python api and the list command

Hi all,

I noticed a discrepancy between some results from the Python API and the results given by the cubit command.

As you can see in the following example, when I run the cubit command “list vol 1 geom”, I have a different volume and centroid than the volume and centroid given by the API.

Am I doing something wrong? Did I miss something or is it a bug?

Hi @rayan,
could you share the geometry or better the journal file so that we can reproduce this and take a look?
Did you use Cubit 2024.3 or a different version?

Hi @Norbert_Hofbauer,

I can’t share the file i used to get what i assume to be a bug in my original post but i managed to recreate it using the following step file.

Bug.stp (40.3 KB)


Also to anwer your second question, i use Cubit 2023.11.

it seems cubit.get_center_point("volume",1) gets you the coordinates for a bounding box of the volume.

to get the centroid like from list volume 1 geom you will have to use cubit.volume(1).centroid()


You can create and check the bounding box with

create brick bounding box Volume 1 tight
list volume 2 geom

For the bounding box cubit.get_center_point("volume",2) and cubit.volume(2).centroid() matches.

the difference in the volumes seems to be some sort of conversion error. C++, python and also the qt gui uses different data types, but they should output the same value.

Thanks for reporting this, i will inform the dev’s.