Subject: CGAL users discussion list
List archive
RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?
Chronological Thread
- From: Zhanghong Tang <>
- To: <>
- Subject: RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?
- Date: Wed, 25 Jan 2012 17:26:56 +1200
- Importance: Normal
Dear all,
With the following code, I'd like to add multiple objects into one and then output the union to an OFF file, however, the code crashed in the line Nef_polyhedron nef_obj(obj); how to modify the code to let it works? I will be very appericate if anyone help me to check the code. Thanks PS: the code typedef struct object { void *obj; }myobj; void UnionObject(myobj *object, void *unionobj, int nobject) { Polyhedron obj, UnitedObj; Nef_polyhedron nef_uni; for (int i=0;i<nobject;i++) { obj=*(Polyhedron *)object[i].obj; Nef_polyhedron nef_obj(obj); if(i==0) nef_uni = nef_obj; else nef_uni = nef_uni + nef_obj; } nef_uni.convert_to_polyhedron(UnitedObj); } There are totally 6 objects to be added, the off files generated from object[i].obj (i=0,1,2,3,4,5) are attached. From: To: Date: Wed, 25 Jan 2012 15:11:04 +1200 Subject: RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?
Hi Guillaume, Thank you very much for your kindly reply. Now I have the following code to unite many objects into one: typedef struct object { void *obj; }myobj; void UnionObject(myobj *object, void *unionobj, int nobject) { Polyhedron obj, UnitedObj; Nef_polyhedron nef_uni; for (int i=0;i<nobject;i++) { obj=*(Polyhedron *)object[i].obj; Nef_polyhedron nef_obj(obj); if(i==0) nef_uni = nef_obj; else nef_uni = nef_uni + nef_obj; } nef_uni.convert_to_polyhedron(UnitedObj); } However, the program crash in the line Nef_polyhedron nef_obj(obj); Is there any missing to do this? How to modify the code to let the multiple objects be united correctly? I checked the polyhedron obj of every object[i].obj and output them to OFF file and they are all correct (under Guillaume's help). Thanks From: To: Subject: RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL? Date: Wed, 25 Jan 2012 14:00:22 +1200
Hi Guillaume, Thank you very much for your kindly reply. Now I have the following code to unite many objects into one: typedef struct object { void *obj; }myobj; void UnionObject(myobj *object, void *unionobj, int nobject) { Polyhedron obj, UnitedObj; Nef_polyhedron nef_uni; for (int i=0;i<nobject;i++) { obj=*(Polyhedron *)object[i].obj; Nef_polyhedron nef_obj(obj); if(i==0) nef_uni = nef_obj; else nef_uni = nef_uni + nef_obj; } nef_uni.convert_to_polyhedron(UnitedObj); } However, the program crash in the line Nef_polyhedron nef_obj(obj); Is there any missing to do this? I checked the polyhedron obj of every object[i].obj and output them to OFF file and they are all correct (under Guillaume's help). Thanks Date: Tue, 24 Jan 2012 10:20:05 +0100 From: To: Subject: Re: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL? Hi,
The benefit is genericity.
No this is not possible: you have to use the format required by the incremental builder class...
Use ofstream. Cf for example http://www.cplusplus.com/doc/tutorial/files/ Guillaume
-- =================================================================== Guillaume DAMIAND CNRS, LIRIS UMR 5205 Université Claude Bernard Bâtiment Nautibus (710) 43 Boulevard du 11 Novembre 1918 69622 Villeurbanne Cedex (France) ------------------------------------------------------------------- Phone: +33 (0)4.72.43.26.62 Fax: +33 (0)4.72.43.15.36 Mail: =================================================================== |
Attachment:
test.zip
Description: Zip archive
- Re: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, (continued)
- Re: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Sebastien Loriot (GeometryFactory), 01/18/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/18/2012
- Re: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Sebastien Loriot (GeometryFactory), 01/18/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/24/2012
- Re: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Guillaume Damiand, 01/24/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/24/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/24/2012
- Message not available
- Message not available
- Message not available
- Message not available
- FW: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/25/2012
- Re: FW: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Winnie Hellmann, 01/25/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/25/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/25/2012
- Re: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Sebastien Loriot (GeometryFactory), 01/25/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/27/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/27/2012
- Re: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Sebastien Loriot (GeometryFactory), 01/27/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/29/2012
- FW: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/30/2012
- Re: FW: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Sebastien Loriot (GeometryFactory), 01/30/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/30/2012
- Re: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Sebastien Loriot (GeometryFactory), 01/31/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/24/2012
- Re: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Guillaume Damiand, 01/24/2012
- Re: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Sebastien Loriot (GeometryFactory), 01/30/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/24/2012
- Re: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Sebastien Loriot (GeometryFactory), 01/18/2012
- RE: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Zhanghong Tang, 01/18/2012
- Re: [cgal-discuss] What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?, Sebastien Loriot (GeometryFactory), 01/18/2012
Archive powered by MHonArc 2.6.16.