Skip to content

About

Shrink wrap input 3D geometries!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

44 Commits

Folders and files

Repository files navigation

ShrinkWrap

This utility generates a watertight and orientable mesh over input 3D geometries via the CGAL library. This mesh is termed a "shrink wrap".

ShrinkWrap takes as inputs and outputs OBJ files, and maps materials if available.

A shrink wrap of one storey of an apartment building:

Input Output
Tembusu L12 Tembusu L12 wrap

A shrink wrap from multiple inputs:

Input 1 Input 2 Output
KPF Robinson Tower Structure KPF Robinson Tower Facade KPF Robinson Tower wrap

CLI Executable

Build from source

  1. Create a conda environment with the necessary preqrequisites via the environment.yml file:

    conda env create -f environment.yml
    conda activate shrink-wrap
    
  2. Build and compile the program:

    cmake -S . -B ./build
    cmake --build ./build
    

Run

./build/shrink_wrap data/input/Tembusu\ L12/ data/output/Tembusu\ L12 500.0 1.0

./build/shrink_wrap data/input/KPF\ Robinson\ Tower data/output/KPF\ Robinson\ Tower 0.5 0.001

Arguments

Name Type Description
input std::string Directory that contains OBJ meshes to be shrink wrapped
out std::string Target name of the OBJ and MTL shrink wrap files
alpha double Alpha parameter (see CGAL 3D Alpha Wrapping), must be greater than 0.0
offset double Offset parameter (see CGAL 3D Alpha Wrapping), must be greater than 0.0

Java

Install from releases

Install the latest JAR file from this repo's releases.

Build from source

  1. Build a JAR file with Docker:

    docker build . -f java/Dockerfile --output=.
    
  2. Install the package from the JAR file.

Usage

import io.github.ccheemeng.shrink_wrap.ShrinkWrap;

public class Main {
    public static void main(String[] args) {
        ShrinkWrap.shrinkWrap(
            "data/input/Tembusu L12", "data/output/Tembusu L12", 500.0, 1.0
        );
        ShrinkWrap.shrinkWrap(
            "data/input/KPF Robinson Tower",
            "data/output/KPF Robinson Tower",
            0.5,
            0.001,
        );
    }
}

Python

Install from releases

Install the latest wheel from this repo's releases:

pip install <wheel-file>

Build from source

  1. Build a Python wheel with Docker:

    docker build . -f python/Dockerfile --output=.
    
  2. Install the package from the built wheel:

    pip install <wheel-file>
    

Usage

import shrink_wrap

shrink_wrap.shrink_wrap(
    "data/input/Tembusu L12", "data/output/Tembusu L12", 500.0, 1.0
)
shrink_wrap.shrink_wrap(
    "data/input/KPF Robinson Tower",
    "data/output/KPF Robinson Tower",
    0.5,
    0.001,
)

About

Shrink wrap input 3D geometries!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages