Adaptive Multigrid Solvers (poissonrecon)

repository·master·Indexed 23 days ago

https://github.com/mkazhdan/poissonrecon

A high-performance library for general adaptive finite-element (FEM) systems, evolved from Poisson Surface Reconstruction. It supports spaces of arbitrary dimension, discretization using finite-elements of arbitrary degree, and both point-wise and integrated constraints. The package includes tools such as PoissonRecon for triangle mesh reconstruction from oriented 3D points, SSDRecon for surface mesh reconstruction via Smooth Signed Distance functions, and PoissonReconServer/Client for distributed reconstruction.

Tokens
8.8K
Snippets
2
Records
47
Agent score
83%

What's inside poissonrecon

  1. Overview of Adaptive Multigrid Solvers

    master

    The poissonrecon codebase is an evolution of the Poisson Surface Reconstruction code, designed to support general adaptive finite-element (FEM) systems. It is capable of handling:

    • Spaces of arbitrary dimension.
    • Discretization using finite-elements of arbitrary degree.
    • Arbitrary function derivatives.
    • Both point-wise and integrated constraints.
  2. Process 2D point sets with PoissonRecon and SSDRecon

    master
    Starting from version 10.06, PoissonRecon and SSDRecon support processing 2D point sets. The 2D implementations of PoissonRecon, SSDRecon, and AdaptiveTreeVisualization also support outputting to .jpg and .png image files.
  3. General restrictions and disclaimers for libjpeg-turbo

    master

    When using libjpeg-turbo, observe these universal constraints:

    • No Endorsement: You cannot use the name of the IJG, the libjpeg-turbo Project, or its contributors in advertising, publicity, or to endorse/promote products derived from this software without specific prior written permission.
    • No Warranty: The IJG and the libjpeg-turbo Project do not warrant the software to be free of defects and accept no liability for undesirable consequences resulting from its use.
    • Disclaimer: The software is provided "AS IS" without any express or implied warranties, including warranties of merchantability or fitness for a particular purpose.
  4. Understand the libjpeg-turbo licensing model

    master

    libjpeg-turbo uses two compatible BSD-style licenses depending on which part of the library you are using:

    • IJG (Independent JPEG Group) License: Applies to the libjpeg API library and associated programs (including inherited code and modifications). Note that while SIMD source code bears the zlib License, its terms are subsumed by the IJG License in the context of the overall library.
    • Modified (3-clause) BSD License: Applies to the TurboJPEG API library, associated programs, and the build system. Because the TurboJPEG API wraps the libjpeg API, both the IJG License and the Modified BSD License apply when using the TurboJPEG API.
  5. Comply with libjpeg-turbo licensing when distributing binaries or statically linked applications

    master

    If you are distributing only libjpeg-turbo binaries (without source) or an application that statically links with libjpeg-turbo, you must fulfill these documentation requirements:

    1. IJG Attribution: Your product documentation must include the following message: This software is based in part on the work of the Independent JPEG Group.
    2. TurboJPEG API Attribution: If your binary distribution includes or uses the TurboJPEG API, your product documentation must also include the full text of the Modified (3-clause) BSD License.
  6. Dependencies for image support and networking

    master

    To use the full feature set of the library, ensure the following dependencies are met:

    • Networking: The distributed PSR code uses sockets for client-server communication, supported via Boost (tested with version 1.80.0).
    • Image I/O: To read/write images, you must install zlib, png, and jpg libraries. The Makefile expects header files in /usr/local/include/ and library files in /usr/local/lib/.
  7. Fit and evaluate functions with PointInterpolant

    master

    Use PointInterpolant to fit a function to a set of samples, and AdaptiveTreeVisualization to evaluate that function at specific points.

    1. Fitting: Use PointInterpolant with --inValues (samples) and --tree (output tree file).
    2. Evaluation: Use AdaptiveTreeVisualization with --in (the tree file) and --samples (evaluation points).
  8. Interface with the Poisson Reconstruction library

    master

    The reconstruction code can be interfaced via Reconstructors.h and Extrapolator.h. To use the library, you must choose a finite element type and define three specific data streams by overriding virtual classes.

    1. Define Finite Element Types

    Reconstruction requires template parameters for the floating point type (Real, typically float) and the dimension (Dim, fixed at 3).

    • FEMSig: Describes the 1D finite element type. It is a composite of the Degree (integer) and BoundaryType (one of BOUNDARY_FREE, BOUNDARY_DIRICHLET, or BOUNDARY_NEUMANN defined in BSplineData.h).
      static const unsigned int FEMSig = FEMDegreeAndBType< Degree , BoundaryType >::Signature;
    • FEMSigs: Describes the tensor-product finite element type (typically isotropic).
      using FEMSigs = IsotropicUIntPack< Dim , FEMSig >; 

    2. Implement Data Streams

    You must implement the following three stream classes by overriding their virtual methods:

    Input Sample Stream

    Derive from InputSampleStream< Real , Dim >. Overrides:

    • void reset(): Resets the stream to the start (required for the two-pass reconstruction process).
    • bool read( Point< Real , Dim > &p , Point< Real , Dim > &n ): Reads the next position/normal pair. Returns true if successful, false at end-of-stream.

    Output Polygon Stream

    Derive from OutputPolygonStream. Overrides:

    • size_t size(): Returns the number of polygons written.
    • size_t write( const std::vector< node_index_type > &polygon ): Writes a polygon as a vector of integral indices. Returns the index of the written polygon.

    Output Vertex Stream

    Derive from OutputVertexStream< Real , Dim >. Overrides:

    • size_t size(): Returns the number of vertices written.
    • size_t write( Point< Real , Dim > p , Point< Real , Dim > g , Real w ): Writes vertex position p, gradient g, and density weight w. Returns the index of the written vertex.
  9. Compile Adaptive Multigrid Solvers with specific FEM settings

    master

    For maximum efficiency, the code is optimized to compile for a specific FEM degree and boundary condition. By default, DEFAULT_FEM_DEGREE is set to 1 and DEFAULT_FEM_BOUNDARY is set to Neumann in PoissonRecon.h.

    To support varying FEM degrees and boundary conditions at runtime, you must #undef the FAST_COMPILE pre-processor definition in PreProcess.h. Note that this will significantly increase compilation time.

  10. Comply with libjpeg-turbo licensing when distributing source code

    master

    If you are distributing a modified version of the libjpeg-turbo source code, you must adhere to the following requirements:

    1. Preserve Notices: Do not alter or remove any existing copyright or license notices from the source.
    2. Add Modifications: You must add your own copyright notice to the header of every source file you have modified. If the file lacks a copyright header, add a notice stating that you modified the file.
    3. Include IJG README: You must include the README.ijg file in your distribution and must not alter any copyright or license text within it.
  11. Use PoissonRecon to reconstruct a triangle mesh

    master

    The PoissonRecon tool reconstructs a triangle mesh from a set of oriented 3D points by solving a Poisson system.

    Input Formats for --in

    • .ply: Must contain oriented vertices with position properties x, y, z and normal properties nx, ny, nz.
    • .bnpts: A binary file consisting of blocks of six 32-bit floats: x, y, z (position) followed by nx, ny, nz (normal).
    • ASCII: An ASCII file with groups of six white-space delimited numbers: x, y, z (position) followed by nx, ny, nz (normal).

    Common CLI Arguments

    • --in <input points>: Path to the input point set.
    • --out <output triangle mesh>: Path to the output PLY file.
    • --envelope <constraint envelope>: (Optional) A water-tight PLY triangle mesh used as a constraint. Normals must point outside the reconstructed surface.
    • --depth <reconstruction depth>: Maximum octree depth (default: 8).
    • --width <finest cell width>: Target width of the finest level octree cells (ignored if --depth is used).
    • --scale <scale factor>: Ratio between the reconstruction cube diameter and the samples' bounding cube diameter (default: 1.1).
    • --samplesPerNode <minimum number of samples>: Minimum samples per octree node. Use 1.0 - 5.0 for noise-free samples, or 15.0 - 20.0 for noisy samples (default: 1.5).
    • --colors: Enables color interpolation if input points (ASCII/binary) contain color values (9 floats per sample instead of 6).