How do i get the centroid coordinate details of the Bodies, faces, and edges

Gopi Raju Velpula
Gopi Raju Velpula Member Posts: 28
10 Comments First Anniversary First Answer Name Dropper
**

can some one suggest me how do i get the centroid of the particular object in my geometry
like centroid of the particular body, face and edge
i would like to know the x,y,z coordinate points by using PyGeometry module.
any suggestions..

Comments

  • NickFL
    NickFL Member Posts: 5
    Name Dropper First Comment
    **

    Hello Gopi,

    In SpaceClaim, here is how I would go about this. First I would create a selection for the appropriate item. Then I would use the GetCentroid() option out of the _MeasureHelper _to find the location. I would assign this to a dummy variable and then can access this point. You can easily access it components to write it to a file or something.

    selection = FaceSelection.Create(GetRootPart().Bodies[0].Face[0])
    out = MeasureHelper(selection)
    print(out.X, out.Y, outZ)

  • Gopi Raju Velpula
    Gopi Raju Velpula Member Posts: 28
    10 Comments First Anniversary First Answer Name Dropper
    **

    @NickFL thanks for your response.
    able to create it by using "MeasureHelper.GetCentroid(face)".

  • NickFL
    NickFL Member Posts: 5
    Name Dropper First Comment
    **

    @Gopi Raju Velpula said:
    @NickFL thanks for your response.
    able to create it by using "MeasureHelper.GetCentroid(face)".

    Yes you are correct, I forgot to include the GetCentroid . :facepalm: