Code Monkey home page Code Monkey logo

Comments (10)

ondys avatar ondys commented on August 15, 2024

Hi,

our PLY reader and writer is currently limited to built-in attributes only (positions, colors, ..). Any custom attributes are ignored on load. At this moment, generic attributes can be compressed only when the draco::Mesh is constructed through our API directly, but we plan to add support for more attributes to our PLY decoder in near future.

from draco.

ataber avatar ataber commented on August 15, 2024

Is this an area where contributions would be welcome?

from draco.

ondys avatar ondys commented on August 15, 2024

@ataber We always welcome contributions, but depending on what you are planning to do, this project may benefit from a closer cooperation with us.

What we are planning to do is to add support for generic metadata for meshes and attributes. This metadata can be then used to hold for example a property name that could be then preserved during the decoding step.

Adding support for metadata would be certainly a relatively big change to our framework which would require some input from our team.

On the other hand, if the scope would be more narrow.. let's say you would be interested in extending our PlyDecoder to support loading of arbitrary PLY properties as GENERIC attributes, then we would definitely welcome this contribution and it would most likely not require our oversight.

from draco.

ataber avatar ataber commented on August 15, 2024

I think the more narrow change would fit my application's needs. What do GENERIC attributes look like when decoded in JS? I assume they're exposed as a map from attribute name -> list of values?

from draco.

ondys avatar ondys commented on August 15, 2024

They are just like any other attribute .. just an array of values for all points of the mesh.
But as I mentioned earlier, we currently don't store attribute names... that's why we cannot preserve general attributes that can be found in ply files (and that's what we want to solve with the added metadata).

What you can do to differentiate GENERIC attributes is to use different custom_ids for each attribute (see GeometryAttribute::set_custom_id() method). Custom id is preserved during encoding and it can be used by the javascript client app .. e.g.:

for (let i = 0; i < dracoGeometry.num_attributes(); i++) {
    const attribute = wrapper.GetAttribute(dracoGeometry, i)
    if (attribute.attribute_type() === Module.GENERIC) {
      if (attribute.custom_id() === 0) { 
        // attribute is X (e.g. material ids)
      }
      if (attribute.custom_id() === 1) { 
        // attribute is Y (e.g. vertex weights)
      }
      ...
    }
}

from draco.

ataber avatar ataber commented on August 15, 2024

Okay, thanks for the hint :)

Looking through the code it looks like it would require another large change to store face properties - is that assessment correct?

from draco.

ondys avatar ondys commented on August 15, 2024

Not necessarily. We already do have support for storing per-face attributes. You can check our TriangleSoupMeshBuilder class for an example. It has a method SetAttributeValuesForFace() that can be used to set per-face attribute values. The similar approach can be applied in the PlyDecoder as well.

from draco.

FrankGalligan avatar FrankGalligan commented on August 15, 2024

I'm closing this issue. If you are still having problems please re-open.

from draco.

GumpXiaoli avatar GumpXiaoli commented on August 15, 2024

This issue seems not be fixed yet in the latest master branch.
Is there any plan recently?

from draco.

sg2nq avatar sg2nq commented on August 15, 2024

Hi @ondys @FrankGalligan I'm trying to do something similar, in that I also need to encode other properties like property float scalar_Scalar_field. Is there any support for this kind of situation now?

from draco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.