LiangliangNan / Easy3D

A lightweight, easy-to-use, and efficient C++ library for processing and rendering 3D data
GNU General Public License v3.0
1.37k stars 245 forks source link

is_border problem #164

Closed Roy2xc closed 1 year ago

Roy2xc commented 1 year ago

Sorry for bothering you, I have a simple question: Here is my input obj:

OBJ exported from Easy3D (liangliang.nan@gmail.com)

v 14.6355 66.0657 926.721 v 14.6399 82.9713 926.721 v -25.0932 83.9588 926.721 v -26.9141 66.776 926.721 v -32.9333 38.2332 926.721 v -20.5284 35.2653 926.721 v -13.5478 66.3472 926.721 v 14.6355 66.0657 947.721 v 14.6399 82.9713 947.721 v -25.0932 83.9588 947.721 v -26.9141 66.776 947.721 v -32.9333 38.2332 947.721 v -20.5284 35.2653 947.721 v -13.5478 66.3472 947.721 vn 0.574638 -0.580557 -0.57684 vn 0.58389 0.569413 -0.578655 vn -0.536453 0.611413 -0.581714 vn -0.686705 0.1085 -0.718794 vn -0.689156 -0.435975 -0.578783 vn 0.432266 -0.693291 -0.576622 vn 0.296181 -0.37389 -0.87891 vn 0.574638 -0.580557 0.57684 vn 0.58389 0.569413 0.578654 vn -0.536453 0.611413 0.581714 vn -0.686705 0.1085 0.718794 vn -0.689156 -0.435975 0.578783 vn 0.432266 -0.693291 0.576622 vn 0.296181 -0.37389 0.87891 f 5/5 4/4 6/6 f 6/6 4/4 3/3 f 6/6 3/3 7/7 f 7/7 3/3 2/2 f 7/7 2/2 1/1 f 8/8 9/9 14/14 f 14/14 9/9 10/10 f 14/14 10/10 13/13 f 13/13 10/10 11/11 f 13/13 11/11 12/12 f 1/1 2/2 9/9 f 1/1 9/9 8/8 f 2/2 3/3 10/10 f 2/2 10/10 9/9 f 3/3 4/4 11/11 f 3/3 11/11 10/10 f 4/4 5/5 12/12 f 4/4 12/12 11/11 f 5/5 6/6 13/13 f 5/5 13/13 12/12 f 6/6 7/7 14/14 f 6/6 14/14 13/13 f 7/7 1/1 8/8 f 7/7 8/8 14/14

Why "is_border" function not works on this obj? It should have halfedges.

Roy2xc commented 1 year ago

Code like this: for (auto f : input_model->faces()) { if (input_model->is_border(f)) { cout << "find" << f << endl; } }

i also tried model->halfedges() / edges() and vectices() ...

Roy2xc commented 1 year ago

Other PLY files work well... just this obj not work, I'm confused...

LiangliangNan commented 1 year ago

Can you post your obj file here (as a file, not copy-paste the content)?

Roy2xc commented 1 year ago

sorry github don't support obj file type...

LiangliangNan commented 1 year ago

Your posted file content is indeed a closed model without borders.

        model has 1 connected components
        0: sphere, F = 24, V = 14, E = 36, B = 0

What do you expect?

You can compress both the PLY and OBJ files into a single ZIP file and post it here (so I can compare).

Roy2xc commented 1 year ago

building-small.zip

LiangliangNan commented 1 year ago

Conclusion:

Roy2xc commented 1 year ago

Maybe I misunderstand the "border", thank you for your answer!!