openframeworks / openframeworks/openFrameworks

0071 ply (mesh.save()) Point export is broken

Open
#1,252 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core feature section-3D
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

unsigned char faceSize = 3;
if(data.getNumIndices()){
    os << "element face " << data.getNumIndices() / faceSize << endl;
    os << "property list uchar int vertex_indices" << endl;
} else if(data.getMode() == OF_PRIMITIVE_TRIANGLES) {
    os << "element face " << data.getNumVertices() / faceSize << endl;
    os << "property list uchar int vertex_indices" << endl;
}

The facesize is being set as static as 3, but this results in strange exports...things open OK in Meshlab, but exporting to other programs with no faces seems like it won't work

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the PLY export logic shown in the issue and trace how mesh.save() writes face counts and vertex indices for indexed and triangle meshes. Reproduce the export with a mesh that has no faces, then compare the generated PLY in Meshlab and another affected program. Done means the exported PLY is accepted consistently, including when no faces are present.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.