Merge pull request #3512 from maxGimeno/BGL-Fix_make_hexahedron_API-GF

Fix make_hexahedron doc
This commit is contained in:
Laurent Rineau 2018-12-19 16:08:58 +01:00
commit 4bf2499b52
6 changed files with 16 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -25,10 +25,10 @@ int main()
Point_3(1,-1,-1),
Point_3(1,1,-1),
Point_3(-1,1,-1),
Point_3(-1,1,1),
Point_3(-1,-1,1),
Point_3(1,-1,1),
Point_3(1,1,1),
Point_3(-1,1,1),
sm
);
@ -45,10 +45,10 @@ int main()
Point_3(0.5,-0.5,-0.5),
Point_3(0.5,0.5,-0.5),
Point_3(-0.5,0.5,-0.5),
Point_3(-0.5,0.5,0.5),
Point_3(-0.5,-0.5,0.5),
Point_3(0.5,-0.5,0.5),
Point_3(0.5,0.5,0.5),
Point_3(-0.5,0.5,0.5),
poly
);
pvertex_descriptor pvd = * vertices(pmesh).first;

View File

@ -837,6 +837,8 @@ make_quad(const P& p0, const P& p1, const P& p2, const P& p3, Graph& g)
* \ingroup PkgBGLHelperFct
* \brief Creates an isolated hexahedron
* with its vertices initialized to `p0`, `p1`, ...\ , and `p7`, and adds it to the graph `g`.
* \image html hexahedron.png
* \image latex hexahedron.png
* \returns the halfedge that has the target vertex associated with `p0`, in the face with the vertices with the points `p0`, `p1`, `p2`, and `p3`.
**/
template<typename Graph, typename P>
@ -868,16 +870,16 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3,
ppmap[v6] = p6;
ppmap[v7] = p7;
halfedge_descriptor ht = internal::make_quad(v7, v4, v5, v6, g);
halfedge_descriptor hb = prev(internal::make_quad(v1, v0, v3, v2, g),g);
halfedge_descriptor ht = internal::make_quad(v4, v5, v6, v7, g);
halfedge_descriptor hb = prev(internal::make_quad(v0, v3, v2, v1, g),g);
for(int i=0; i <4; i++){
halfedge_descriptor h = halfedge(add_edge(g),g);
set_target(h,target(hb,g),g);
set_next(h,opposite(hb,g),g);
set_next(opposite(next(ht,g),g),h,g);
set_next(opposite(prev(ht,g),g),h,g);
h = opposite(h,g);
set_target(h,target(ht,g),g);
set_next(h,opposite(ht,g),g);
set_target(h,source(prev(ht,g),g),g);
set_next(h,opposite(next(next(ht,g),g),g),g);
set_next(opposite(next(hb,g),g),h,g);
hb = next(hb,g);
ht = prev(ht,g);
@ -892,6 +894,8 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3,
* \ingroup PkgBGLHelperFct
* \brief Creates an isolated tetrahedron
* with its vertices initialized to `p0`, `p1`, `p2`, and `p3`, and adds it to the graph `g`.
* \image html tetrahedron.png
* \image latex tetrahedron.png
* \returns the halfedge that has the target vertex associated with `p0`, in the face with the vertices with the points `p0`, `p1`, and `p2`.
**/
template<typename Graph, typename P>

View File

@ -132,7 +132,7 @@ int main()
assert(CGAL::is_triangle_mesh(m));
assert(CGAL::is_valid_polygon_mesh(m));
m.clear();
hd = CGAL::make_hexahedron(a,b,c,d,aa,bb,cc,dd,m);
hd = CGAL::make_hexahedron(a,b,c,d,dd,aa,bb,cc,m);
assert(CGAL::is_hexahedron(hd,m));
assert(CGAL::is_quad_mesh(m));
assert(CGAL::is_valid_polygon_mesh(m));

View File

@ -288,8 +288,10 @@ int main()
Polyhedron polyhedron;
// A cube
make_hexahedron(Point_3(-0.5,-0.5,-0.5), Point_3(0.5,-0.5,-0.5), Point_3(0.5,0.5,-0.5), Point_3(-0.5,0.5,-0.5),
Point_3(-0.5,0.5,0.5), Point_3(-0.5,-0.5,0.5), Point_3(0.5,-0.5,0.5), Point_3(0.5,0.5,0.5),
make_hexahedron(
Point_3(-0.5,-0.5,-0.5), Point_3(0.5,-0.5,-0.5), Point_3(0.5,0.5,-0.5),
Point_3(-0.5,0.5,-0.5), Point_3(-0.5,0.5,0.5), Point_3(-0.5,-0.5,0.5),
Point_3(0.5,-0.5,0.5), Point_3(0.5,0.5,0.5),
polyhedron);
boost::graph_traits<Polyhedron>::halfedge_descriptor facets[6];