Category: Open Source Libraries

CGAL Point in Polyhedron Algorithm

The “point in polygon” or “point in polyhedron” is a classic computer graphics problem. The goal is to determine whether a given point is inside a polygon (in 2D) or a polyhedron (in 3D). One solution to the problem is shooting a ray originating from the said point to an arbitrary direction and determine the number …

Continue reading

“Unresolved external symbol” Errors when Compiling CGAL 4.7 Under Windows with Visual Studio 2013

I spent hours trying to compile CGAL 4.7 with Visual Studio 2013. Everything compiled on the first try with Visual Studio 2010 but for some reason I was unable to get it working with VS2013. CMake would create the solution files just fine and was able to resolve everything. However, when I attempted to build …

Continue reading

Carve Error : “didn’t manage to link up hole!”

Carve is a fast and robust library for performing Constructive Solid Geometry (CSG) operations (boolean operations) on meshes. In case the mesh is corrupted or has self-intersections, Carve will refuse to perform operations on it and will terminate with this error: “didn’t manage to link up hole!”. To solve that, simply open the mesh in …

Continue reading

CImg and NVIDIA’s NPP Interop

Apparently, NPP relies on the pixel order of its input arrays (they need to be interleaved). If you are planning on using CImg with NPP, be sure to check this post out before attempting to do so. Failing to permute CImg image axes will result in wrong filtered values for color images.

CImg does not store pixels in the interleaved format

  Took me hours before I found and read the documentation. CImg stores pixels in a planer format (RRRR…..GGGG…..BBBB). For most tasks in CUDA, it’s much better to store the pixel values in the interleaved format (RGBRGBRGB……). In order to do that, just call the permute_axes method of the CImg object: CImg image(“image.jpg”); image.permute_axes(“cxyz”);    IMPORTANT: After …

Continue reading