# Simple Question

5 messages
Open this post in threaded view
|

## Simple Question

 Simple Question How do I generate tetrahedrons/Polyhedron to be used in CSG Nef_Polyhedra for geometry primitives (Sphere,Cone,Cylinder)? Please help. I haven’t received any reply for my previous emails. CGAL seems to be too complicated to work on without a good indepth tutorial, is there one? Thanks Sri
Open this post in threaded view
|

## Re: Simple Question

 Simple Question Here is a part of my code, generate polyhedron from a wavefront obj file, all the facet are triangles, learned from a example in manual.   #include "CCSubd.h"#include #include #include #include #include #include #include #include #include #include   using namespace std;   templateclass TriangleBuilder : public CGAL::Modifier_base{public: TriangleBuilder( WavefrontObj* P=NULL) : _Obj(P) { } void operator()(HDS& H) {  CGAL::Polyhedron_incremental_builder_3 B( H, true);  if( _Obj->FacetCount == 0 )  {   cerr<<"CCSUBD ERROR : FacetCount < 1"<VertexCount, _Obj->FacetCount, 6);  //cout<<"B.begin_surface"<VertexCount; i++ )  {   size_t j=i*3;   B.add_vertex( Point(_Obj->VertexPtr[j+0],_Obj->VertexPtr[j+1],_Obj->VertexPtr[j+2]) );  }  for( size_t i=0; i<_Obj->FacetCount; i++ )  {   B.begin_facet();   size_t j=i*3;   B.add_vertex_to_facet( _Obj->IndexPtr[j+0] );   B.add_vertex_to_facet( _Obj->IndexPtr[j+1] );   B.add_vertex_to_facet( _Obj->IndexPtr[j+2] );   B.end_facet();  }  B.end_surface();  //cout<<"B.end_surface"< Kernel; typedef CGAL::Polyhedron_3 Polyhedron; typedef Polyhedron::HalfedgeDS HalfedgeDS; TriangleBuilder TB(pObj); Polyhedron P; P.delegate(TB);   if no error happened, the polyhedron is valid.   From: [hidden email] Sent: Wednesday, July 30, 2008 5:22 PM Subject: [cgal-discuss] Simple Question How do I generate tetrahedrons/Polyhedron to be used in CSG Nef_Polyhedra for geometry primitives (Sphere,Cone,Cylinder)? Please help. I havent received any reply for my previous emails. CGAL seems to be too complicated to work on without a good indepth tutorial, is there one? Thanks Sri
Open this post in threaded view
|

## Re: Simple Question

 In reply to this post by s.nagella you can generate polyhedra or load .off files, convert them to Nef_polyhedra, apply the Boolean operations, and convert the Nef back to the polyhedra. start printing the doc of Nef_polyhedra. Nagella, S (Srikanth) a écrit : > Hi All > > How do I generate tetrahedrons/Polyhedron to be used in CSG > Nef_Polyhedra for geometry primitives (Sphere,Cone,Cylinder)? > > Please help. I haven’t received any reply for my previous emails. CGAL > seems to be too complicated to work on without a good indepth tutorial, > is there one? > > Thanks > > Sri > -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://lists-sop.inria.fr/wws/info/cgal-discuss