[gts-general] Empty surface with gts_delaunay_remove_hull
Brought to you by:
popinet
From: David P. G. <dpu...@gm...> - 2010-02-18 09:43:59
|
Hi everyone, I am a newbie with GTS. I am executing the following code but I do not understand the output. I am declaring three constraint edges but after executing the instruction gts_delaunay_remove_hull(s), I get an empty surface: 0 edges, 0 vertexes and 0 faces. The program is executed correctly (no exceptions), but I do not understand the output. Do you see anything which is wrong? Any advice will be welcome. #include <gts.h> #include <iostream> using namespace std; int main() { GtsSurface *s; // create surface object s=gts_surface_new(gts_surface_class(), gts_face_class(), gts_edge_class(), gts_vertex_class()); GtsVertex *v1,*v2,*v3; //create vertex objects v1 = gts_vertex_new (gts_vertex_class (), -1e10, -1e10, 0.); v2 = gts_vertex_new (gts_vertex_class (), 1e10, -1e10, 0.); v3 = gts_vertex_new (gts_vertex_class (), 0., 1e10, 0.); gts_surface_add_face (s, gts_face_new (gts_face_class (), gts_edge_new (gts_edge_class (), v1, v2), gts_edge_new (gts_edge_class (), v2, v3), gts_edge_new (gts_edge_class (), v3, v1))); GtsVertex *v4,*v5,*v6; //create vertex objects v4=gts_vertex_new(gts_vertex_class(),0.2,0.2,0); v5=gts_vertex_new(gts_vertex_class(),0.4,0.2,0); v6=gts_vertex_new(gts_vertex_class(),0.2,0.4,0); gts_delaunay_add_vertex (s, v4, NULL); gts_delaunay_add_vertex (s, v5, NULL); gts_delaunay_add_vertex (s, v6, NULL); GtsEdge *e1, *e2, *e3; e1=gts_edge_new(GTS_EDGE_CLASS(gts_constraint_class()),v4,v5); e2=gts_edge_new(GTS_EDGE_CLASS(gts_constraint_class()),v5,v6); e3=gts_edge_new(GTS_EDGE_CLASS(gts_constraint_class()),v6,v5); gts_delaunay_add_constraint (s, (GtsConstraint*)e1); gts_delaunay_add_constraint (s, (GtsConstraint*)e2); gts_delaunay_add_constraint (s, (GtsConstraint*)e3); gts_delaunay_remove_hull(s); gts_surface_print_stats(s,stdout); // shows surface status return 0; } Thanks in advance, David |