Open3D triangulation algorithm

1. Introduction

Here, an Ear Clipping triangulation algorithm is implemented based on the ideas in PCL. The specific process is as follows:

1. First judge whether the endpoints of the polygon are sorted clockwise or counterclockwise. If they are sorted counterclockwise, flip the endpoints.
2. Judge the closure of the polygon to prevent the situation where the first and last points are the same.
3. The tail point of the remaining endpoints, the first point of the remaining endpoints and the second point of the remaining endpoints form a triangle. Afterwards, it will be judged whether the newly generated triangle is an "ear" triangle, if so, the triangle will be "cut off", otherwise, the first point will be skipped, and the above process will be performed again.
4. Until all the "ear" triangles in the polygon are segmented.

Two, implement the code

EarClipping.h

#ifndef EARCLIPPING_H
#

Guess you like

Origin blog.csdn.net/dayuhaitang1/article/details/130095169