Skip to content

Custom metadata support #19

@romanov6416

Description

@romanov6416

Hi!

First, thank you for the library development.
I want to use this lib in my python project. In addition to 3D geometry (draco mesh) I have to serialize/deserialize custom metadata attached to the mesh in the draco file. I see that current version of DracoPy doesn't support custom metadata. So I decided to make my own implementation of this in DracoPy.pyx file. And here I bumped into the problem:

I implemented recursive metadata struct.
in DracoPy.h:

  struct MetadataObject {
    std::unordered_map<std::string, std::vector<uint8_t>> entries;
    std::unordered_map<std::string, MetadataObject> sub_metadatas;
  };

And DracoPy.pxd

cdef extern from "DracoPy.h" namespace "DracoFunctions":
    cdef struct MetadataObject:
        unordered_map[string, vector[uint8_t]] entries
        unordered_map[string, MetadataObject] sub_metadatas

Also I added a function (to DracoPy.h) parsing draco metadata to MetadataObject and pass it into encode_mesh function.

And when I try to compile my solution I got cython compilation error:
RecursionError: maximum recursion depth exceeded while calling a Python object

I know declaring recursive structures is possible in Cython.
But it seems impossible to declare EXTERNAL recursive structures in Cython (I didn't find anything about it in google)

So my question is do you have ideas how to forward draco structure Metadata to Python?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions