ForeverDavid / carve

Automatically exported from code.google.com/p/carve
Other
0 stars 0 forks source link

Crash in Boolean operation for unclosed polyhedrons #56

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. load a1.ply and a2.ply to poly1 and poly2;
2.  run carve::mesh::MeshSet<3> *is_poly = 
csg.compute(&poly1,&poly2,csg.A_MINUS_B);
and crashed at line 899 of triangulator.cpp:
      CARVE_FAIL("didn't manage to link up hole!");

3. the file a1.ply and a2.ply is as follows:

//// a1.ply
ply
format ascii 1.0
element vertex 12
property double x
property double y
property double z
element face 6
property list ushort ushort vertex_indices
end_header
0 0 0
0 2 0
0 2 2
0 0 2
0 -2 2
0 -2 0
0 -2 -2
0 0 -2
0 2 -2
1 0 2
1 0 0
1 0 -2
4 0 1 2 3
4 0 3 4 5
4 0 5 6 7
4 0 7 8 1
4 0 3 9 10
4 0 10 11 7 

///// a2.ply
ply
format ascii 1.0
element vertex 8
property double x
property double y
property double z
element face 6
property list ushort ushort vertex_indices
end_header
2 1 -1
2 1 1
2 -1 1
2 -1 -1
-1 1 -1
-1 1 1
-1 -1 1
-1 -1 -1
4 0 1 2 3
4 4 7 6 5
4 0 4 5 1
4 1 5 6 2
4 3 2 6 7
4 0 3 7 4 
What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
used the latest version from here:
http://carve.googlecode.com/archive/e82d852e4fb0baeabd9d96602d8bdace7d69f3cf.zip

Please provide any additional information below.
built on Windows 7 64bit + VS2012

Original issue reported on code.google.com by tanglaoy...@gmail.com on 18 Apr 2014 at 2:46

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Further information:
tested by Carve 1.4, it can get a result as what I excepted (there are still 
some duplicated vertices generated) but the following error displayed:
FACE LOOP ERROR: 0000000000C53340-0000000000C533E0 : 1
FACE LOOP ERROR: 0000000000C53278-0000000000EC0F00 : -1
FACE LOOP ERROR: 0000000000C532A0-0000000000C533B8 : -1
FACE LOOP ERROR: 0000000000C532A0-0000000000EC0E88 : -1
FACE LOOP ERROR: 0000000000C53318-0000000000C533B8 : 1
FACE LOOP ERROR: 0000000000C532A0-0000000000C53340 : 1
FACE LOOP ERROR: 0000000000C532F0-0000000000EC0EB0 : 1
FACE LOOP ERROR: 0000000000C53250-0000000000C53368 : 1
FACE LOOP ERROR: 0000000000C53278-0000000000EC0E88 : 1
FACE LOOP ERROR: 0000000000C53390-0000000000EC0F28 : 1
FACE LOOP ERROR: 0000000000C53368-0000000000EC0F00 : 1
FACE LOOP ERROR: 0000000000C53318-0000000000C53408 : -1
FACE LOOP ERROR: 0000000000C532C8-0000000000C53368 : 1
FACE LOOP ERROR: 0000000000C53368-0000000000C53408 : 1
FACE LOOP ERROR: 0000000000C532A0-0000000000C532F0 : 1
FACE LOOP ERROR: 0000000000C532C8-0000000000C533E0 : -1
FACE LOOP ERROR: 0000000000C53390-0000000000EC0EB0 : -1
FACE LOOP ERROR: 0000000000C53250-0000000000EC0F28 : -1

///// a3.ply
ply
format ascii 1.0
element vertex 20
property double x
property double y
property double z
element face 6
property list ushort ushort vertex_indices
end_header
1.000000e+000 0.000000e+000 1.000000e+000
0.000000e+000 -2.000000e+000 -2.000000e+000
0.000000e+000 2.000000e+000 -2.000000e+000
0.000000e+000 -1.000000e+000 1.000000e+000
1.000000e+000 0.000000e+000 -1.000000e+000
0.000000e+000 -2.000000e+000 2.000000e+000
0.000000e+000 1.000000e+000 0.000000e+000
0.000000e+000 2.000000e+000 2.000000e+000
1.000000e+000 0.000000e+000 2.000000e+000
0.000000e+000 -1.000000e+000 0.000000e+000
0.000000e+000 -1.000000e+000 -1.000000e+000
0.000000e+000 0.000000e+000 -2.000000e+000
0.000000e+000 0.000000e+000 2.000000e+000
0.000000e+000 0.000000e+000 1.000000e+000
0.000000e+000 -2.000000e+000 0.000000e+000
0.000000e+000 1.000000e+000 1.000000e+000
0.000000e+000 0.000000e+000 -1.000000e+000
0.000000e+000 2.000000e+000 0.000000e+000
1.000000e+000 0.000000e+000 -2.000000e+000
0.000000e+000 1.000000e+000 -1.000000e+000
6 6 17 7 12 13 15 
6 16 11 2 17 6 19 
6 13 12 5 14 9 3 
6 9 14 1 11 16 10 
4 13 12 8 0 
4 4 18 11 16 

Thanks,
Tang Laoya

Original comment by tanglaoy...@gmail.com on 18 Apr 2014 at 4:02