Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Re: What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?

Subject: CGAL users discussion list

List archive

[cgal-discuss] Re: What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?


Chronological Thread 
  • From: tang <>
  • To:
  • Subject: [cgal-discuss] Re: What's the minimal requirement to use the Constructive Solid Geometry (CSG) module of CGAL?
  • Date: Tue, 12 Mar 2013 05:49:31 -0700 (PDT)

Dear Dr. Sebastien,

Sorry for late reply.

I have the following code which crashes when running the following line:
Nef_polyhedron NP1(*P1);


The code is as follows:
void BoolObject3(char *op, char *file1,char *file2,char *outfile)
{
Polyhedron *P1 = new Polyhedron, *P2 = new Polyhedron;
std::ifstream stream1(file1);
stream1 >> *P1;
std::ifstream stream2(file2);
stream2 >> *P2;

Nef_polyhedron NP2(*P2);
Nef_polyhedron NP1(*P1);
switch(*op)
{
case '+': NP1 = NP1 + NP2;break;
case '-': NP1 = NP1 - NP2;break;
case '*': NP1 = NP1 * NP2;break;
case '^': NP1 = NP1 ^ NP2;break;
default:break;
}
NP1.convert_to_polyhedron(*P1);
// output the polyhedron to OFF file
std::ofstream log(outfile);
log << *P1;
}


The driver code is as follows:
BoolObject3("+", "slot.off","oblique.off","result.off");


The OFF files are as follows (sorry that I can't attach files).
/////////////////////
slot.off
////////////////////

OFF
56 108 0

-0.0586835 -0.0125 -0.5
-0.0519615 -0.03 -0.5
-0.0401671 -0.0445714 -0.5
-0.03 -0.0519615 -0.5
-0.0185164 -0.0570714 -0.5
3.67394e-018 -0.06 -0.5
0.0185164 -0.0570714 -0.5
0.03 -0.0519615 -0.5
0.0401671 -0.0445714 -0.5
0.0519615 -0.03 -0.5
0.0586835 -0.0125 -0.5
0.06 0 -0.5
0.0586835 0.0125 -0.5
0.0519615 0.03 -0.5
0.0401671 0.0445714 -0.5
0.03 0.0519615 -0.5
0.0185164 0.0570714 -0.5
3.67394e-018 0.06 -0.5
-0.0185164 0.0570714 -0.5
-0.03 0.0519615 -0.5
-0.0401671 0.0445714 -0.5
-0.0519615 0.03 -0.5
-0.0586835 0.0125 -0.5
-0.06 7.34788e-018 -0.5
-0.0586835 -0.0125 -0.16
-0.0519615 -0.03 -0.16
-0.0401671 -0.0445714 -0.16
-0.03 -0.0519615 -0.16
-0.0185164 -0.0570714 -0.16
3.67394e-018 -0.06 -0.16
0.0185164 -0.0570714 -0.16
0.03 -0.0519615 -0.16
0.0401671 -0.0445714 -0.16
0.0519615 -0.03 -0.16
0.0586835 -0.0125 -0.16
0.0519615 0.03 -0.16
0.0401671 0.0445714 -0.16
0.03 0.0519615 -0.16
0.0185164 0.0570714 -0.16
3.67394e-018 0.06 -0.16
-0.0185164 0.0570714 -0.16
-0.03 0.0519615 -0.16
-0.0401671 0.0445714 -0.16
-0.0519615 0.03 -0.16
-0.0586835 0.0125 -0.16
-0.06 7.34788e-018 -0.16
0.045 0.0125 -0.45
0.045 -0.0125 -0.45
0.0586835 0.0125 -0.16
0.0586835 -0.0125 -0.16
0.0586835 0.0125 -0.45
0.06 0 -0.45
0.0586835 0.0125 -0.45
0.0586835 -0.0125 -0.45
0.045 -0.0125 -0.16
0.045 0.0125 -0.16
3 23 22 0
3 0 22 21
3 0 21 20
3 0 20 19
3 0 19 18
3 0 18 17
3 0 17 16
3 0 16 15
3 0 15 14
3 0 14 13
3 0 13 12
3 0 12 11
3 0 11 10
3 0 10 9
3 0 9 8
3 0 8 7
3 0 7 6
3 0 6 5
3 0 5 4
3 0 4 3
3 0 3 2
3 0 2 1
3 23 45 22
3 22 45 44
3 23 0 45
3 45 0 24
3 0 1 24
3 24 1 25
3 1 2 25
3 25 2 26
3 26 2 3
3 27 26 3
3 27 3 4
3 28 27 4
3 28 4 5
3 29 28 5
3 29 5 6
3 30 29 6
3 30 6 7
3 31 30 7
3 31 7 8
3 32 31 8
3 32 8 9
3 33 32 9
3 33 9 10
3 34 33 10
3 53 10 11
3 53 49 34
3 34 10 53
3 51 53 11
3 11 12 50
3 51 11 50
3 12 13 35
3 52 12 35
3 48 52 35
3 52 50 12
3 13 14 36
3 35 13 36
3 15 37 14
3 14 37 36
3 16 38 15
3 15 38 37
3 17 39 16
3 16 39 38
3 18 40 17
3 17 40 39
3 19 41 18
3 18 41 40
3 20 42 19
3 19 42 41
3 21 43 20
3 20 43 42
3 22 44 21
3 21 44 43
3 44 45 24
3 26 44 25
3 25 44 24
3 27 44 26
3 28 44 27
3 29 44 28
3 30 44 29
3 31 44 30
3 32 44 31
3 33 44 32
3 54 44 33
3 54 55 44
3 34 54 33
3 48 44 55
3 35 44 48
3 36 44 35
3 37 44 36
3 38 44 37
3 39 44 38
3 40 44 39
3 41 44 40
3 42 44 41
3 43 44 42
3 49 54 34
3 49 53 54
3 54 53 47
3 53 51 50
3 46 53 52
3 52 53 50
3 47 53 46
3 52 48 55
3 46 52 55
3 46 55 54
3 47 46 54


///////////////////
oblique.off
///////////////////

OFF
10 16 0

0.045 0.0125 -0.341483
0.0332508 0.0125 -0.332158
0.0332508 -0.0125 -0.332158
0.045 -0.0125 -0.341483
0.248575 0.0125 -0.0849846
0.236826 0.0125 -0.0756596
0.236826 -0.0125 -0.0756596
0.248575 -0.0125 -0.0849846
0.0391254 0 -0.336821
0.2427 0 -0.0803221
3 0 1 5
3 0 5 4
3 1 2 6
3 1 6 5
3 2 3 7
3 2 7 6
3 3 0 4
3 3 4 7
3 3 2 8
3 2 1 8
3 1 0 8
3 0 3 8
3 4 5 9
3 5 6 9
3 6 7 9
3 7 4 9


Could you please help me to take a look at it?


Thanks,
Zhanghong Tang






--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/What-s-the-minimal-requirement-to-use-the-Constructive-Solid-Geometry-CSG-module-of-CGAL-tp4287806p4656917.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page