Subject: CGAL users discussion list
List archive
- From: "Pedro Machado Manhães de Castro" <>
- To:
- Subject: Re: [cgal-discuss] Triangulation 2 data structure problem
- Date: Tue, 25 Mar 2008 15:25:41 +0100
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=hp/n+nx6o0wU9Rwk9kmcfqwoE9ZrE7LteeH5hK3GW7pBCPRbfDGNbtb9VkjkshViNHPbJlNPq4LrZq9IjPD7qK+UmB0R4FkPyLe97mblGByIzyn/xsNiWQ9UG88hnEVATMYvGaDkxb2ZWz5uj6snh4D5o/HF+YskimXFuprkr2M=
Hello,
Do you define the neighborhood of your face inside your 2nd for iteration?
Stuffs like:
fHandle->set_neighbor(0, some_face_handle_1);
fHandle->set_neighbor(0, some_face_handle_2);
fHandle->set_neighbor(0, some_face_handle_3);
inside
?
This constructor here is easier to use:
create_face(Face_handle f1, int i1,
Face_handle f2, int i2,
Face_handle f3, int i3)
You define a face by its 3 neighbors, i1, i2, i3 are any sequence defined by the indices 0, 1, 2.
Hope it could help,
Best Regard,
Pedro Machado
On Tue, Mar 25, 2008 at 11:43 AM, Louis Feng <> wrote:
Hello,
I'm trying to construct a 2D triangle mesh from a list of vertices and
faces. I didn't want to use Polyhedron because I needed some properties from
the 2D triangulation class. I'm using Triangulation_2 and
Triangulation_data_structure_2. Basically I use T.tds() to get a reference
to the internal data structure. Then I add vertices and faces to it. But
this has become very confusing and I couldn't find examples on this.
An outline of my code:
triDS.set_dimension(2);
for(...) {
VertexHandle vHandle = triDS.create_vertex();
vHandle->set_point(Point2(...));
}
for(...) {
FaceHandle fHandle = triDS.create_face(vHandle1, vHandle2, vHandle3); }
When I check triDS.is_valid() at the end, it returns false. More
interestingly, before I add anything to triDS, when I check the vertices,
edge, etc. I get this
Triangulation vertices: 0
Triangulation faces: 1
Triangulation full faces: 1
Triangulation edges: 1
So am I suppose to clear this before I add something to it? Looking at the
template file for the data structure, it check this:
case 2:
result = result && edge_count == 3*face_count/2 ;
CGAL_triangulation_assertion(edge_count == 3*face_count/2);
break;
I'm not sure what the expected behavior is. Could someone tell me what I'm
doing wrong and how this class suppose to be used? Thanks!
Louis
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
- Triangulation 2 data structure problem, Louis Feng, 03/25/2008
- Re: [cgal-discuss] Triangulation 2 data structure problem, Pedro Machado Manhães de Castro, 03/25/2008
- Re: [cgal-discuss] Triangulation 2 data structure problem, Pedro Machado Manhães de Castro, 03/25/2008
- Re: [cgal-discuss] Triangulation 2 data structure problem, Louis, 03/25/2008
- Re: [cgal-discuss] Triangulation 2 data structure problem, Monique . Teillaud, 03/26/2008
- Re: [cgal-discuss] Triangulation 2 data structure problem, Pedro Machado Manhães de Castro, 03/26/2008
- RE: [cgal-discuss] Triangulation 2 data structure problem, Louis Feng, 03/30/2008
- Re: [cgal-discuss] Triangulation 2 data structure problem, Pedro Machado Manhães de Castro, 03/26/2008
- Re: [cgal-discuss] Triangulation 2 data structure problem, Monique . Teillaud, 03/26/2008
- Re: [cgal-discuss] Triangulation 2 data structure problem, Louis, 03/25/2008
- Re: [cgal-discuss] Triangulation 2 data structure problem, Pedro Machado Manhães de Castro, 03/25/2008
- Re: [cgal-discuss] Triangulation 2 data structure problem, Pedro Machado Manhães de Castro, 03/25/2008
Archive powered by MHonArc 2.6.16.