Skip to content

telamonian/pyPolyCSG

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyPolyCSG © James Gregson 2012
james.gregson@gmail.com

======================================================
OVERVIEW =============================================
======================================================

A C++ wrapper (+ Boost::Python-based extension module) for the Carve Constructive Solid Geometry (CSG) library, intended to simplify performing CSG operations on meshes.  Reads and writes a variety of mesh formats.

======================================================
LICENSE ==============================================
======================================================

pyPolyCSG code is licensed under the permissive MIT license, however commercial users should be aware that the Carve library upon which pyPolyCSG depends is licensed under the GPL v2.  Commercial users are advised to contact the Carve authors to negotiate custom license terms.

======================================================
INSTALLATION =========================================
======================================================

PyPolyCSG depends on the Carve library to perform boolean operation on polyhedra. To obtain and build the library run the following commands from the third_party subdirectory.  Note that building Carve requires the CMake build system to be installed.  The Boost library must also be installed.

hg clone https://code.google.com/p/carve
mkdir carve_build
cd carve_build
cmake ../carve -DCMAKE_BUILD_TYPE=Release
make

If successful, this will produce a set of files in the carve_build directory that are referenced by the PyPolyCSG build scripts along with the files in the carve directory. You can optionally install carve for use in other programs by running the command:

make install

from the carve_build directory as well. Note that you may need to copy config.h from carve_build/include/carve and carve/include/gnu_cxx.h to the install prefix (I did) before installing pyPolyCSG.

======================================================
Python pyPolyCSG extension module:

Edit the setup.py script in the root installation directory to correctly set paths for your system. Then run the following from the root installation directory:

python setup.py install

to install the extension module.  This may need to be run as root. Examples demonstrating the library can then be run from the scripts/ subdirectory.

======================================================
C++ Test Executable:

Edit the CMakeLists.txt file to correctly set paths for your system. Then run the following from the root installation directory

mkdir build
cd build
cmake .. 
make

This should build a 'boolean_test' executable that subtracts an ellipsoid from a box, saving the result as 'dump.obj'.


About

A Polyhedral CSG library for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 74.9%
  • Python 25.1%