AcademySoftwareFoundation / AcademySoftwareFoundation/openvdb

MeshDataAdapter in volumeToMesh

Open
#900 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
3.4k
Forks
774
Avg merge
3d 9h
Merged PRs (30d)
34

Description

When using `openvdb::tools::meshToVolume()`, there is this great feature that allows you to pass a [`MeshDataAdapter`](https://www.openvdb.org/documentation/doxygen/interfaceMeshDataAdapter.html) that acts as pro proxy for reading mesh data.
This allows the user to plug a custom mesh structure into the rasterization process without the overhead of copying all the data into openvdb structures (`openvdb::Vec3d` and such).

Such a feature would be extremely valuable at the other end of the pipeline : when using`openvdb::tools::volumeToMesh()`.
As far as I know, there is now proxy mechanics for writing mesh data, making it cumbersome to write a custom mesh structure using openVDB dual contouring (instead, data is written in openVDB datatypes and then has to be copied/casted into the custom type).

The Interface would be something along those lines :
```c++
struct WriteOnlyMeshDataAdapter {
size_t createVertex(const openvdb::Vec3d& pos);
size_t createQuad(size_t v0, size_t v1, size_t v2, size_t v3);
};
```
Such a `WriteOnlyMeshDataAdapter` would be passed as a parameter to the [`volumeToMesh()`](https://github.com/AcademySoftwareFoundation/openvdb/blob/fb086e8829a55898ca50b2f43862d88bc7530997/openvdb/openvdb/tools/VolumeToMesh.h#L53) function.

Would it be concievable to add such a feature ?

Contributor guide

Open the contributing guide

Research direction

Start with openvdb/openvdb/tools/VolumeToMesh.h at volumeToMesh(), then compare the existing MeshDataAdapter interface linked for meshToVolume(). Done means volumeToMesh() supports a write-only adapter for receiving generated vertices and quads, with the API and implementation behavior resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.