mirror of https://github.com/CGAL/cgal
Merge pull request #3512 from maxGimeno/BGL-Fix_make_hexahedron_API-GF
Fix make_hexahedron doc
This commit is contained in:
commit
4bf2499b52
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
|
|
@ -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),
|
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
|
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),
|
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
|
poly
|
||||||
);
|
);
|
||||||
pvertex_descriptor pvd = * vertices(pmesh).first;
|
pvertex_descriptor pvd = * vertices(pmesh).first;
|
||||||
|
|
|
||||||
|
|
@ -837,6 +837,8 @@ make_quad(const P& p0, const P& p1, const P& p2, const P& p3, Graph& g)
|
||||||
* \ingroup PkgBGLHelperFct
|
* \ingroup PkgBGLHelperFct
|
||||||
* \brief Creates an isolated hexahedron
|
* \brief Creates an isolated hexahedron
|
||||||
* with its vertices initialized to `p0`, `p1`, ...\ , and `p7`, and adds it to the graph `g`.
|
* 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`.
|
* \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>
|
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[v6] = p6;
|
||||||
ppmap[v7] = p7;
|
ppmap[v7] = p7;
|
||||||
|
|
||||||
halfedge_descriptor ht = internal::make_quad(v7, v4, v5, v6, g);
|
halfedge_descriptor ht = internal::make_quad(v4, v5, v6, v7, g);
|
||||||
halfedge_descriptor hb = prev(internal::make_quad(v1, v0, v3, v2, g),g);
|
halfedge_descriptor hb = prev(internal::make_quad(v0, v3, v2, v1, g),g);
|
||||||
for(int i=0; i <4; i++){
|
for(int i=0; i <4; i++){
|
||||||
halfedge_descriptor h = halfedge(add_edge(g),g);
|
halfedge_descriptor h = halfedge(add_edge(g),g);
|
||||||
set_target(h,target(hb,g),g);
|
set_target(h,target(hb,g),g);
|
||||||
set_next(h,opposite(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);
|
h = opposite(h,g);
|
||||||
set_target(h,target(ht,g),g);
|
set_target(h,source(prev(ht,g),g),g);
|
||||||
set_next(h,opposite(ht,g),g);
|
set_next(h,opposite(next(next(ht,g),g),g),g);
|
||||||
set_next(opposite(next(hb,g),g),h,g);
|
set_next(opposite(next(hb,g),g),h,g);
|
||||||
hb = next(hb,g);
|
hb = next(hb,g);
|
||||||
ht = prev(ht,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
|
* \ingroup PkgBGLHelperFct
|
||||||
* \brief Creates an isolated tetrahedron
|
* \brief Creates an isolated tetrahedron
|
||||||
* with its vertices initialized to `p0`, `p1`, `p2`, and `p3`, and adds it to the graph `g`.
|
* 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`.
|
* \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>
|
template<typename Graph, typename P>
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ int main()
|
||||||
assert(CGAL::is_triangle_mesh(m));
|
assert(CGAL::is_triangle_mesh(m));
|
||||||
assert(CGAL::is_valid_polygon_mesh(m));
|
assert(CGAL::is_valid_polygon_mesh(m));
|
||||||
m.clear();
|
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_hexahedron(hd,m));
|
||||||
assert(CGAL::is_quad_mesh(m));
|
assert(CGAL::is_quad_mesh(m));
|
||||||
assert(CGAL::is_valid_polygon_mesh(m));
|
assert(CGAL::is_valid_polygon_mesh(m));
|
||||||
|
|
|
||||||
|
|
@ -288,8 +288,10 @@ int main()
|
||||||
Polyhedron polyhedron;
|
Polyhedron polyhedron;
|
||||||
|
|
||||||
// A cube
|
// 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),
|
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), 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);
|
polyhedron);
|
||||||
|
|
||||||
boost::graph_traits<Polyhedron>::halfedge_descriptor facets[6];
|
boost::graph_traits<Polyhedron>::halfedge_descriptor facets[6];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue