[Gmsh] Point coordinates at python api

Jeremy Theler jeremy at seamplex.com
Fri May 18 11:58:15 CEST 2018



On Thu, 2018-05-17 at 21:12 +0200, Christophe Geuzaine wrote:
> On Thu, 2018-05-17 at 08:46 +0200, Christophe Geuzaine wrote:
> How could I get point coordinates at python api?
> gmsh.model.getBoundingBox(0, point_tag)
> Is there any way to get the center of gravity of a volume or surface?
> No, the actual center of gravity requires a mesh - you could mesh (even relatively coarsely) and compute it then using the api by looping over the elements.
> 

OCC provides that information through brepgprop_VolumeProperties, brepgprop_SurfaceProperties and brepgprop_LinearProperties.
There is a CentreOfMass() method that returns a vector. There also exists a Mass() method that gives either the volume, surface or length of the entity.
I call them through PythonOCC, but if that interface was provided by Gmsh API then I would not need to read the same BREP file both with PythonOCC and Gmsh.

BTW, I love the new Gmsh API :-)

--
jeremy theler
www.seamplex.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20180518/4829407a/attachment.html>


More information about the gmsh mailing list