Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Rectangular tube is capped on the surface when converting Nef_Polyhedron_3 to Polyhedron_3

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Rectangular tube is capped on the surface when converting Nef_Polyhedron_3 to Polyhedron_3


Chronological Thread 
  • From: sdobashi <>
  • To:
  • Subject: Re: [cgal-discuss] Rectangular tube is capped on the surface when converting Nef_Polyhedron_3 to Polyhedron_3
  • Date: Wed, 15 Nov 2017 06:18:56 -0700 (MST)
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=SoftFail ; spf=Pass
  • Ironport-phdr: 9a23:AQ//PRAXj75vTwN+5ILEUyQJP3N1i/DPJgcQr6AfoPdwSP3+rsbcNUDSrc9gkEXOFd2Crakb26yL6+jJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6i760TlHERr2MU95J//+B5XJp8WxzeG7vZPJMCtSgz/oer91JhytrQSZ4sURi4J5Kqcq1xTUuGZgdOFfxGcuLlWWyUWvrvys9YJupnwD88kq8NRNBP33

Dear Sebastien,

Thank you very much for your kind and prompt bug fix!

I fetched your PR, and
I confirmed that the desired results are successfully obtained
for boxes I used previously as an example (box1.off - box2.off).

Sorry, however, the error like bellow occurred for trc1.off - trc2.off.
(difference between two truncated right cones)
Code and data files I used are attached to this message.

I want to the Boolean operation works fine for any typical shapes
such as box, cone, cylinder, wedge, tetrahedron, etc.

Perhaps, something is still wrong with the code?

Thanks,

S Dobashi


Her's the error
====================================================
CGAL error: assertion violation!
Expression : ss_circle.has_on(sp)
File :
D:\opt\CGAL\cgal-PR\Nef_3\include\CGAL/Nef_3/polygon_mesh_to_nef_3.h
Line : 263
Explanation:
Refer to the bug-reporting instructions at
http://www.cgal.org/bug_report.html
====================================================


#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Nef_polyhedron_3.h>
//#include <CGAL/boost/graph/convert_nef_polyhedron_to_polygon_mesh.h>

#include <fstream>

typedef CGAL::Exact_predicates_exact_constructions_kernel Exact_kernel;
typedef CGAL::Polyhedron_3<Exact_kernel> Polyhedron;
typedef CGAL::Surface_mesh<Exact_kernel::Point_3> Surface_mesh;
typedef CGAL::Nef_polyhedron_3<Exact_kernel> Nef_polyhedron;

int main(int argc, char** argv)
{
Polyhedron P1;
auto fin1 = std::ifstream(argv[1]);
fin1 >> P1;
fin1.close();

Polyhedron P2;
auto fin2 = std::ifstream(argv[2]);
fin2 >> P2;
fin2.close();

Nef_polyhedron nef1(P1);
Nef_polyhedron nef2(P2);
Nef_polyhedron nef_diff12 = nef1 - nef2;

//Surface_mesh output;
//CGAL::convert_nef_polyhedron_to_polygon_mesh(nef_diff12, output);
Polyhedron output;
nef_diff12.convert_to_polyhedron(output);

auto fout = std::ofstream("diff12.off");
fout << output;
fout.close();
}

box1.off <http://cgal-discuss.949826.n4.nabble.com/file/t375861/box1.off>
box2.off <http://cgal-discuss.949826.n4.nabble.com/file/t375861/box2.off>
trc1.off <http://cgal-discuss.949826.n4.nabble.com/file/t375861/trc1.off>
trc2.off <http://cgal-discuss.949826.n4.nabble.com/file/t375861/trc2.off>



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/



Archive powered by MHonArc 2.6.18.

Top of Page