Giter Club home page Giter Club logo

cork's Introduction

Cork Boolean Library

Welcome to the Cork Boolean/CSG library. Cork is designed to support Boolean operations between triangle meshes.

Surprisingly, most Boolean/CSG libraries available today (early 2013) are not robust to numerical errors. Floating-point errors often lead to segmentation faults or produce grossly inaccurate results (e.g. nothing) despite the code being provided . The few libraries which are robust (e.g. CGAL) require the user to correctly configure the arithmetic settings to ensure robustness.

Cork is designed with the philosophy that you, the user, don't know and don't care about esoteric problems with floating point arithmetic. You just want a Boolean library with a simple interface, that you can rely on... Unfortunately since Cork is still in ongoing development, this may be more or less true at the moment. This code should be very usable for a research project, perhaps slightly less so for use in a product.

Cork was developed by Gilbert Bernstein, a computer scientist who has worked on robust geometric intersections in various projects since 2007. He's reasonably confident he knows what he's doing. =D

WARNING: Unfortunately, there are a number of known problems with Cork. I have zero time to work on the library since I'm currently busy working on a thesis. (March 2016) If you would like to pay me large sums of money to improve this library, maybe we should talk. Otherwise, I'm really quite sorry to say I don't have time.

Installation

Dependencies (Mac/Linux)

In order to build Cork on Mac or Linux, you will need Clang 3.1+ and GMP (GNU Multi-Precision arithmetic library). Eventually, Cork will support GCC. If you would like more information, or have special system requirements, please e-mail me: I'm much more likely to extend support to a platform if I receive requests.

Mac

On OS X 10.8, Clang 3.1+ is the default compiler. If you are using the Homebrew package manager, I recommend installing GMP that way.

Linux

Clang/LLVM 3.1 and GMP can be installed via your package manager.

Mac/Linux

To build the project, type

make

that's it.

If the build system is unable to find your GMP installation, please edit the paths in file makeConstants. In general, the project uses a basic makefile. In the event that you have to do something more complicated to get the library to compile, or if you are unable to get it to compile, please e-mail me or open an issue on GitHub. Doing so is much more effective than cursing at your computer, and will save other users trouble in the future.

Windows

Cork uses C++11, so you will need the most recent compiler; Visual Studio 2012 or higher please. You will also need to install the MPIR arithmetic library into your Visual Studio environment.

Once this is done, you can use the solution and project files in the /win/ subdirectory to build the demo program. The solution/project is not currently configured to build a DLL. Please bug me if this is an issue for you.

Licensing

Cork is licensed under the LGPL with an exception (from QT) to more easily allow use of template code. In plain English, the following are some guidelines on the use of this code:

  • Unless you also intend to release your project under LGPL/GPL, you must make sure to DYNAMICALLY link against the Cork library. However, you may include unmodified header files without compromising your proprietary code.

  • If you distribute your code, (publicly or privately, compiled or in source form, for free or commercially) you must (a) acknowledge your use of Cork, (b) include the COPYRIGHT information and (c) either distribute the Cork code or clearly indicate where a copy may be found.

Of course, none of the above supercedes the actual COPYRIGHT.

cork's People

Contributors

gilbo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cork's Issues

Double Precision Interface?

Is there any reason not to include a double precision interface to Cork (e.g. a double precision variant of CorkTriMesh)? A quick glance under the hood suggests that each input CorkTriMesh is converted to a CorkMesh, which stores vertices in double precision, internally.

Missing $(CCFLAGS) in Makefile

194 obj/isct/triangle.o: src/isct/triangle.c
195 @echo "Compiling the Triangle library"
196 @$(CC) $(CCFLAGS) -DNO_TIMER
197 -DREDUCED
198 -DCDT_ONLY -DTRILIBRARY
199 -Wall -DANSI_DECLARATORS
200 -o obj/isct/triangle.o -c src/isct/triangle.c

Fails to build with clang-5

CloudCompare/cork fails with errors like these:

In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:436:13: error: no matching conversion for functional-style cast from 'const char [14]' to 'std::exception'
            ENSURE(vaddr.count(v) > 0);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:437:13: error: no matching conversion for functional-style cast from 'const char [14]' to 'std::exception'
            ENSURE(count(v->tris, t) == 1);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
                throw std::exception("ENSURE FAILED"); \
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Instability in intersection calculation

Hello, I would really appreciate if anyone could help me with the problem that I have encountered using cork. While using cork in order to calculate the intersection of two polyhedrons, The return polyhedron of cork intersection function becomes unstable when the external facets of the two input polyhedra coincide with each other in space. Has anyone else had such a problem with cork?? and is there anyone who can help me with this?

crash when free memory

In src/mesh/mesh.isct.tpp about line 517, you use free() to free memory that allocated by "new" operator, there should be "delete[]". It crashes on MacOS. There also need some pointer check for safe. I already fixed locally, please update it like this:

diff --git a/src/mesh/mesh.isct.tpp b/src/mesh/mesh.isct.tpp
index 6c48930..6d47855 100644
--- a/src/mesh/mesh.isct.tpp
+++ b/src/mesh/mesh.isct.tpp
@@ -517,21 +517,32 @@ public:

     // clean up after triangulate...
  •        // in free
    
  •    free(in.pointlist);
    
  •    free(in.pointmarkerlist);
    
  •    free(in.segmentlist);
    
  •    free(in.segmentmarkerlist);
    
  •        // out free
    
  •    free(out.pointlist);
    
  •    //free(out.pointattributelist);
    
  •    free(out.pointmarkerlist);
    
  •    free(out.trianglelist);
    
  •    // in free
    
  •    if(in.pointlist)
    
  •        delete[] in.pointlist;
    
  •    if(in.pointmarkerlist)
    
  •        delete[] in.pointmarkerlist;
    
  •    if(in.segmentlist)
    
  •        delete[] in.segmentlist;
    
  •    if(in.segmentmarkerlist)
    
  •        delete[] in.segmentmarkerlist;
    
  •    // out free
    
  •    if(out.pointlist)
    
  •        free(out.pointlist);
    
  •    if(out.pointattributelist)
    
  •        free(out.pointattributelist);
    
  •    if(out.pointmarkerlist)
    
  •        free(out.pointmarkerlist);
    
  •    if(out.trianglelist)
    
  •        free(out.trianglelist);
       //free(out.triangleattributelist);
       //free(out.trianglearealist);
       //free(out.neighborlist);
    
  •    free(out.segmentlist);
    
  •    free(out.segmentmarkerlist);
    
  •    if(out.segmentlist)
    
  •        free(out.segmentlist);
    
  •    if(out.segmentmarkerlist)
    
  •        free(out.segmentmarkerlist);
       //free(out.edgelist);
       //free(out.edgemarkerlist);
    
    }

remesh example?

Hi there,

I was wondering how to use the remesh functions (or in general, how to interact with mesh.h) - is there some example code I could take a look at? Ideally, I would like to input a .off file and have it remesh based min/max edge length.

Do I need to implement my own VertData and TriData stucts? It looks like there are some conditions that need these need to satisfy, but I'm not sure what exactly they are.

Any help is most appreciated!

Degenerate case that fails

Hi,
I'm using the code to merge some simple geometries under VS 2012, MS Windows 7 x64. I've compiled the code and successfully run the program with the two example ball models. But when I try to operate a union on the following cylinders, an error is triggered by the code as "Ran out of tries to perturb the mesh". I think this might be a degenerate case but I'm not quite sure. Is there any way to deal with this issue? Thanks.

primitives

make: clang++: Command not found

Hello,
I am trying to compile cork on terminal. After I installed dependencies, when commanding 'make' I get this message:
paulo@paulo-Inspiron-N4030:~/Programs/cork$ make
Compiling obj/cork.o
make: clang++: Command not found
make: *** [obj/cork.o] Error 127

I tried editing my makeConstantes too, but didn't work:

GMP_INC_DIR = /home/paulo/Programs/cork/bin/llvm-3.5/include
GMP_LIB_DIR = /home/paulo/Programs/cork/bin/llvm-3.5/lib

When I did this, I also got an additional error message:

paulo@paulo-Inspiron-N4030:~/Programs/cork$ make
make: Warning: File `depend/main.d' has modification time 5,2e+02 s in the future
Compiling obj/cork.o
make: clang++: Command not found
make: *** [obj/cork.o] Error 127

Sorry if this may seem a stupid issue, but I am new to installing programs by compiling.

Thanks a lot in advance;
Paulo Miamoto
[email protected]

Split mesh feature?

Hi there,

I was wondering if it's possible to split a mesh with another mesh using cork. I think this stage must happen anyway during a union - perhaps there is a way to access it directly?

Great library, btw!

Trying to run main.cpp with sample files ballA.off and ballB.off always crashes

Hello
I'm building your solution in Visual Studio 2019 with build tools version v142. The solution compiles perfectly but when I run the application (both in debug and release) with the following command line

wincork.exe -union ballA.off ballB.off res.off

it always crashes inside triangle.c in function transfernodes at line 14126

x = vertexloop[0] = pointlist[coordindex++];

it looks like pointlist is not initialized in the correct way. Below the call stack

> wincork.exe!transfernodes(mesh * m, behavior * b, double * pointlist, double * pointattriblist, int * pointmarkerlist, int numberofpoints, int numberofpointattribs) Line 14126 C wincork.exe!triangulate(char * triswitches, triangulateio * in, triangulateio * out, triangulateio * vorout) Line 15732 C wincork.exe!Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem::subdivide(Corck::Mesh<CorkVertex,CorkTriangle>::IsctProblem * iprob) Line 477 C++ wincork.exe!Corck::Mesh<CorkVertex,CorkTriangle>::IsctProblem::resolveAllIntersections::__l2::<lambda>(Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem * tprob) Line 1406 C++ wincork.exe!std::invoke<void <lambda>(Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem *) &,Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem *>(Corck::Mesh<CorkVertex,CorkTriangle>::IsctProblem::resolveAllIntersections::__l2::void <lambda>(Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem *) & _Obj, Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem * && _Arg1) Line 1615 C++ wincork.exe!std::_Invoker_ret<void,1>::_Call<void <lambda>(Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem *) &,Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem *>(Corck::Mesh<CorkVertex,CorkTriangle>::IsctProblem::resolveAllIntersections::__l2::void <lambda>(Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem *) & _Func, Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem * && <_Vals_0>) Line 745 C++ wincork.exe!std::_Func_impl_no_alloc<void <lambda>(Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem *),void,Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem *>::_Do_call(Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem * && <_Args_0>) Line 939 C++ wincork.exe!std::_Func_class<void,Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem *>::operator()(Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem * <_Args_0>) Line 987 C++ wincork.exe!IterPool<Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem>::for_each(std::function<void __cdecl(Corck::Mesh<CorkVertex,CorkTriangle>::TriangleProblem *)> func) Line 141 C++ wincork.exe!Corck::Mesh<CorkVertex,CorkTriangle>::IsctProblem::resolveAllIntersections() Line 1412 C++ wincork.exe!Corck::Mesh<CorkVertex,CorkTriangle>::resolveIntersections() Line 1514 C++ wincork.exe!Corck::Mesh<CorkVertex,CorkTriangle>::BoolProblem::doSetup(Corck::Mesh<CorkVertex,CorkTriangle> & rhs) Line 178 C++ wincork.exe!Corck::Mesh<CorkVertex,CorkTriangle>::boolUnion(Corck::Mesh<CorkVertex,CorkTriangle> & rhs) Line 306 C++ wincork.exe!computeUnion(CorkTriMesh in0, CorkTriMesh in1, CorkTriMesh * out) Line 210 C++ wincork.exe!std::invoke<void (__cdecl*&)(CorkTriMesh,CorkTriMesh,CorkTriMesh *),CorkTriMesh,CorkTriMesh,CorkTriMesh *>(void(*)(CorkTriMesh, CorkTriMesh, CorkTriMesh *) & _Obj, CorkTriMesh && _Arg1, CorkTriMesh && <_Args2_0>, CorkTriMesh * && <_Args2_1>) Line 1615 C++ wincork.exe!std::_Invoker_ret<void,1>::_Call<void (__cdecl*&)(CorkTriMesh,CorkTriMesh,CorkTriMesh *),CorkTriMesh,CorkTriMesh,CorkTriMesh *>(void(*)(CorkTriMesh, CorkTriMesh, CorkTriMesh *) & _Func, CorkTriMesh && <_Vals_0>, CorkTriMesh && <_Vals_1>, CorkTriMesh * && <_Vals_2>) Line 745 C++ wincork.exe!std::_Func_impl_no_alloc<void (__cdecl*)(CorkTriMesh,CorkTriMesh,CorkTriMesh *),void,CorkTriMesh,CorkTriMesh,CorkTriMesh *>::_Do_call(CorkTriMesh && <_Args_0>, CorkTriMesh && <_Args_1>, CorkTriMesh * && <_Args_2>) Line 939 C++ wincork.exe!std::_Func_class<void,CorkTriMesh,CorkTriMesh,CorkTriMesh *>::operator()(CorkTriMesh <_Args_0>, CorkTriMesh <_Args_1>, CorkTriMesh * <_Args_2>) Line 987 C++ wincork.exe!genericBinaryOp::__l2::<lambda>(std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> & args, const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> & end) Line 232 C++ wincork.exe!std::invoke<void <lambda>(std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &, const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &) &,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> const &>(genericBinaryOp::__l2::void <lambda>(std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &, const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &) & _Obj, std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> & _Arg1, const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> & <_Args2_0>) Line 1615 C++ wincork.exe!std::_Invoker_ret<void,1>::_Call<void <lambda>(std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &, const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &) &,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> const &>(genericBinaryOp::__l2::void <lambda>(std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &, const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &) & _Func, std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> & <_Vals_0>, const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> & <_Vals_1>) Line 745 C++ wincork.exe!std::_Func_impl_no_alloc<void <lambda>(std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &, const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &),void,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> const &>::_Do_call(std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> & <_Args_0>, const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> & <_Args_1>) Line 939 C++ wincork.exe!std::_Func_class<void,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> &,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> const &>::operator()(std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> & <_Args_0>, const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> & <_Args_1>) Line 987 C++ wincork.exe!CmdList::runCommands(std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> & arg_it, const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::string>>> & end_it) Line 194 C++ wincork.exe!main(int argc, char * * argv) Line 311 C++

x64 compiling result under VS2013 crashes

Hi, I'm using cork under Visual Sudio 2013. It works when I using win32 to compile it. But when I try to recompile it under x64, it crashes at line 14131 inside file "triangle.c", which I think is caused by an invalid allocation chunk of memory by the function poolalloc().

So can this be the reason why the program crashes under x64 compiling environment?

Limitations of cork ?

I am writing a wrapper to cork in c# and I got into problems with some operations.
It seems the library is quite strict with what is acceptable data.

Users sent me reports of crash with quite reasonable meshes (from a user POV).
For example, if a mesh as two internal identical faces, cork barfs. Imagine a cube mirrored by one of its face. It seems that flat faces cause also problem.

I am gathering feedback as we talk but in parallel to that, I would like to know what are the limitations of cork. I may have missed something relatively to that.

Thank you.

some error about "triangle.c"

Hi,when I use this lib in my project in vs 2019, it always show the error about"LINK2001 An external symbol that cannot be parsed triangulate()",could you give me some advice?

Compiling on Linux Mint

Hi Gilbo,
I am on Linux Mint Rosa 17.3 64bytes.
I have installed with the app manager:
Clang3.5 and llvm-3.5 and libgpm10
but error with GPM path so I choose of compiling my-self GPM 6.1:
I download it and compile: I find it here on my computer:
GMP_INC_DIR = /usr/include
GMP_LIB_DIR = /usr/lib
I modify the makeConstant and no error for GPM but this now:
++++++++++++++++++++++++++++++++++
~/Applications/cork $ make
Compiling obj/cork.o
make: clang++: commande introuvable
make: *** [obj/cork.o] Erreur 127
++++++++++++++++++++++++++++++++++

but clang 3.5 is installed
clang-3.5 is already the latest version.
0 mis à jour, 0 nouvellement installés, 0 à enlever et 1 non mis à jour.

Terminal: clang-3.5 --help
OVERVIEW: clang LLVM compiler
USAGE: clang [options]
OPTIONS:
-### Print (but do not run) the commands to run for this compilation
--analyze Run the static analyzer
-arcmt-migrate-emit-errors
Emit ARC errors even if the migrator can fix them
-arcmt-migrate-report-output
Output path for the plist report
-cxx-isystem
Add direct
Etc......

so no problem with clang-3.5!
Where is the problem, please?

EDIT: I changed clang++ with clang-3.5 in the makefile
line 37 CPP11_FLAGS := -std=c++11
line 38 CC := clang
line 39 CXX := clang-3.5
and
$ make
then, the compilation has begun......BUT now I have this error:

patrinux@patrinux-ordi ~/Applications/cork $ make
Compiling obj/cork.o
Compiling obj/util/timer.o
Compiling obj/util/log.o
Compiling obj/isct/empty3d.o
In file included from src/isct/empty3d.cpp:31:
src/isct/gmpext4.h:35:10: fatal error: 'gmpxx.h' file not found

include <gmpxx.h>

Here I can't solve the question! Can you help me, please?

Sequential execution of any operation leads to different results

{
std::vector<string> args1;
    args1.push_back("-union");
    args1.push_back("ballA.off");
    args1.push_back("ballB.off");
    args1.push_back("ballC.off");

    cmds.runCommands(std::begin(args1), std::end(args1));
}
{
std::vector<string> args1;
    args1.push_back("-union");
    args1.push_back("ballA.off");
    args1.push_back("ballB.off");
    args1.push_back("ballC1.off");

    cmds.runCommands(std::begin(args1), std::end(args1));
}

ballC.off and ballC1.off are different

Bug of Cork?

Dear Dr. Gilbert Bernstein,

Thank you very much for your so powerful polyhedron boolean operation software. I am trying to study it. I have successfully built the wincork.exe on Windows 7 64bit system. However, I failed to get correct result when union two objects by
wincork cyl1.off slot2.off out.off

Do I miss anything? Could you please help me to take a look at it?

Thanks,
Tang Laoya

PS: Two OFF files are as follow:

cyl1.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.06 0 -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.0519615 0.03 -0.16
-0.0586835 0.0125 -0.16
-0.06 7.34788e-018 -0.16
-0.0333253 0.0327211 -0.45
-0.0116747 0.0452211 -0.45
-0.0401671 0.0445714 -0.16
-0.0185164 0.0570714 -0.16
-0.0401671 0.0445714 -0.45
-0.03 0.0519615 -0.45
-0.0401671 0.0445714 -0.45
-0.0185164 0.0570714 -0.45
-0.0333253 0.0327211 -0.16
-0.0116747 0.0452211 -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 34 10 11
3 35 34 11
3 11 12 36
3 35 11 36
3 12 13 37
3 36 12 37
3 13 14 38
3 37 13 38
3 15 39 14
3 14 39 38
3 16 40 15
3 15 40 39
3 17 41 16
3 16 41 40
3 18 42 17
3 17 42 41
3 19 51 18
3 18 51 53
3 18 53 49
3 18 49 42
3 20 50 19
3 19 50 51
3 21 43 20
3 52 43 48
3 20 43 52
3 50 20 52
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 34 44 33
3 35 44 34
3 36 44 35
3 37 44 36
3 38 44 37
3 39 44 38
3 40 44 39
3 55 44 40
3 41 55 40
3 54 44 55
3 54 48 44
3 43 44 48
3 49 41 42
3 49 55 41
3 55 49 47
3 47 49 53
3 46 47 53
3 50 46 51
3 51 46 53
3 52 46 50
3 48 54 46
3 52 48 46
3 55 47 54
3 54 47 46

slot2.off
OFF
10 16 0

-0.0333253 0.0327211 -0.341483
-0.0274507 0.022546 -0.332158
-0.00580007 0.035046 -0.332158
-0.0116747 0.0452211 -0.341483
-0.135113 0.209022 -0.0849846
-0.129238 0.198847 -0.0756596
-0.107588 0.211347 -0.0756596
-0.113462 0.221522 -0.0849846
-0.0195627 0.0338836 -0.336821
-0.12135 0.210185 -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

INSIDE/OUTSIDE ray cast needs to be hardened

The ray cast as written does not take any special precautions to prevent arithmetic errors or handle degenerate arrangements of geometry. This can probably be accomplished using a canonical vertex ordering...

Wrote an alternative

For Godot, I had to implement my own CSG library as we needed something compatible with MIT. If anyone wants to take it out and make a standalone lib, please let me know. I would have loved to useing Cork, but I don't understand the reasoning behind using GPL and then abandoning it.

Please change the license to MIT at least.

Benchmark Set

Doug James recommended developing a set of reference benchmark cases for regression testing. This could also help demonstrate performance and correctness between Cork and other libraries.

Error compiling Cork under Debian Wheezy

Hi all,
I'm trying to install Cork under my Debian Wheezy distro (32bit). I've installed gmp (downloaded here https://packages.debian.org/en/source/wheezy/gmp)
And clang (here https://packages.debian.org/wheezy/i386/clang/download). Nothing went wrong with libraries installation. But when I enter Cork directory and type "make" I have this error


root@Leo001:/home/leonardo/cork-master# make
In file included from src/isct/empty3d.cpp:31:
src/isct/gmpext4.h:35:10: fatal error: 'gmpxx.h' file not found

include <gmpxx.h>

     ^

1 error generated.
Compiling obj/cork.o
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:44:
In file included from src/mesh/mesh.decl.h:38:
src/util/iterPool.h:75:13: error: use of undeclared identifier 'obj'
obj->~T();
^
0 libLLVM-3.0.so.1 0x40da8fc8
1 libLLVM-3.0.so.1 0x40da94e4
2 0x4001e400 kernel_sigreturn + 0
3 clang 0x089c8aea clang::CallExpr::CallExpr(clang::ASTContext&, clang::Expr
, clang::Expr
_, unsigned int, clang::QualType, clang::ExprValueKind, clang::SourceLocation) + 266
4 clang 0x085eb5dc clang::Sema::ActOnCallExpr(clang::Scope_, clang::Expr_, clang::SourceLocation, clang::ASTMultiPtrclang::Expr_, clang::SourceLocation, clang::Expr_, bool) + 1468
5 clang 0x0849d27b clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr_, true>) + 3451
6 clang 0x0849662c clang::Parser::ParseCastExpression(bool, bool, bool&, bool) + 252
7 clang 0x08499588 clang::Parser::ParseCastExpression(bool, bool, bool) + 88
8 clang 0x08499fca clang::Parser::ParseAssignmentExpression() + 90
9 clang 0x0849af82 clang::Parser::ParseExpression() + 50
10 clang 0x0845cf85 clang::Parser::ParseExprStatement(clang::ParsedAttributes&) + 69
11 clang 0x084589f6 clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, bool) + 3126
12 clang 0x08454e3b clang::Parser::ParseCompoundStatementBody(bool) + 411
13 clang 0x0845d67c clang::Parser::ParseFunctionStatementBody(clang::Decl_, clang::Parser::ParseScope&) + 156
14 clang 0x08472b39 clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) + 505
15 clang 0x08473642 clang::Parser::LexedMethod::ParseLexedMethodDefs() + 34
16 clang 0x084728b6 clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 150
17 clang 0x084923f7 clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int, clang::Decl_) + 2503
18 clang 0x08493294 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool) + 2212
19 clang 0x0847ff9a clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext) + 2122
20 clang 0x0845da5b clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList_) + 731
21 clang 0x0846129e clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList_) + 622
22 clang 0x08461d9e clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList_) + 110
23 clang 0x084856bb clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt_, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 651
24 clang 0x0846cb21 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec_) + 1089
25 clang 0x0846d973 clang::Parser::ParseTopLevelDecl(clang::OpaquePtrclang::DeclGroupRef&) + 179
26 clang 0x0844316a clang::ParseAST(clang::Sema&, bool) + 330
27 clang 0x08221c17 clang::ASTFrontendAction::ExecuteAction() + 103
28 clang 0x0831b822 clang::CodeGenAction::ExecuteAction() + 66
29 clang 0x08222200 clang::FrontendAction::Execute() + 240
30 clang 0x082094f7 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 327
31 clang 0x081f32b0 clang::ExecuteCompilerInvocation(clang::CompilerInstance_) + 1072
32 clang 0x081ec5da cc1_main(char const**, char const**, char const_, void_) + 874
33 clang 0x081eb4d0 main + 6880
34 libc.so.6 0x415b6e66 __libc_start_main + 230
35 clang 0x081ec0c9
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple i386-pc-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -main-file-name cork.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu pentium4 -target-linker-version 2.22 -momit-leaf-frame-pointer -coverage-file obj/cork.o -resource-dir /usr/bin/../lib/clang/3.0 -D NDEBUG -I src/ -I src/util -I src/file_formats -I src/math -I src/isct -I src/mesh -I src/rawmesh -I src/accel -I /usr/local/Cellar/gmp/5.0.2/include -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/include/c++/4.6 -internal-isystem /usr/include/c++/4.6/i486-linux-gnu -internal-isystem /usr/include/c++/4.6/backward -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.0/include -internal-externc-isystem /usr/include/i486-linux-gnu -internal-externc-isystem /usr/include -O2 -Wall -std=c++11 -fdeprecated-macro -ferror-limit 19 -fmessage-length 80 -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o obj/cork.o -x c++ src/cork.cpp

  1. src/util/iterPool.h:76:10: current parser token ')'
  2. src/util/iterPool.h:55:1: parsing struct/union/class body 'IterPool'
  3. src/util/iterPool.h:72:17: parsing function body '~IterPool'
  4. src/util/iterPool.h:72:17: in compound statement ('{}')
    clang: error: unable to execute command: Segmentation fault
    clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
    clang: note: diagnostic msg: Please submit a bug report to http://llvm.org/bugs/ and include command line arguments and all diagnostic information.
    clang: note: diagnostic msg: Preprocessed source(s) are located at:
    clang: note: diagnostic msg: /tmp/cork-aZn5EA.ii
    make: *** [obj/cork.o] Error 254
    root@Leo001:/home/leonardo/cork-master#

I tried to modify the makeConstant file, but I don't know where are the gmp file requested. Any suggesiton?
Thanks

Evaluate Relative to Carve

Tobias Sargeant has put a lot of time into his CSG library Carve. It would be a good idea to do some comparisons on speed as well as robustness.

Use Cork boolean library QT Application

Hi Gilbert
I have concern when using Cork in QT application.
I would like to ask how can use Cork boolean library in my QT application.
I've already add the library generated in the "lib" folder and i use the Function in the cork.h Still not working it output an error "undefined reference to computeUnion(CorkTriMesh in0, CorkTriMesh in1, CorkTriMesh *out)"
What should i do any suggestion? thanks .

Installation problem with M1 Pro :clang: error: linker command failed with exit code 1

`Compiling obj/cork.o
Compiling obj/util/timer.o
Compiling obj/util/log.o
Compiling obj/isct/empty3d.o
Compiling obj/isct/quantization.o
Compiling obj/file_formats/files.o
Compiling obj/file_formats/ifs.o
Compiling obj/file_formats/off.o
Compiling the Triangle library
src/isct/triangle.c:3298:13: warning: unused variable 'k' [-Wunused-variable]
int i, j, k;
^
src/isct/triangle.c:3299:8: warning: unused variable 'workstring' [-Wunused-variable]
char workstring[FILENAMESIZE];
^
src/isct/triangle.c:11706:28: warning: variable 'collinear' set but not used [-Wunused-but-set-variable]
enum finddirectionresult collinear;
^
3 warnings generated.
Bundling lib/libcork.a
updating include/cork.h
Compiling obj/off2obj.o
Linking off2obj
ld: library not found for -lgmpxx
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bin/off2obj] Error 1

`

I need some help pls!

nullptr exception on specific operation with specific mesh

Hello,

I am getting following crash on a difference operation:

Exception thrown: read access violation.
rightvertex was nullptr.

in triangle.c on line 11835 (if (((leftvertex[0] == endpoint2[0]) && (leftvertex[1] == endpoint2[1])) ||
((rightvertex[0] == endpoint2[0]) && (rightvertex[1] == endpoint2[1]))))

stacktrace:

>	wincork.dll!scoutsegment(mesh * m, behavior * b, otri * searchtri, double * endpoint2, __int64 newmark) Line 11835	C
 	wincork.dll!insertsegment(mesh * m, behavior * b, double * endpoint1, double * endpoint2, __int64 newmark) Line 12297	C
 	wincork.dll!formskeleton(mesh * m, behavior * b, __int64 * segmentlist, __int64 * segmentmarkerlist, __int64 numberofsegments) Line 12542	C
 	wincork.dll!triangulate(char * triswitches, triangulateio * in, triangulateio * out, triangulateio *) Line 15795	C
 	wincork.dll!Mesh<CorkVertex,CorkTriangle>::TriangleProblem::subdivide(Mesh<CorkVertex,CorkTriangle>::IsctProblem * iprob) Line 474	C++
 	wincork.dll!IterPool<Mesh<CorkVertex,CorkTriangle>::TriangleProblem>::for_each(std::function<void __cdecl(Mesh<CorkVertex,CorkTriangle>::TriangleProblem *)> func) Line 139	C++
 	wincork.dll!Mesh<CorkVertex,CorkTriangle>::IsctProblem::resolveAllIntersections() Line 1409	C++
 	wincork.dll!Mesh<CorkVertex,CorkTriangle>::BoolProblem::doSetup(Mesh<CorkVertex,CorkTriangle> & rhs) Line 173	C++
 	wincork.dll!computeDifference(CorkTriMesh in0, CorkTriMesh in1, CorkTriMesh * out) Line 219	C++
 	wincork.dll!computeBoolOp(unsigned int n_trianglesIn0, unsigned int n_verticesIn0, unsigned int * trianglesIn0, float * verticesIn0, unsigned int n_trianglesIn1, unsigned int n_verticesIn1, unsigned int * trianglesIn1, float * verticesIn1, unsigned int & n_trianglesOut, unsigned int & n_verticesOut, unsigned int * * trianglesOut, float * * verticesOut, unsigned int operation) Line 312	C++
 	[Managed to Native Transition]	
 	Common.dll!Common.Backend.CorkBoolOperation.ExecuteOperation(Kitware.VTK.vtkPolyData lhsPolyData, Kitware.VTK.vtkPolyData rhsPolyData, Common.Backend.BooleanOperations.OperationFlag operation) Line 71	C#
 	Common.dll!Common.Backend.CorkBoolOperation.GetResult(Kitware.VTK.vtkPolyData startPolyData, System.Collections.Generic.Queue<Common.Backend.BooleanOperations.Operation> operations) Line 35	C#
 	Common.dll!Common.Backend.BooleanOperations.BooleanOpsBackend.Invoke(bool showConsoleWindow) Line 191	C#
 	CGToolbox.dll!CGToolbox.BooleanOperations.Models.DifferenceOperationModel.PerformDifference(bool showConsoleWindow) Line 157	C#
 	CGToolbox.dll!CGToolbox.BooleanOperations.Models.DifferenceOperationModel.Execute(bool showConsoleWindow) Line 198	C#
 	CGToolbox.dll!CGToolbox.BooleanOperations.ViewModels.DifferenceOperationViewModel.ExecuteAsync.AnonymousMethod__0() Line 129	C#
 	mscorlib.dll!System.Threading.Tasks.Task.Execute() Line 2498	C#
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 954	C#
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Line 902	C#
 	mscorlib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot) Line 2827	C#
 	mscorlib.dll!System.Threading.Tasks.Task.ExecuteEntry(bool bPreventDoubleExecution) Line 2767	C#
 	mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() Line 820	C#
 	[Native to Managed Transition]	
 	kernel32.dll!BaseThreadInitThunk�()	Unknown
 	ntdll.dll!RtlUserThreadStart�()	Unknown

the exception only occurs when doing the difference operation on these specific .off files:
https://filebin.net/8l0t7ocsoz9fwrab
Do the operation -diff Absturz_lhs.off Absturz_rhs.off to reproduce the error

Triangulate symbol

Trying to use Cork on a mac with Xcode.
at link time the " triangulate" symbol is not found.

the Triangle.h header is quite obscure to me, and more specifically the usage of TRILIBRARY def.
as far as i understand, it should be left undefined.

could some one explain how to get rid of this link error and have cork.cpp accessing " triangulate" funcion in mesh.isct.tpp at line 472

Many thanks in advance !

JP

isValid() solidity test needs implementation

This function allows the user to check their input mesh to make sure that it's a valid input. If this routine fails, then the user should not expect the Boolean operation to produce valid output or even to be safe in any manner. Feeding invalid input may cause segmentation faults.

Cork Output is not always Solid!

It is possible to present highly degenerate input to Cork such that the result of a Boolean operation is self-intersecting. AFAIK This can only happen when highly degenerate input is given. The problem here has to do with geometric rounding of the output mesh.

The proposed solution to this problem is snap rounding.

I read up some on snap rounding. I need to look at it in a bit more detail, but it seems like a sound approach. If snap rounding is implemented with some kind of smart surface fragment merging, (i.e. two merging surface fragments should annihilate each other) then that should resolve this issue safely. That is, the issue should be resolved sufficiently that the output of Cork can always be used as new input without the possibility of a crash.

It will not resolve the problem that tiny sliver geometry might be generated. That's impossible to resolve without stating how "slivery" is too slivery, and how much surface perturbation is acceptable to remove slivers. Such geometry can always be removed by an independent post-process on the output of Cork.

need help to compile in vs2013

Hi,

i need help to compile cork in vs2013.
In ubuntu i just use the make file to compile and it works like a charm.
But in windows with vs2013 i dont know how to get it to work.
is there a tutorial to do that?

Increasing perturbing positions times?

I got a problem in doing difference operation, and it turned out to quit in file mesh.isct.tpp, line 1064, where para nTrys decreased to 0. And I find if I increase nTrys to 10(5 previously), it will be fine. Usually it takes 5-7 times of loop to perturbing positions. So, can you increase nTrys to 10 or more? Or is there any other solution for this problem? Maybe something wrong with the mesh?

Getting GMP fatal error

Using Mac, I think I installed GMP with brew, not sure how to check.

But keep getting this when running "make":
fatal error: 'gmp.h' file not found

Clean up Headers

2 options:

  • make all #include statements reference headers' position relative to cork/src/
  • hide all headers except for cork.h, exposing only the C-style interface

I will probably take the 2nd option, since the internal mesh type is not a well-designed enough API to expose.

Perfect Boolean?

Greetings!
Is there any way I could have a perfect Boolean out of cork? I tried to build cork in Windows and applied it to my application. It works fine but the problem is when I hole a cube in a big cube it does not hole completely, there's always some part left.

Low resolution of meshes?

Hi,

After successfully compiling and running cork (Windows 7 64) I was quite surprised to see the very coarse resolution of the objects: in the screenshot the result for the sample geometry (difference of ballA.off and ballB.off) is shown. Is there a setting of grid size or samples I have missed? Similarly coarse results occur for other custom meshes, too.

Thanks and regards,
Matthias

screenshot_corktest_meshlab

Compiling Cork in Linux using Terminal

Hi,
There is a problem when compiling Cork in Linux , I already installed clang 3.7 and GMP.
Any suggestion thanks.

Compiling obj/cork.o
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:47:
In file included from src/mesh/mesh.tpp:29:
src/mesh/../isct/unsafeRayTriIsct.h:46:5: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(t);
^~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:47:
In file included from src/mesh/mesh.tpp:29:
src/mesh/../isct/unsafeRayTriIsct.h:47:5: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(bary);
^~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:401:9: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(v->ref < mesh->verts.size());
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:405:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(eaddr.count(e) > 0); // pointer is good
^~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:406:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(count2(e->verts, v) == 1); // back-pointer is good
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:409:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(taddr.count(t) > 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:410:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(count3(t->verts, v) == 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:417:9: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(e->verts[0] != e->verts[1]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:420:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(vaddr.count(v) > 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:421:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(count(v->edges, e) == 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:424:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(taddr.count(t) > 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:425:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(count3(t->edges, e) == 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:432:9: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(t->verts[0] != t->verts[1] && t->verts[1] != t->verts[2]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:436:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(vaddr.count(v) > 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:437:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(count(v->tris, t) == 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:440:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(eaddr.count(e) == 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:441:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE(count(e->tris, t) == 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() _GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:447:13: error: no matching conversion for
functional-style cast from 'const char [14]' to 'std::exception'
ENSURE((v0 == t->verts[(k+1)%3] && v1 == t->verts[(k+2)%3])
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/util/prelude.h:63:9: note: expanded from macro 'ENSURE'
throw std::exception("ENSURE FAILED");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:60:9: note:
candidate constructor (the implicit copy constructor) not viable: no known
conversion from 'const char [14]' to 'const std::exception' for 1st
argument
class exception
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/exception:63:5: note:
candidate constructor not viable: requires 0 arguments, but 1 was provided
exception() GLIBCXX_USE_NOEXCEPT { }
^
In file included from src/cork.cpp:28:
In file included from src/mesh/mesh.h:48:
In file included from src/mesh/mesh.remesh.tpp:35:
src/mesh/mesh.topoCache.tpp:507:34: error: invalid operands to binary expression
('basic_ostream<char, std::char_traits >' and 'TopoTri')
cout << " " << t << ": " << t << endl;
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:245:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'const void *' for 1st argument; remove *
operator<<(const void
__p)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:108:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'__ostream_type &(
)(__ostream_type &)' for 1st argument
operator<<(__ostream_type& (__pf)(__ostream_type&))
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:117:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'__ios_type &(
)(__ios_type &)' for 1st argument
operator<<(__ios_type& (__pf)(__ios_type&))
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:127:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'std::ios_base &(
)(std::ios_base &)' for 1st argument
operator<<(ios_base& (___pf) (ios_base&))
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:166:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'long' for 1st argument
operator<<(long __n)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:170:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'unsigned long' for 1st argument
operator<<(unsigned long __n)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:174:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'bool' for 1st argument
operator<<(bool __n)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:178:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'short' for 1st argument
operator<<(short __n);
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:181:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'unsigned short' for 1st argument
operator<<(unsigned short __n)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:189:7: note:
candidate function not viable: no known conversion from 'TopoTri' to 'int'
for 1st argument
operator<<(int __n);
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:192:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'unsigned int' for 1st argument
operator<<(unsigned int __n)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:201:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'long long' for 1st argument
operator<<(long long __n)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:205:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'unsigned long long' for 1st argument
operator<<(unsigned long long __n)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:220:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'double' for 1st argument
operator<<(double __f)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:224:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'float' for 1st argument
operator<<(float __f)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:232:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'long double' for 1st argument
operator<<(long double __f)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:270:7: note:
candidate function not viable: no known conversion from 'TopoTri' to
'__streambuf_type _' (aka 'basic_streambuf<char, std::char_traits >
*') for 1st argument
operator<<(_streambuf_type __sb);
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:476:5: note:
candidate function [with _CharT = char, _Traits = std::char_traits]
not viable: no known conversion from 'TopoTri' to 'char' for 2nd argument
operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:482:5: note:
candidate function [with _Traits = std::char_traits] not viable: no
known conversion from 'TopoTri' to 'char' for 2nd argument
operator<<(basic_ostream<char, _Traits>& __out, char __c)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:488:5: note:
candidate function [with _Traits = std::char_traits] not viable: no
known conversion from 'TopoTri' to 'signed char' for 2nd argument
operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:493:5: note:
candidate function [with _Traits = std::char_traits] not viable: no
known conversion from 'TopoTri' to 'unsigned char' for 2nd argument
operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:530:5: note:
candidate function [with _Traits = std::char_traits] not viable: no
known conversion from 'TopoTri' to 'const char _' for 2nd argument
operator<<(basic_ostream<char, _Traits>& _out, const char __s)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:543:5: note:
candidate function [with _Traits = std::char_traits] not viable: no
known conversion from 'TopoTri' to 'const signed char _' for 2nd argument
operator<<(basic_ostream<char, _Traits>& _out, const signed char __s)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:548:5: note:
candidate function [with _Traits = std::char_traits] not viable: no
known conversion from 'TopoTri' to 'const unsigned char _' for 2nd
argument
operator<<(basic_ostream<char, _Traits>& _out, const unsigned char __s)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:602:5: note:
candidate function [with _CharT = char, _Traits = std::char_traits,
_Tp = TopoTri] not viable: no known conversion from 'basic_ostream<char,
std::char_traits >' to 'basic_ostream<char, std::char_traits >
&&' for 1st argument
operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/ostream.tcc:321:5: note:
candidate function [with _CharT = char, _Traits = std::char_traits]
not viable: no known conversion from 'TopoTri' to 'const char _' for 2nd
argument
operator<<(basic_ostream<_CharT, _Traits>& _out, const char __s)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:1150:5: note:
candidate function [with _CharT = char, _Traits = std::char_traits]
not viable: no known conversion from 'TopoTri' to 'const
std::bernoulli_distribution' for 2nd argument
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:471:5: note:
candidate template ignored: deduced conflicting types for parameter
'_CharT' ('char' vs. 'TopoTri')
operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/basic_string.h:2772:5: note:
candidate template ignored: could not match
'basic_string<type-parameter-0-0, type-parameter-0-1, type-parameter-0-2>'
against 'TopoTri'
operator<<(basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/ostream:513:5: note:
candidate template ignored: could not match 'const _CharT _' against
'TopoTri'
operator<<(basic_ostream<_CharT, _Traits>& __out, const CharT __s)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.h:1279:5: note:
candidate template ignored: could not match
'independent_bits_engine<type-parameter-0-0, __w, type-parameter-0-2>'
against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:156:5: note:
candidate template ignored: could not match
'linear_congruential_engine<type-parameter-0-0, __a, __c, __m>' against
'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:477:5: note:
candidate template ignored: could not match
'mersenne_twister_engine<type-parameter-0-0, __w, __n, __m, __r, __a, __u,
__d, __s, __b, __t, __c, __l, __f>' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:632:5: note:
candidate template ignored: could not match
'subtract_with_carry_engine<type-parameter-0-0, __w, __s, __r>' against
'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:702:5: note:
candidate template ignored: could not match
'discard_block_engine<type-parameter-0-0, __p, __r>' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:831:5: note:
candidate template ignored: could not match
'shuffle_order_engine<type-parameter-0-0, __k>' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:1029:5: note:
candidate template ignored: could not match
'uniform_int_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:1088:5: note:
candidate template ignored: could not match
'uniform_real_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:1232:5: note:
candidate template ignored: could not match
'geometric_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:1347:5: note:
candidate template ignored: could not match
'negative_binomial_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:1552:5: note:
candidate template ignored: could not match
'poisson_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:1819:5: note:
candidate template ignored: could not match
'binomial_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:1883:5: note:
candidate template ignored: could not match
'exponential_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:2050:5: note:
candidate template ignored: could not match
'normal_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:2115:5: note:
candidate template ignored: could not match
'lognormal_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:2188:5: note:
candidate template ignored: could not match
'chi_squared_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:2275:5: note:
candidate template ignored: could not match
'cauchy_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:2352:5: note:
candidate template ignored: could not match
'fisher_f_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:2427:5: note:
candidate template ignored: could not match
'student_t_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:2596:5: note:
candidate template ignored: could not match
'gamma_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:2674:5: note:
candidate template ignored: could not match
'weibull_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:2750:5: note:
candidate template ignored: could not match
'extreme_value_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:2886:5: note:
candidate template ignored: could not match
'discrete_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:3096:5: note:
candidate template ignored: could not match
'piecewise_constant_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/random.tcc:3312:5: note:
candidate template ignored: could not match
'piecewise_linear_distribution' against 'TopoTri'
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
src/isct/../math/vec.h:133:22: note: candidate template ignored: could not match
'Vec2' against 'TopoTri'
inline std::ostream& operator<<(std::ostream &out, const Vec2 &vec) {
^
src/isct/../math/vec.h:240:22: note: candidate template ignored: could not match
'Vec3' against 'TopoTri'
inline std::ostream& operator<<(std::ostream &out, const Vec3 &vec) {
^
src/isct/../math/vec.h:349:22: note: candidate template ignored: could not match
'Vec4' against 'TopoTri'
inline std::ostream& operator<<(std::ostream &out, const Vec4 &vec) {
^
src/isct/../math/ray.h:46:22: note: candidate template ignored: could not match
'Ray3' against 'TopoTri'
inline std::ostream& operator<<(std::ostream &out, const Ray3 &ray) {
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Makefile:206: recipe for target 'obj/cork.o' failed
make: *** [obj/cork.o] Error 1

Starting Point for Further Development

Is this code base for CSG a good place to start further development? I need a robust CSG library for a 3D printing project. Tools for doing CSG seem ok for simple cases but break down for the more complex cases I've been working with. It has been very frustrating. So the plan is to start with a good CSG library and make it robust.
Is this project a good place to start, do you think? Would you recommend a different library? Looking for C or C++ code base.

Write a real README

This needs to include installation instructions and use examples sufficient to get a user bootstrapped.

This may sound like a rant.

What is the point of code where no one else can make sense of it. I have seen some bad coding but this bite the cake. Things are all over the place, almost impossible to follow what is going on.

using cork in my own project

cork works fine in its demo application: "wincork", but when I include it in my own project the compiler complains about vec.h as below:

1>------ Rebuild All started: Project: QtGuiApplication2, Configuration: Release x64 ------
1> Moc'ing QtGuiApplication2.h...
1> Uic'ing QtGuiApplication2.ui...
1> Rcc'ing QtGuiApplication2.qrc...
1>RCC : warning : No resources in 'E:\C++\QtGuiApplication32015\QtGuiApplication2\QtGuiApplication2.qrc'.
1>
1> cork.cpp
1>C:\cork\src\math\vec.h(96): error C2988: unrecognizable template declaration/definition
1>C:\cork\src\math\vec.h(96): error C2059: syntax error: 'const'
1>C:\cork\src\math\vec.h(96): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(96): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
1>C:\cork\src\math\vec.h(96): error C2059: syntax error: ')'
1>C:\cork\src\math\vec.h(98): error C2065: 'N': undeclared identifier
1>C:\cork\src\math\vec.h(98): error C2923: 'Vec2': 'N' is not a valid template type argument for parameter 'N'
.
.
.

I am using MSVC2015. The way I used cork in my project is that I gave the proper addresses in my project properties for linking and libraries, then I included all the files which are presented in the wincork demo project to my own project.

Any help is appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.