20 auto join = [&](std::vector<FaceType>& existing,
21 const std::vector<FaceType>& additional) ->
void {
22 for (
const auto& aface : additional) {
25 [&](
size_t x) {
return (
x + cvert); });
26 existing.push_back(nface);
35 for_each(vertices.begin(), vertices.end(),
36 [&](
auto&
v) {
v = transform *
v; });
43 auto vt = (transform *
v);
52 for (
const auto& face : faces) {
53 std::vector<Vector3D> tface;
54 tface.reserve(face.size());
56 tface.push_back(vtxs[f]);
67 auto radialDistance = [&](
const Vector3D& pos1,
70 Vector2D p1p2 = (pos2.block<2, 1>(0, 0) - pos1.block<2, 1>(0, 0));
71 double L = p1p2.norm();
72 Vector2D p1O = (O - pos1.block<2, 1>(0, 0));
78 double f = p1p2.dot(p1O) /
L;
82 Vector2D closest = f * p1p2.normalized() + pos1.block<2, 1>(0, 0);
83 double dist = (closest - O).norm();
87 for (
size_t iv = 1; iv < vtxs.size() + 1; ++iv) {
88 size_t fpoint = iv < vtxs.size() ? iv : 0;
89 double testR = radialDistance(vtxs[fpoint], vtxs[iv - 1]);