Skip to content

Code mirror of the paper: InverseCSG: Automatic Conversion of 3D Models to CSG Trees

Notifications You must be signed in to change notification settings

mariarzv/InverseCSG-1

 
 

Repository files navigation

InverseCSG: automatic conversion of 3D models to CSG trees

c++_CI

This folder provides a snapshot of the code with the paper "InverseCSG: automatic conversion of 3D models to CSG trees" when it was submitted to Siggraph Asia 2018.

The current repository is modified from the original code snapshot recovered from the supplementary material hosted on the ACM digital library. Any changes in this repo are those of the authors of this forked repo and do not necessarily reflect the views of the original authors.

Platform

Dependencies

  • C++ toolchain: sudo apt-get install build-essential autoconf libtool flex bison mercurial zsh cmake.
  • Python 3 (should be already preinstalled in Ubuntu 16.04).
  • The latest Sketch.
  • Java >= 1.8 (needed by Sketch).
  • maven >= 2.2.1 (needed by Sketch).

Installation

Automatic installation

The easiest way is to navigate to the root folder and run python3 install.py <build_folder>, where build_folder can be any folder that you have write access to. We recommend you use a build_folder outside the root folder. This Python script will compile the source code in cpp/ and attempt to install any missing dependencies, which might need your sudo privilege.

Manual installation

You can also choose to do a manual installation if install.py fails to finish successfully.

  • Run

    sudo apt-get install build-essential autoconf libtool flex bison mercurial zsh cmake
  • Navigate to your build_folder, create a cpp subfolder, and compile the C++ code:

    cd <build_folder>
    mkdir cpp
    cd cpp
    cmake <root_folder>/cpp
    make
  • Follow the Install from source section in this link to install Sketch.

Test

If the installation is successful, you can navigate to the root folder and try running:

python3 run_tests.py <build_folder> one_cube

This solves a simple cube. The whole process should finish within a minute. You can replace one_cube with other example names rerun the command. Please see run_tests.py for all example names.

If you want to see some quick results, you can try:

python3 run_tests.py <build_folder> ex_011
python3 run_tests.py <build_folder> ex_067
python3 run_tests.py <build_folder> ex_096
python3 run_tests.py <build_folder> ex_144
python3 run_tests.py <build_folder> ex_145

Examples

The dataset of our 50 CAD models can be found in the example folder.

Solutions

The solutions to all of our examples are in the solution folder. Each subfolder has two SCAD files: sketch.scad is the output of our method before simplification, and sketch_final.scad is the final resuls after simplification.

When you use OpenSCAD to open and render these solutions, you will notice there are a lot of degenerated planes. These planes come from a CSG intersection or difference operation that applies to two solids with same dimensions. To illustrate this point, consider subtracting a cylinder from the center of a cube that happens to have the same height, then the top and bottom circles of the cylinder can be either considered inside or outside the solution and the behavior is therefore undefined. As a result, these artifacts do not mean our solutions have an volumetric error.

Citation

If you find this work useful, please cite:

@article{du2018inversecsg,
  title={Inversecsg: Automatic conversion of 3d models to csg trees},
  author={Du, Tao and Inala, Jeevana Priya and Pu, Yewen and Spielberg, Andrew and Schulz, Adriana and Rus, Daniela and Solar-Lezama, Armando and Matusik, Wojciech},
  journal={ACM Transactions on Graphics (TOG)},
  volume={37},
  number={6},
  pages={1--16},
  year={2018},
  publisher={ACM New York, NY, USA}
}

About

Code mirror of the paper: InverseCSG: Automatic Conversion of 3D Models to CSG Trees

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 51.4%
  • OpenSCAD 31.0%
  • Python 15.0%
  • MATLAB 2.5%
  • CMake 0.1%