Skip to content
/ pycgal Public

python wrappers around CGAL library ( wip) only Optimal Transport Implemented

Notifications You must be signed in to change notification settings

xvdp/pycgal

Repository files navigation

pycgal

A few routines to deal with edges in python, pytorch, numpy.

Minimal python wrapper to CGAL, https://www.cgal.org/, library using pybind11 https://github.com/pybind. No more than a couple hours work.

I simply wrapped CGAL to look into Optimal Transport for curve simplification. If you are looking for CGAL in python, this isn't. However, implementing other CGAL algorithms is easy as pie with this as template. Look into src/main.cpp

If you do implement more packages, put a pull request. If you dont know how, I can do it, but I dont guarantee I will as this is just a toy project atm.

Packages implemented:

  1. pybind11 wrap of CGAL 5.0 Optimal Transport to simplify sketch to minimum edges.

TODO replace py::array with py::buffer to deal with pytorch tensors direction 2. Pytorch Canny edge finding filter.

Prerequisites

  • CMake >= 3.5

C++14 enabled compiler

  • tested on linux with 7.4.0
  • VS 2015 on Windows. Untested

Installation

CGAL has multiple requirements including MPFR (https://www.mpfr.org/) Boost, Eigen. To install all dependencies one can install libcgal-dev from repository.

sudo apt-get install libcgal-dev

Current package on ubuntu is cgal (4.7-4). This code requires cgal 5.0. So this project clones and builds it. TODO include boost and mpfr installation

Conda install example

conda create --name test_evn python # latest python 3 is recommended, but should work with 2.7
conda activate test_evn

Clone environment with recursive flag to include cgal and pybind11 submodules

git clone https://github.com/xvdp/edges.git --recursive
cd edges

pip installation

../install.sh

conda installation TODO: conda installation currently faulty

conda install conda-build
conda create --name test_evn
conda activate test_evn
conda build conda.recipe

docker TODO: untested

cd pycgal/docs
make html

Licenses

Pybind11: BSD CGAL Optimal Transport: GPL

Test / Example

Test is executed on install

python tests/test.py

About

python wrappers around CGAL library ( wip) only Optimal Transport Implemented

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published