Closed mariuszhermansdorfer closed 1 year ago
There are several steps if you want to do it yourself:
Step 1: Install CMake. Install cockroach libraries, when running CMakeLists.txt
Step 2: Write simple Console Application in C++ to test a data set of this function.
Step 3: Create C++ rhino plugin and run the function. Here you will need to write rhino mesh conversions. Test various inputs in Rhino.
Step 4: If you want to bind it use PInvoke for C# or pybind11 for Python.
That is a typical process I use.
Thanks for your quick response @petrasvestartas!
will dive into it and get back to you.
Hey @petrasvestartas, I've managed to compile Cockroach following the steps provided in the readme. It does open the my_exe.exe file and I can see the test point cloud. However, there is no *.DLL file generated for CGAL. Do you know how to modify the cmakelists file to create one?
The minimal example is under the libraries section: https://github.com/petrasvestartas/CMAKE#libraries
in short you need to replace the executable:
add_executable(my_exe main_cilantro.cpp)
to the static library:
add_library(LIBRARY_NAME STATIC/SHARED/OBJECT source1.cpp source2.cpp)
thanks @petrasvestartas, I'll give it a go and report back!
Hmm, I just realized that CGAL is a header-only library hence it doesn't come with any .cpp files. I'd probably have to create these first to be able to compile a DLL. Having no experience with c++, I'd need some guidance to get there.
Do you have any good examples in cockroach where you call CGAL methods from a .cpp file?
CPP files are just implementations of function declaration in header files. They are c++ files just with different endings.
STEP1 I suggest to start from PInvoke of simple addition function (ignore the rest of the code for now): https://github.com/9and3/Cockroach/blob/Cockroach/PInvokeCGAL/baseCGAL.cpp https://github.com/9and3/Cockroach/blob/Cockroach/PInvokeCGAL/baseCGAL.h
STEP2 The reason why you need function declarations, is that on C# you would call these declarations, without and you do not need to care about the actual code of the function: https://github.com/9and3/Cockroach/blob/Cockroach/PInvokeCSharp/UnsafeCGAL.cs
STEP3 And then you can actually test these functions: https://github.com/9and3/Cockroach/blob/Cockroach/PInvokeCSharp/TestCGAL.cs
I would like to ask you to open issues in the official IBOIS Cockroach repository. This repo was only a temporary one. Issues can be created here: https://github.com/ibois-epfl/Cockroach/issues
If no further development is done in this question I close it. If yes feel free to open the issue again.
Hey Developers,
as mentioned on the Rhino forum, Alpha Wrapping is not part of Cockroach yet. If you were interested in adding this functionality, I'd be happy to contribute to the code base.
Would need some guidance with marshalling into unmanaged code, but am eager to learn.