Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/164.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ CGAL曲面网格-修改顶点坐标_C++_Cgal - Fatal编程技术网

C++ CGAL曲面网格-修改顶点坐标

C++ CGAL曲面网格-修改顶点坐标,c++,cgal,C++,Cgal,如何修改CGAL曲面网格顶点索引坐标? 目前,我一直在尝试更改顶点的坐标,如下所示: for (auto vertex_iterator : mesh.vertices()) { Point_3 p(1,0,1); mesh.point(vertex_iterator) = p; } 上面的代码只是一个示例,我并没有为所有顶点指定相同的坐标 在我尝试使用它进行计算之后,我得到了未定义的结果。实际上,我看不出您的代码有什么问题,我也不认为您的问题来自

如何修改CGAL曲面网格顶点索引坐标? 目前,我一直在尝试更改顶点的坐标,如下所示:

 for (auto vertex_iterator : mesh.vertices()) {
        Point_3 p(1,0,1);
        mesh.point(vertex_iterator) = p;
      }
上面的代码只是一个示例,我并没有为所有顶点指定相同的坐标


在我尝试使用它进行计算之后,我得到了未定义的结果。

实际上,我看不出您的代码有什么问题,我也不认为您的问题来自于此。 您能否提供有关未定义结果的更多信息


虽然精度很高,但曲面网格::顶点索引没有坐标,它有一个关联点,该点有坐标。这就是您使用mesh.point(顶点索引)访问的内容

自动顶点迭代器根本不是迭代器……如果我使用(顶点描述符顶点迭代器:m.vertexts())或自动顶点迭代器,我看不出有什么区别。你能解释为什么它不是迭代器吗?因为对于现代风格的for循环,类型是迭代器的值类型。但因为它只是一个名称,所以即使名称错误,代码也是正确的。@AndreasFabri感谢您的回答,但是如果我像迭代器一样命名它,其他程序员难道不更容易理解吗?我完全同意您的看法。我只想指出,编译器没有做出区分,因此,如果有错误(显然不是这样),这不是因为名称错误。不久前发现了一个与之完全无关的问题。因此,这确认了代码本身没有问题?