Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the environment of QT #5

Closed
yumianhuli2 opened this issue Apr 21, 2020 · 10 comments
Closed

About the environment of QT #5

yumianhuli2 opened this issue Apr 21, 2020 · 10 comments

Comments

@yumianhuli2
Copy link

I'm sorry I haven't used QT!Please introduce the installation environment and version of QT,and how to use your code in QT?Thank you!

@artem-ogre
Copy link
Owner

You only need Qt if you would like to run the demo tool. The library itself can be just used by copying header files.

To build .pro file you would need qmake which comes with Qt.
Please refer to the docs: https://doc.qt.io/qt-5/qmake-running.html

Or you could open .pro in QtCreator which supports qmake out of the box.

Does this answer your question?

@yumianhuli2
Copy link
Author

yumianhuli2 commented Apr 21, 2020

You only need Qt if you would like to run the demo tool. The library itself can be just used by copying header files.

To build .pro file you would need qmake which comes with Qt.
Please refer to the docs: https://doc.qt.io/qt-5/qmake-running.html

Or you could open .pro in QtCreator which supports qmake out of the box.

Does this answer your question?

Hi! I copyed header files,and got results,but if I put point8 which inside the Concave polygon,the result is not right,the code is below:

#include <iostream>
#include "CDT.h"
#include "VerifyTopology.h"
#include "CDTUtils.h"

using Triangulation = CDT::Triangulation<float>;

typedef float CoordType;
typedef CDT::V2d<CoordType> V2d;
typedef CDT::Edge Edge;



int main() {
    std::cout << "Hello, World!" << std::endl;

    std::vector<V2d> pts;

    std::vector<Edge> edges;

    Triangulation cdt =
            Triangulation(CDT::FindingClosestPoint::BoostRTree);
    //point0
    pts.push_back({-1,0});
    //point1
    pts.push_back({1,0});
    //point2
    pts.push_back({1,1});
    //point3
    pts.push_back({0.5,1});
    //point4
    pts.push_back({0.5,2});
    //point5
    pts.push_back({-0.5,2});
    //point6
    pts.push_back({-0.5,1});
    //point7
    pts.push_back({-1,1});
    //point8
    pts.push_back({0.75,0.5});


    cdt.insertVertices(pts);



    edges.push_back(Edge(0, 1));
    edges.push_back(Edge(1, 2));
    edges.push_back(Edge(2, 3));
    edges.push_back(Edge(3, 4));
    edges.push_back(Edge(4, 5));
    edges.push_back(Edge(5, 6));
    edges.push_back(Edge(6, 7));
    edges.push_back(Edge(7, 0));
    cdt.insertEdges(edges);
    cdt.eraseOuterTriangles();


    std::cout<<cdt.triangles.size()<<std::endl;

    for (int j = 0; j <cdt.triangles.size(); ++j) {
        for (int k = 0; k < cdt.triangles[j].vertices.size(); ++k) {
            std::cout<<cdt.triangles[j].vertices[k]<<std::endl;
        }
    }
    return 0;
}

and I got indexs
8
0
1
8
2
3
8
3
6
8
4
5
3
3
5
6
0
6
7
2
8
1
0
8
6

but If I delete point8 ,the result is fine,so How can I fix this,Thank you very much!

@artem-ogre
Copy link
Owner

artem-ogre commented Apr 22, 2020

Your output looks valid: there are 8 triangles as shown in the picture above.

@yumianhuli2
Copy link
Author

Your output looks valid: there are 8 triangles as shown in the picture above.

Oh! Yes!I added an extra 8,so...
1、By the way, If both the points and the constraint edges are correct,Is your library suitable for any situation?
2、Is it possible to directly implement to 3d points?
Thank you!

@artem-ogre
Copy link
Owner

artem-ogre commented Apr 22, 2020

1、By the way, If both the points and the constraint edges are correct,Is your library suitable for any situation?

I'm not quite sure what is the question here.
The library uses robust predicates, so it should work with any input that satisfies requirement of no duplicate points and no intersecting constraint edges.

2、Is it possible to directly implement to 3d points?

Triangulation is a 2D problem, for 3D you would need a tetrahedrization library. CDT only does triangulation in 2D

@yumianhuli2
Copy link
Author

1、By the way, If both the points and the constraint edges are correct,Is your library suitable for any situation?

I'm not quite sure what is the question here.
The library uses robust predicates, so it should work with any input that satisfies requirement of no duplicate points and no intersecting constraint edges.

2、Is it possible to directly implement to 3d points?

Triangulation is a 2D problem, for 3D you would need a tetrahedrization library. CDT only does triangulation in 2D

ok!I will make a mapping from 2d points to 3d points and use it in my work!Thank you!

@artem-ogre
Copy link
Owner

artem-ogre commented Apr 22, 2020

ok!I will make a mapping from 2d points to 3d points and use it in my work!Thank you!

Yes, if you just need to get a surface from 3D points, you could discard Z coordinate and use X and Y for triangulation :)

@yumianhuli2
Copy link
Author

yumianhuli2 commented Apr 22, 2020

ok!I will make a mapping from 2d points to 3d points and use it in my work!Thank you!

Yes, if you just need to get a surface from 3D points, you could discard Z coordinate and use X and Y for triangulation :)

Yes,surface!
but Could you plz provide a library link available for point cloud constrained-delaunay triangulation?

@artem-ogre
Copy link
Owner

If you want to make 2.5D surface (single Z for every X and Y) out of point cloud, just ignore Z. But if you would like to have a full 3D surface (folding, multiple Z at X and Y) then CDT can not do that.

@yumianhuli2
Copy link
Author

If you want to make 2.5D surface (single Z for every X and Y) out of point cloud, just ignore Z. But if you would like to have a full 3D surface (folding, multiple Z at X and Y) then CDT can not do that.

Got it!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants