[Python] Convert CloudComPy HObject to a Mesh

Discussão em 'Python' iniciado por Stack, Abril 29, 2025.

  1. Stack

    Stack Membro Participativo

    I have a .obj file which I am converting to a point cloud using Cloud Compare Python API. Using the following code:

    import cloudComPy as cc

    cc.initCC()

    mesh = cc.loadMesh("path/to/.obj")


    This .obj file is obtained from a CAD Drawing and has several parts in it having a structure:

    A
    - B
    - C
    - D


    I am trying to obtain the point cloud of each component "B", "C" & "D" However, obtaining the children of "A" gets me a cc.HObject which does not seem to have any mesh or point cloud information

    child = mesh.getChild(1)


    child <_cloudComPy.ccHObject object at 0x00000208A39DF330>.

    Is it possible to generate a point cloud for each child component, and also set the color of the respective point cloud? Thanks!

    Continue reading...

Compartilhe esta Página