Git Product home page Git Product logo

triwild's Introduction

TriWild: Robust Triangulation With Curve Constraints

Yixin Hu, Teseo Schneider, Xifeng Gao, Qingnan Zhou, Alec Jacobson, Denis Zorin, Daniele Panozzo. ACM Transactions on Graphics (SIGGRAPH 2019).

Build Build Status

Important Tips

πŸ’‘πŸ’‘πŸ’‘ We also have 3D version of "TriWild" - TetWild! It's the parent of TriWild. TetWild can generate linear tetrahedral meshes robustly and automatically. Check it out πŸ‘‰ TetWild.

πŸ’‘πŸ’‘πŸ’‘ If you are interested in the algorithm details, please refer to our paper first. We provide plenty of examples and statistics in the paper.

@article{Hu:2019:TRT:3306346.3323011,
 author = {Hu, Yixin and Schneider, Teseo and Gao, Xifeng and Zhou, Qingnan and Jacobson, Alec and Zorin, Denis and Panozzo, Daniele},
 title = {TriWild: Robust Triangulation with Curve Constraints},
 journal = {ACM Trans. Graph.},
 issue_date = {July 2019},
 volume = {38},
 number = {4},
 month = jul,
 year = {2019},
 issn = {0730-0301},
 pages = {52:1--52:15},
 articleno = {52},
 numpages = {15},
 url = {http://doi.acm.org/10.1145/3306346.3323011},
 doi = {10.1145/3306346.3323011},
 acmid = {3323011},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {curved triangulation, mesh generation, robust geometry processing},
}

πŸ’‘πŸ’‘πŸ’‘ Check our license first.

Dataset

πŸ’‘πŸ’‘πŸ’‘ Please kindly cite our paper when using our pre-generated data.

Examples in the Paper

Download zip.

πŸ’‘πŸ’‘πŸ’‘Quickly try TriWild on some small exmaples here!!

20k Openclip Dataset

Input: 19686 meshes (.obj) each with a curved feature file (.json)

(For your reference, here is original 20k SVG images. Those with animation are not converted to obj/json.)

Output with curved constrains: 19685 meshes (.msh)

Output with linear constrains(todo James): 19686 meshes (.msh)

Installation

You can use TriWild either by pulling a Docker image or compiling the source code with CMake.

via Docker

Install Docker and run Docker. Pull TetWild Docker image and run the binary:

docker pull yixinhu/triwild
docker run --rm -v "$(pwd)":/data yixinhu/triwild /app/TriWild/build/TriWild [TriWild arguments]

via CMake

Our code was originally developed on MacOS and has been tested on Linux and Windows. We provide the commands for installing TriWild in Unix OS:

  • Clone the repository into your local machine:
git clone https://github.com/wildmeshing/TriWild
  • Compile the code using cmake (default in Release mode):
cd TriWild
mkdir build
cd build
cmake ..
make -j
  • Check the installation:
./TriWild --help

This command should show a list of TriWild parameters.

Usage

Input:

  • Linear constraints (required): segment soup in .obj format.

  • Curved constraints: Bezier curves in .json format.

Output: Linear/high-order triangle mesh in .msh format.

Please check dataset above for examples.

Quick Try

You can try TriWIld quickly with default parameters by running

./TriWild --input input.obj

for linear constrains, or

./TriWild --input input.obj --feature-input input.json

for curved constrains.

Command Line Switches

Usage: ./TriWild [OPTIONS]

Options:
  -h,--help                   Print this help message and exit
  --input TEXT (REQUIRED)     Input segments in .obj format.
  --output TEXT               Output path.
  --postfix TEXT              Add postfix into outputs' file name.
  --feature-input TEXT        Input feature json file.
  --stop-quality FLOAT        Specify max AMIPS energy for stopping mesh optimization.
  --max-its INT               Max number of mesh optimization iterations.
  --stage INT                 Specify envelope stage
  --envelope-r FLOAT          relative envelope epsilon_r. Absolute epsilonn = epsilon_r * diagonal_of_bbox
  --feature-envelope-r FLOAT  Relative feature envelope mu_r. Absolute mu = mu_r * diagonal_of_bbox
  --target-edge-length FLOAT  Absolute target edge length l.
  --target-edge-length-r FLOAT
                              Relative target edge length l_r. Absolute l = l_r * diagonal_of_bbox
  --log-file TEXT             Output a log file.
  --min-angle FLOAT           Desired minimal angle.
  --mute-log                  Mute prints.
  --cut-outside               Remove "outside part".
  --skip-eps                  Skip saving eps.
  --cut-holes TEXT            Input a .xyz file for specifying points inside holes you want to remove.
  --output-linear-mesh        Output linear mesh for curved pipeline.

More details about some important parameters:

  • --feature-input

We provide a python script for converting a svg to curves in .json format.

  • --envelope

Relative surface envelope (1e-3 in default). Absolute surface envelope , where is the length of the diagonal of the bounding box of input.

  • --feature-envelope

Relative feature envelope (1e-3 in default with linear constraints and 2e-3 for curved constraints). Absolute feature envelope .

  • --target-edge-length-r

Relative targeted edge length (0.05 in default). Absolute targeted edge length .

License

TriWild is MPL2 licensed and free for both commercial and non-commercial usage. However, you have to cite our work in your paper or put a reference of TriWild in your software. Whenever you fix bugs or make some improvement of TriWild, you should contribute back.

Gallery

triwild's People

Contributors

teseoch avatar yixin-hu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

triwild's Issues

Getting Started

Hello,

I'm a new user and I'm a little confused on how to generate obj files to input. Also I was wondering if you had any examples of simpler shapes.

Thank You!

void triwild::feature::remove_high_curvature

Hello,

I have compiled the project with visual 2017 and when i run in debug with figure 1 from pregenerated data I get an error.
it looks:
in function void triwild::feature::remove_high_curvature
in the loop for (int j = 0; j < ranges.size(); j += 2)
in condition if (j == ranges.size() - 2) {
in loop for (double infl: old_inflection) {
in condition if (infl > ts[i][ranges[j]] && infl < ts[i][ranges[j + 1]])
the program crash because ts[i][ranges[j + 1]] generates Assertion failed: vector subscript out of range

Did you get this error?

Triwild crashes in building Figure 7 (left)

I am experiencing issues with a large targeted edge length. Triwild crashes when reproducing the coarsest part of Figure 7. The attached includes the errors. With the smaller values of targeted edge length reported in the paper there is no failure.

triwild-crash.txt

Features aren't exported into `msh`

Hello every1.

I was wondering if there were any reason to not exporting the input features in the mesh file.

Ideally, those features should be meshed as curved edge elements, and tagged using gmsh physical groups.
Doing so, the numerical practitioner could easily enforce some special boundary conditions on those tagged feature elements.

TriWild dependencies and build system

I am interested in trying out TriWild as a replacement for Triangle in my program.

Is there a mailing list or forum or other place to ask questions? I always hate posting questions to an Issue list. Sorry if this is the wrong place, but I couldn't find any other place for questions.

I use Triangle for both simple 2D CDT and also mesh generation -- where the boundary is fully specified, but Triangle inserts interior points to reach mesh size and quality goals.

The Triangle license is problematic. It also crashes far more often than I can deal with anymore. I have tried various 'improved' wrappers that attempt to catch various failure cases more elegantly, but none of them are satisfactory.

Shewchuk is unresponsive to questions about the license and development of the library appears to be dead. This would be fine if was problem-free, but that is certainly not the case in my experience.

Hopefully TriWild improves in a number of these areas.

I need to build TriWild as a library and call that from my program -- I currently use CMake. Specifically, I use the SuperBuild approach to have a Library and Main project and then I bundle my various libraries with ExternalProject_add. I am sensitive to the dependencies I add to my program -- I much prefer libraries with few or no dependencies.

From what I can tell, TriWild requires LIBIGL and GMP. It may also require NLOPT and geogram. Digging into some of the CMake, it also appears to download aabbcc, and json. LibIGL itself requires Eigen. I couldn't really tell how deep the dependency rabbit hole goes.

Some of my users need to build my program (and any dependencies) on a computer that does not have access to the internet. Because of this (and also for testing and repeatability sake), I always embed *.zip files of dependencies in my program instead of downloading the latest version from the upstream project (as a compromise, it is better to point at a specific upstream version).

From what I can tell, TriWild's build requires an internet connection to download at least a half dozen libraries -- some of which have their own dependency chain.

That doesn't even get into the mess that is the melange of software licenses that all these libraries introduce.

Is there any place where the use of these dependencies by TriWild is clearly documented? Optional libraries are clearly identified and instructions given for leaving them out.

Is there any plan going forward to reduce the number of dependencies? A number of them appear to be relatively simple convince libraries implementing commodity data structures. In my experience, it is generally better to re-implement what is needed from these cases and drop the dependency.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.