Git Product home page Git Product logo

stlbfgs's Introduction

Build

UltiMaille: the ultimate mesh handling library

This library does not contain any ready-to-execute remeshing algorithms. It simply provides a friendly way to manipulate a surface/volume mesh, it is meant to be used by your geometry processing software. Here you will find serialization, attributes, basic algebra, helpers like k-NN queries and few other things.

There are many mesh processing libraries in the wild, excellent specimens are:

I am, however, not satisfied with either of those. At the moment of this writing, Geogram, for instance, has 847 thousands (sic!) of lines of code. I strive to make a library under 10K loc able to do common mesh handling tasks for surfaces and volumes. Another reason to create yet-another-mesh-library is that I like explicit types and avoid auto as long as it reasonable. In practice it means that I cannot use libigl for the simple reason that I do not know what this data represents:

Eigen::MatrixXd V;
Eigen::MatrixXi F;

Is it a polygonal surface or a tetrahedral mesh? If surface, is it triangulated or is it a generic polygonal mesh? I simply can not tell... Thus, ultimaille provides several classes that allow to represent meshes:

PointSet
PolyLine
Triangles, Quads, Polygons
Tetrahedra, Hexahedra, Wedges, Pyramids

You can not mix tetrahedra and hexahedra in a single mesh, I believe that it is confusing to do otherwise. If you need a mixed mesh, create a separate mesh for each cell type: these classes allow to share a common set of vertices via a std::shared_ptr.

Common principles

  • This library is meant to have a reasonable performance. It means that I strive to make it as rapid as possible as long as it does not deteriorate the readability of the source code.
  • All the library is built around STL containers (mainly std::vector<int>), normally it will have no malloc/free/new/delete instructions.
  • Despite that, there will be no size_t and iterator:: in the code. An int is an int. End of discussion.
  • There will be as little templates as it is reasonable, the default data types are int and double.

Compile and run unit tests:

git clone --recurse-submodules https://github.com/ssloy/ultimaille.git &&
cd ultimaille &&
mkdir build &&
cd build &&
cmake -DUM_UNIT_TESTS:BOOL=ON .. &&
make -j &&
ctest .

stlbfgs's People

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

Watchers

 avatar  avatar  avatar  avatar

stlbfgs's Issues

Divide by zero error in line search

At line 40 in the linesearch.cpp code there is a divide by zero occurring.

    double find_quadratic_minimizer(double a, double ga, double b, double gb) {
        return b + ((b - a)*gb)/(ga - gb);
    }

I tried to code a work around with an if (ga == gb) statement, but don't know what the return value should be in that case. Suggestions?

    double find_quadratic_minimizer(double a, double ga, double b, double gb) {
        if (ga == gb) {
          return 0;
        }
        else {
          return b + ((b - a)*gb)/(ga - gb);
        }
    }

Difficult to get low gradients

I have implemented your LBFGS implementation in my chemistry code and try to use it to minimize the energy of molecules using a classical potential function. For some compounds it is very difficult to get the gradients small enough. For my application I need them to be under 1e-6. I tried playing with mu and eta, but little effect.

One more piece of information is that for some difficult cases some of the gradients are always zero, due to symmetry. I find that breaking the symmetry sometimes makes it possible to get a converged minimization on function value, but still with gradient that are > 1e-4.

Suggestions welcome.

Sandpit helloworld

add_executable(helloworld helloworld.cpp) <- may conflicts with projects containing helloworlds including this project . I recommand:
add_executable(stlbfgs_helloworldhelloworld.cpp)

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.