Compare commits

...
71 Commits
Author SHA1 Message Date
Alec Jacobson 7db992a7be fix constraint weirdness 2020-06-05 12:37:26 -04:00
Alec Jacobson 5c5eddcd55 exploded view of tetrahedral meshes 2020-05-08 09:08:54 -04:00
Alec Jacobson e14a3bd0a1 Merge pull request #1509 from libigl/is-edge-manifold-refactor
Remove duplicate implementation of is_edge_manifold
2020-05-08 08:52:08 -04:00
Alec Jacobson 72f0b5844b templates 2020-05-08 00:48:46 -04:00
Alec Jacobson 7e70dfbbff add changes back 2020-05-07 22:18:53 -04:00
Alec Jacobson 5b11835be1 Revert "refactor to remove duplicate (slower) implementation"
This reverts commit 829eaa54b6.
2020-05-07 22:07:29 -04:00
Alec Jacobson 829eaa54b6 refactor to remove duplicate (slower) implementation 2020-05-07 21:57:35 -04:00
Alec Jacobson d402d94959 missing namespace 2020-05-05 17:36:51 -04:00
Jérémie Dumas 60ea43092c Add issue template for code compilation. 2020-05-03 09:32:42 -07:00
Jérémie Dumas 03e65b95ca Fix Nightly CI. 2020-05-03 00:03:20 -07:00
Kobi1997 04457f1eae Add missing IGL_INLINE in scaf.cpp (#1494) 2020-05-02 15:51:20 -07:00
Alec JacobsonandJérémie Dumas 29b75796b2 Matcaps (material captures aka environment maps) in Viewer (#1482)
* matcap from texture, default normal image matcap

* update grid_texture() to generate checkerboard texture, but without UVs

Co-authored-by: Jérémie Dumas <jeremie.dumas@ens-lyon.org>
2020-05-02 13:04:38 -07:00
Jérémie Dumas 6664ffef18 Fix CI build on Windows. (#1495) 2020-05-02 12:56:39 -07:00
Alec Jacobson 7ae4fb1fc1 Merge pull request #1487 from libigl/connected_components
Connected components
2020-04-19 15:36:07 -04:00
Jérémie Dumas 2cd50a8bc8 More Eigen::Index goodness. 2020-04-19 11:10:14 -07:00
Alec Jacobson 78a212d4ca int type 2020-04-19 13:46:31 -04:00
Alec Jacobson 215994dc07 missing implementation 2020-04-19 13:31:03 -04:00
Alec Jacobson e88249f68d rm debug assert 2020-04-19 13:30:41 -04:00
Alec Jacobson 1f4a27e73c Merge pull request #1488 from libigl/wire_mesh
per-edge thicknesses, coplanar test and templates
2020-04-19 13:26:52 -04:00
Alec Jacobson f2cc26f284 Merge pull request #1476 from libigl/bezier
Bézier curve evaluation and fit cubic Bézier spline to stream of points
2020-04-19 12:39:02 -04:00
Alec Jacobson 8e35d87991 per-edge thicknesses, coplanar test and templates 2020-04-18 22:15:58 -04:00
Alec Jacobson 4516d19268 template 2020-04-18 21:16:54 -04:00
Alec Jacobson 80e763d372 Merge pull request #1484 from libigl/templates
templates
2020-04-18 20:28:58 -04:00
Alec Jacobson 7798748774 connected components and better facet_components 2020-04-18 20:25:24 -04:00
Alec Jacobson 1aa35de249 passing facet_components unit test 2020-04-18 20:25:24 -04:00
Alec Jacobson 5a6e3125f3 templates 2020-04-17 11:51:44 -04:00
Alec Jacobson 18c5a9ddf0 Merge branch 'master' of https://github.com/libigl/libigl into bezier 2020-04-17 11:45:07 -04:00
Alec Jacobson 8f33348c29 bug fix (set true for all cores) 2020-04-17 11:44:51 -04:00
Jérémie Dumas c47f1dab9b Comment FPE for now. (#1477) 2020-04-15 14:41:07 -07:00
Alec Jacobson 6f5fadd154 static + capture by reference = bad idea 2020-04-13 22:41:35 -04:00
Alec Jacobson a6ca070009 Merge pull request #1479 from libigl/jdumas/issues
Update issue templates
2020-04-13 10:12:03 -04:00
Alec Jacobson e8b2170dd3 Merge pull request #1480 from libigl/double-sided-lighting
Toggle double sided lighting
2020-04-12 20:23:10 -04:00
Jérémie Dumas b632972487 Make double_sided a bool option. 2020-04-12 14:16:09 -07:00
Alec Jacobson 9fa54a0398 double sided lighting 2020-04-12 16:01:29 -04:00
Jérémie Dumas 0c5bb13883 Update issue templates
Update templates.

Update templates.

Update templates.

Update templates.

Rename.

Copy.

Update.
2020-04-12 09:45:01 -07:00
tamasmeszaros 651fc234cd Fixes build with mingw-w64 (#1335) 2020-04-11 20:29:44 -07:00
Alec Jacobson 4ca4f8b341 support closed loops 2020-04-11 20:21:19 -04:00
Alec Jacobson 4ab389d462 bezier eval and fit cubic bezier splin 2020-04-11 19:54:29 -04:00
Alec Jacobson c16bc37fcb missing include 2020-04-11 19:50:51 -04:00
Alec Jacobson 1ad57f019c Templates (#1475)
* templates, comments and templatefixes

* linux doesn't like __sFile

* more templates
2020-04-11 16:00:41 -07:00
Jérémie Dumas 698c316159 Merge pull request #1474 from libigl/jdumas/clone-depth
Update clone depth.
2020-04-11 12:49:49 -07:00
Alec JacobsonandJérémie Dumas faaae91419 Fix bug in signed_distance for 2D (#1400)
* Fix bug in signed_distance for 2D

* another bug fix

* missing templates

* overzealous no-op templating

* another bug... and a test.

* uncomment lines in test; templates

* Update per_edge_normals.cpp

* Update signed_distance.cpp

Co-authored-by: Jérémie Dumas <jdumas@users.noreply.github.com>
2020-04-11 12:14:12 -07:00
Janos95andJérémie Dumas 0f557400f9 dont use floating point values to index eigen types (#1361)
* dont use floating point values to index eigen types

* only cast doubles not the whole expression

* add remaining casts

* Update cast.

Co-authored-by: Jérémie Dumas <jeremie.dumas@ens-lyon.org>
2020-04-11 12:13:03 -07:00
Mathieu Lamarre df5b320f57 Fix compilation error in face_occurrences.cpp (#1402)
* Fix compilation error

When IntegerC is long long int with gcc 7.4
2020-04-11 11:48:07 -07:00
Jérémie Dumas a90a67bdf2 Update clone depth. 2020-04-11 11:44:23 -07:00
Jérémie Dumas a203de97aa Update pull_request_template.md (#1348)
* Update pull_request_template.md
2020-04-11 11:33:34 -07:00
Thomas Auzinger 4827b40640 Extended serialization functionality to Eigen::Array. (#1113)
* Extended serialization functionality to Eigen::Array.
2020-04-11 11:29:14 -07:00
Kacper Pluta f029832904 Add extra exceptions for arithmetic and types operations (#1001)
* This PR allows for extra exceptions in the debug mode (GCC/LLVM) on Linux based OSes - it does not work on the other operating systems.
Relevant documentation: https://linux.die.net/man/3/feenableexcept
2020-04-11 11:16:51 -07:00
Nico 7576c3b8ad fix align_camera_center in Viewer::init() for multiple cores (#1349)
* Iterate over viewer.core_list and viewer.data_list and align_camera_center per core with visible data.
2020-04-11 11:04:26 -07:00
Alec Jacobson 10dc1fd9f8 Merge pull request #1422 from vfonov/tinyply_reader_writer
Replace .ply reader/writer with tinyply library
2020-04-11 13:43:54 -04:00
AdithyaPediredla 546452da5a Bug fix in csvreads. (Bug #1423) (#1430)
* Bug fix in csvreads.
2020-04-11 10:24:12 -07:00
Raymond Yun Fei c1c88fd78b numeric_limits<double>::min() is the minimal positive number (#1438)
Fixes #1411
2020-04-11 10:22:27 -07:00
Vladimir S. FONOV c907add524 Fixes stack overwriting bug in gl::is_stl, when file have binary data (#1431)
* Fixes stack overwriting bug in gl::is_stl, when file have binary data
detected by running with ASAN in all_meshes test
2020-04-11 10:21:32 -07:00
Jérémie Dumas 726cd540c3 Delete .travis.yml 2020-04-11 10:08:56 -07:00
Christoffer Green b9093020ab Apply patch for 32-bit support (#1471)
Fixes #1095 and #1047
2020-04-11 10:00:44 -07:00
Jérémie Dumas 021ec6f946 Dot not build tutorials in Debug mode. (#1473)
* Dot not build tutorials in Debug mode.

Fix script.

Limit num of parallel jobs on Windows Nighlty.

Update job matrix.

Update job matrix.

Update job matrix.

Rename jobs.

* Limit branches that triggers a CI build.

* Restore original name.
2020-04-11 09:57:38 -07:00
Jérémie Dumas b550323ef0 Merge pull request #1441 from BruegelN/fix-average_onto_faces-namespace
Added igl namespace average_onto_faces.cpp
2020-04-11 09:27:41 -07:00
Nico Brügel 5c7298c2fc Added igl:: to average_onto_faces.
Might resolve https://github.com/libigl/libigl-python-bindings/issues/35
2020-04-09 00:29:56 +02:00
Jérémie Dumas 5239d12eb3 Update README.md (#1470) 2020-04-08 15:27:45 -07:00
Jérémie Dumas 01466e5bd6 Update README.md (#1469) 2020-04-08 15:23:05 -07:00
Alec Jacobson 3cb4894eaf Merge pull request #1468 from libigl/dev
Build / Linux (Release, OFF) (push) Waiting to run
Build / Linux (Release, ON) (push) Waiting to run
Build / macOS (Release, OFF) (push) Waiting to run
Build / macOS (Release, ON) (push) Waiting to run
Build / Windows (Release, OFF) (push) Waiting to run
Build / Windows (Release, ON) (push) Waiting to run
Release 2.2
2020-04-08 17:57:08 -04:00
Alec Jacobson 62b3350271 Merge pull request #1389 from jdumas/jdumas/github-actions
Enable GitHub Actions for continuous integration
2020-04-08 17:48:13 -04:00
Vladimir S. FONOV 52c6f14ca6 Replace .ply reader/writer with tinyply library, supersedes libigl/libigl#1235
Updated SHA for libigl-tests-data
removed obsolete ply.h
updated tinyply to compile with and without LIBIGL_USE_STATIC_LIBRARY
fixed template instantiation signatures to work with gcc
fixed integer classes for visual studio
fixed igl::tynyply_type redefinition
added command to install ccache in .travis.yml
added test for writePLY
changed asserts inside writePLY code
fixed some bugs in writePLY code
made PLY reader/writer work with quad meshes
made PLY reader/writer work with tristrips
2020-03-24 18:15:36 -04:00
allo- 4ce917d424 Issue 521 (#1327)
* Added unit test for issue #521

Unit test adapted from https://github.com/qnzhou/libigl-unit-tests/blob/master/include/igl/delaunay_triangulation.cpp

* Fix iterator out of range error in lexicographic_triangulation (closes #521)

The iterator is now always decreased, so it points to the current left
side of the triangulation again after erasing the current item.
When the iterator is at the beginning of the boundary, it needs to point
to the last element (boundary.end()-1) after decreasing, so we have to
decrease the iterator in all cases.

In addition, the line
    if (itr == left_itr || itr == right_itr) continue;
is simplified to
    if (itr == left_itr) continue;

because the condition itr == right_itr will never be hit, because the
line before breaks the loop, when itr == right_itr:
    if (itr == right_itr) break;
2020-02-29 18:19:52 -05:00
Qingnan ZhouandJérémie Dumas 26053f696c Avoid involving Eigen/SparseExtra in slice. (#1370)
* Avoid involving Eigen/SparseExtra in slice.

* Undo merging error...

* Remove more deprecated DynamicSparseMatrix in slice.

* Typo.

* Avoid narrowing error in initializer list.

* Cleanup igl::slice, add igl::slice_sorted, add unit test and benchmarks + update Catch2.

* Missing template.

* Template for Windows.

Co-authored-by: Jérémie Dumas <jdumas@users.noreply.github.com>
2020-02-16 22:31:06 -05:00
Alec Jacobson 92b25d30a8 Templates (mostly single-precision float types) (#1396)
* templates

* fix file template

* windows template

* more windows templates
2020-02-16 16:33:13 -05:00
teseoch 87bfaeeba8 Templates and other fixes for python bindings (#1379)
* face occurences fixed

* flipped_triangles templates

* templates

* extract_manifold_patches templates

* normal_derivative templates

* orient_outward snap_points
2020-02-16 16:27:52 -05:00
Alec Jacobson 79e7a05b16 Fix bug in https://github.com/libigl/libigl/issues/1204 2020-02-14 11:59:07 -05:00
Alec Jacobson 87b54fc4dc Update voxel_grid.h 2020-01-01 19:53:08 -05:00
Jérémie Dumas d3052ef4c7 Replace IGL_DEBUG_OFF with a [slow] tag for now. 2019-12-19 15:45:56 -05:00
Jérémie Dumas 252017af44 Add workflows for GitHub Actions + misc fixes.
- Fixes #1229 by defaulting to static MSVC runtime on Windows.
- CMake will now fail if LIBIGL_WITH_CGAL is ON but CGAL is not found
  (e.g. missing Boost or gmp/mpfr).
- Removed some duplicated template instantiations on Windows.
- Added IGL_DEBUG_OFF to disable slow unit test in Debug configuration
  by default.
- Do not FORCE options given to third-party libraries.
2019-12-19 15:19:32 -05:00
163 changed files with 5608 additions and 4659 deletions
-34
View File
@@ -1,34 +0,0 @@
version: 1.0.{build}
os: Visual Studio 2017
platform: x64
clone_folder: C:\projects\libigl
shallow_clone: true
branches:
only:
- master
- dev
environment:
matrix:
- CONFIG: Debug
BOOST_ROOT: C:/Libraries/boost_1_65_1
- CONFIG: Release
BOOST_ROOT: C:/Libraries/boost_1_65_1
build:
parallel: true
build_script:
- cd c:\projects\libigl
# Tutorials and tests
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=%CONFIG%
-DLIBIGL_WITH_CGAL=ON
-DLIBIGL_WITH_COMISO=OFF
-G "Visual Studio 15 2017 Win64"
../
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- set MSBuildOptions=/v:m /m /p:BuildInParallel=true /p:Configuration=%CONFIG% /logger:%MSBuildLogger%
- msbuild %MSBuildOptions% libigl.sln
test_script:
- set CTEST_OUTPUT_ON_FAILURE=1
- ctest -C %CONFIG% --verbose --output-on-failure -j 2
+17
View File
@@ -0,0 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug, pending verification
assignees: ''
---
#### Describe the bug
A clear and concise description of what the bug is.
#### Check all that apply (change to `[x]`)
- [ ] Windows
- [ ] macOS
- [ ] Linux
+17
View File
@@ -0,0 +1,17 @@
---
name: Compilation issue
about: Report a problem when compiling the code
title: ''
labels: 'compilation'
assignees: ''
---
#### Describe your question
...
#### Check all that apply (change to `[x]`)
- [ ] Windows
- [ ] macOS
- [ ] Linux
+1
View File
@@ -0,0 +1 @@
blank_issues_enabled: false
+17
View File
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'enhancement'
assignees: ''
---
#### Describe your feature request
...
#### Check all that apply (change to `[x]`)
- [ ] Windows
- [ ] macOS
- [ ] Linux
+17
View File
@@ -0,0 +1,17 @@
---
name: Question
about: Ask question about the tutorial or documentation
title: ''
labels: 'question'
assignees: ''
---
#### Describe your question
...
#### Check all that apply (change to `[x]`)
- [ ] Windows
- [ ] macOS
- [ ] Linux
-11
View File
@@ -1,11 +0,0 @@
#### Describe your issue
...
#### Check all that apply (change to `[x]`)
- [ ] Windows
- [ ] Mac OS X
- [ ] Linux
- [ ] I have tried the `dev` branch and the problem persists
See https://libigl.github.io/CONTRIBUTING/#bugreport for more tips.
+3 -1
View File
@@ -1,8 +1,10 @@
Fixes # .
[Describe your changes and what you've already done to test it.]
#### Check all that apply (change to `[x]`)
- [ ] All changes meet [libigl style-guidelines](https://libigl.github.io/style-guidelines/).
- [ ] Adds new .cpp file.
- [ ] Adds corresponding unit test.
- [ ] Adds corresponding python binding.
- [ ] This is a minor change.
+149
View File
@@ -0,0 +1,149 @@
name: Build
on:
push:
branches:
- master
- stable
pull_request:
branches:
- master
- stable
env:
CTEST_OUTPUT_ON_FAILURE: ON
CTEST_PARALLEL_LEVEL: 2
jobs:
####################
# Linux / macOS
####################
Unix:
name: ${{ matrix.name }} (${{ matrix.config }}, ${{ matrix.static }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, macos-latest]
config: [Release]
static: [ON, OFF]
include:
- os: macos-latest
name: macOS
- os: ubuntu-18.04
name: Linux
env:
LIBIGL_NUM_THREADS: 1 # See https://github.com/libigl/libigl/pull/996
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 10
- name: Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install \
libblas-dev \
libboost-filesystem-dev \
libboost-system-dev \
libboost-thread-dev \
libglu1-mesa-dev \
liblapack-dev \
libmpfr-dev \
xorg-dev \
ccache
- name: Dependencies (macOS)
if: runner.os == 'macOS'
run: brew install boost gmp mpfr ccache
- name: Cache Build
id: cache-build
uses: actions/cache@v1
with:
path: ~/.ccache
key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.static }}-cache
- name: Prepare ccache
run: |
ccache --max-size=1.0G
ccache -V && ccache --show-stats && ccache --zero-stats
- name: Configure
run: |
mkdir -p build
cd build
cmake .. \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=${{ matrix.config }} \
-DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.static }} \
-DLIBIGL_WITH_CGAL=ON \
-DLIBIGL_WITH_COMISO=ON
- name: Build
run: cd build; make -j2; ccache --show-stats
- name: Tests
run: cd build; ctest --verbose
####################
# Windows
####################
Windows:
runs-on: windows-2019
env:
CC: cl.exe
CXX: cl.exe
strategy:
fail-fast: false
matrix:
config: [Release]
static: [ON, OFF]
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 10
- uses: seanmiddleditch/gha-setup-ninja@master
# https://github.com/actions/cache/issues/101
- name: Set env
run: |
echo "::set-env name=appdata::$($env:LOCALAPPDATA)"
echo "::set-env name=BOOST_ROOT::$env:BOOST_ROOT_1_69_0"
- name: Cache build
id: cache-build
uses: actions/cache@v1
with:
path: ${{ env.appdata }}\Mozilla\sccache
key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.static }}-cache
- name: Prepare sccache
run: |
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
scoop install sccache --global
# Scoop modifies the PATH so we make the modified PATH global.
echo "::set-env name=PATH::$env:PATH"
# We run configure + build in the same step, since they both need to call VsDevCmd
# Also, cmd uses ^ to break commands into multiple lines (in powershell this is `)
- name: Configure and build
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
cmake -G Ninja ^
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
-DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.static }} ^
-DLIBIGL_WITH_CGAL=ON ^
-DLIBIGL_WITH_COMISO=OFF ^
-B build ^
-S .
cmake --build build
- name: Tests
run: cd build; ctest --verbose
+190
View File
@@ -0,0 +1,190 @@
name: Nightly
on:
schedule:
- cron: '0 4 * * *'
env:
CTEST_OUTPUT_ON_FAILURE: ON
CTEST_PARALLEL_LEVEL: 2
jobs:
####################
# Linux / macOS
####################
# Part of this file is inspired from
# https://github.com/onqtam/doctest/blob/dev/.github/workflows/main.yml
Unix:
name: ${{ matrix.name }} (${{ matrix.config }}, Static=${{ matrix.static }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [
ubuntu-18.04-gcc-7,
ubuntu-18.04-gcc-8,
ubuntu-18.04-gcc-9,
ubuntu-18.04-clang-7,
ubuntu-18.04-clang-8,
ubuntu-18.04-clang-9,
macOS-latest,
]
config: [Debug, Release]
static: [ON, OFF]
include:
- name: ubuntu-18.04-gcc-7
os: ubuntu-18.04
compiler: gcc
version: "7"
- name: ubuntu-18.04-gcc-8
os: ubuntu-18.04
compiler: gcc
version: "8"
- name: ubuntu-18.04-gcc-9
os: ubuntu-18.04
compiler: gcc
version: "9"
- name: ubuntu-18.04-clang-7
os: ubuntu-18.04
compiler: clang
version: "7"
- name: ubuntu-18.04-clang-8
os: ubuntu-18.04
compiler: clang
version: "8"
- name: ubuntu-18.04-clang-9
os: ubuntu-18.04
compiler: clang
version: "9"
- name: macOS-latest
os: macOS-latest
# Build tutorials for most configurations
- tutorials: ON
# Except with Debug mode
- config: Debug
tutorials: OFF
env:
LIBIGL_NUM_THREADS: 1 # See https://github.com/libigl/libigl/pull/996
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 10
- name: Dependencies (Linux)
if: runner.os == 'Linux'
run: |
# LLVM 9 is not in Bionic's repositories so we add the official LLVM repository.
if [ "${{ matrix.compiler }}" = "clang" ] && [ "${{ matrix.version }}" = "9" ]; then
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main"
fi
sudo apt-get update
if [ "${{ matrix.compiler }}" = "gcc" ]; then
sudo apt-get install -y g++-${{ matrix.version }}
echo "::set-env name=CC::gcc-${{ matrix.version }}"
echo "::set-env name=CXX::g++-${{ matrix.version }}"
else
sudo apt-get install -y clang-${{ matrix.version }}
echo "::set-env name=CC::clang-${{ matrix.version }}"
echo "::set-env name=CXX::clang++-${{ matrix.version }}"
fi
sudo apt-get install \
libblas-dev \
libboost-filesystem-dev \
libboost-system-dev \
libboost-thread-dev \
libglu1-mesa-dev \
liblapack-dev \
libmpfr-dev \
xorg-dev
- name: Dependencies (macOS)
if: runner.os == 'macOS'
run: brew install boost gmp mpfr
- name: Configure
run: |
mkdir -p build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${{ matrix.config }} \
-DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.static }} \
-DLIBIGL_BUILD_TUTORIALS=${{ matrix.tutorials }} \
-DLIBIGL_WITH_CGAL=ON \
-DLIBIGL_WITH_COMISO=ON
- name: Free Disk Space
if: runner.os == 'Linux'
run: |
sudo swapoff -a
sudo apt clean
sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc
df -h
- name: Build
run: cd build; make -j2
- name: Tests
run: cd build; ctest --verbose
####################
# Windows
####################
Windows:
name: Windows (${{ matrix.config }}, Static=${{ matrix.static }})
runs-on: windows-2019
env:
CC: cl.exe
CXX: cl.exe
strategy:
fail-fast: false
matrix:
config: [Debug, Release]
static: [ON, OFF]
include:
- config: Debug
tutorials: OFF
- config: Release
tutorials: ON
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 10
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Set env
run: |
echo "::set-env name=BOOST_ROOT::$env:BOOST_ROOT_1_69_0"
# We run configure + build in the same step, since they both need to call VsDevCmd
# Also, cmd uses ^ to break commands into multiple lines (in powershell this is `)
- name: Configure and build
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x64
cmake -G Ninja ^
-DCMAKE_BUILD_TYPE=${{ matrix.config }} ^
-DLIBIGL_USE_STATIC_LIBRARY=${{ matrix.static }} ^
-DLIBIGL_BUILD_TUTORIALS=${{ matrix.tutorials }} ^
-DLIBIGL_WITH_CGAL=ON ^
-DLIBIGL_WITH_COMISO=OFF ^
-B build ^
-S .
cmake --build build -j 2
- name: Tests
run: cd build; ctest --verbose
-72
View File
@@ -1,72 +0,0 @@
dist: trusty
sudo: true
language: cpp
cache: ccache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-7
- gcc-7
- libblas-dev
- libboost-filesystem-dev
- libboost-system-dev
- libboost-thread-dev
- libglu1-mesa-dev
- liblapack-dev
- libmpfr-dev
- xorg-dev
homebrew:
packages:
- ccache
matrix:
include:
- os: linux
compiler: gcc # 4.8.4 by default on Trusty
env:
- MATRIX_EVAL="export CONFIG=Release"
- os: linux
compiler: gcc-7
env:
- MATRIX_EVAL="export CC=gcc-7 CXX=g++-7 CONFIG=Release"
- os: linux # same config like above but with -DLIBIGL_USE_STATIC_LIBRARY=OFF to test static and header-only builds
compiler: gcc-7
env:
- MATRIX_EVAL="export CC=gcc-7 CXX=g++-7 CONFIG=Release CMAKE_EXTRA='-DLIBIGL_USE_STATIC_LIBRARY=OFF'"
- os: osx
osx_image: xcode10.2
compiler: clang
env:
- MATRIX_EVAL="export CONFIG=Debug LIBIGL_NUM_THREADS=1"
- os: osx # same config like above but with -DLIBIGL_USE_STATIC_LIBRARY=OFF to test static and header-only builds
osx_image: xcode10.2
compiler: clang
env:
- MATRIX_EVAL="export CONFIG=Debug LIBIGL_NUM_THREADS=1 CMAKE_EXTRA='-DLIBIGL_USE_STATIC_LIBRARY=OFF'"
- os: osx
osx_image: xcode10.2
compiler: clang
env:
- MATRIX_EVAL="export CONFIG=Debug PYTHON=python3 LIBIGL_NUM_THREADS=1 CMAKE_EXTRA='-DLIBIGL_EIGEN_VERSION=3.3.7'""
install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi
- eval "${MATRIX_EVAL}"
- ccache --max-size=5.0G
- ccache -V && ccache --show-stats && ccache --zero-stats
script:
# Tutorials and tests
- mkdir build
- pushd build
- cmake ${CMAKE_EXTRA}
-DCMAKE_BUILD_TYPE=$CONFIG
-DLIBIGL_CHECK_UNDEFINED=ON
-DLIBIGL_WITH_CGAL=ON
../
- make -j 2
- ctest --verbose
- popd
- rm -rf build
- ccache --show-stats
+4 -5
View File
@@ -1,8 +1,7 @@
# libigl - A simple C++ geometry processing library
[![Build Status](https://travis-ci.org/libigl/libigl.svg?branch=master)](https://travis-ci.org/libigl/libigl)
[![Build status](https://ci.appveyor.com/api/projects/status/mf3t9rnhco0vhly8/branch/master?svg=true)](https://ci.appveyor.com/project/danielepanozzo/libigl-6hjk1/branch/master)
![](https://github.com/libigl/libigl-legacy/raw/5ff6387765fa85ca46f1a6222728e35e2b8b8961/libigl-teaser.png)
[![](https://github.com/libigl/libigl/workflows/Build/badge.svg)](https://github.com/libigl/libigl/actions)
[![](https://anaconda.org/conda-forge/igl/badges/installer/conda.svg)](https://anaconda.org/conda-forge/igl)
![](https://libigl.github.io/libigl-teaser.png)
Documentation, tutorial, and instructions at <https://libigl.github.io>.
:exclamation: **On October 15, 2018, a new, cleaned-up history was pushed onto the main libigl repository. To learn more about the consequences of this, and troubleshooting, please read [this page](https://libigl.github.io/rewritten-history/).**
+2 -2
View File
@@ -156,7 +156,7 @@ endfunction()
function(igl_download_catch2)
igl_download_project(catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG 03d122a35c3f5c398c43095a87bc82ed44642516
GIT_TAG v2.11.0
)
endfunction()
@@ -175,7 +175,7 @@ function(igl_download_test_data)
igl_download_project_aux(test_data
"${LIBIGL_EXTERNAL}/../tests/data"
GIT_REPOSITORY https://github.com/libigl/libigl-tests-data
GIT_TAG 5994ecdab65aebc6c218c4c6f35e7822acf6fe99
GIT_TAG b5dddf45e329af685cd107e38770a28cfc18eb15
)
endfunction()
+8 -4
View File
@@ -1,8 +1,6 @@
if(MSVC)
if("${MSVC_RUNTIME}" STREQUAL "")
set(MSVC_RUNTIME "static")
endif()
if(${MSVC_RUNTIME} STREQUAL "static")
option(IGL_STATIC_RUNTIME "Use libigl with the static MSVC runtime." OFF)
if(IGL_STATIC_RUNTIME)
message(STATUS "MSVC -> forcing use of statically-linked runtime.")
foreach(config ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${config} config)
@@ -19,4 +17,10 @@ if(MSVC)
endforeach()
string(REPLACE "/MTd" "/MDd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
endif()
# https://github.com/mozilla/sccache/issues/242
if(CMAKE_CXX_COMPILER_LAUNCHER STREQUAL "sccache")
string(REGEX REPLACE "/Z[iI7]" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7")
endif()
endif()
+23 -20
View File
@@ -88,7 +88,7 @@ if(MSVC)
target_compile_definitions(igl_common INTERFACE -DNOMINMAX)
endif()
### Set compiler flags for building the tests on Windows with Visual Studio
# Controls whether to use the static MSVC runtime or not
include(LibiglWindows)
if(BUILD_SHARED_LIBS)
@@ -178,8 +178,6 @@ function(compile_igl_module module_dir)
# This one is when using bools in adjacency matrices
/wd4804 #'+=': unsafe use of type 'bool' in operation
)
else()
#target_compile_options(${module_libname} PRIVATE -w) # disable all warnings (not ideal but...)
endif()
else()
add_library(${module_libname} INTERFACE)
@@ -226,6 +224,7 @@ if(LIBIGL_WITH_CGAL)
set(CGAL_DIR "${LIBIGL_EXTERNAL}/cgal")
igl_download_cgal()
igl_download_cgal_deps()
message("BOOST_ROOT: ${BOOST_ROOT}")
if(EXISTS ${LIBIGL_EXTERNAL}/boost)
set(BOOST_ROOT "${LIBIGL_EXTERNAL}/boost")
endif()
@@ -239,7 +238,7 @@ if(LIBIGL_WITH_CGAL)
compile_igl_module("cgal")
target_link_libraries(igl_cgal ${IGL_SCOPE} CGAL::CGAL CGAL::CGAL_Core)
else()
set(LIBIGL_WITH_CGAL OFF CACHE BOOL "" FORCE)
message(FATAL_ERROR "Could not define CGAL::CGAL and CGAL::CGAL_Core.")
endif()
endif()
@@ -299,20 +298,19 @@ endif()
if(LIBIGL_WITH_EMBREE)
set(EMBREE_DIR "${LIBIGL_EXTERNAL}/embree")
set(EMBREE_TESTING_INTENSITY 0 CACHE STRING "" FORCE)
set(EMBREE_ISPC_SUPPORT OFF CACHE BOOL " " FORCE)
set(EMBREE_TASKING_SYSTEM "INTERNAL" CACHE BOOL " " FORCE)
set(EMBREE_TUTORIALS OFF CACHE BOOL " " FORCE)
set(EMBREE_MAX_ISA "SSE2" CACHE STRING " " FORCE)
set(EMBREE_STATIC_LIB ON CACHE BOOL " " FORCE)
if(MSVC)
set(EMBREE_STATIC_RUNTIME ON CACHE BOOL " " FORCE)
endif()
if(NOT TARGET embree)
# TODO: Should probably save/restore the CMAKE_CXX_FLAGS_*, since embree seems to be
# overriding them on Windows. But well... it works for now.
igl_download_embree()
set(EMBREE_TESTING_INTENSITY 0 CACHE STRING "")
set(EMBREE_ISPC_SUPPORT OFF CACHE BOOL " ")
set(EMBREE_TASKING_SYSTEM "INTERNAL" CACHE BOOL " ")
set(EMBREE_TUTORIALS OFF CACHE BOOL " ")
set(EMBREE_MAX_ISA "SSE2" CACHE STRING " ")
set(EMBREE_STATIC_LIB ON CACHE BOOL " ")
if(MSVC)
set(EMBREE_STATIC_RUNTIME ${IGL_STATIC_RUNTIME} CACHE BOOL "Use the static version of the C/C++ runtime library.")
endif()
add_subdirectory("${EMBREE_DIR}" "embree" EXCLUDE_FROM_ALL)
endif()
@@ -374,11 +372,16 @@ if(LIBIGL_WITH_OPENGL_GLFW)
# GLFW module
compile_igl_module("opengl/glfw")
if(NOT TARGET glfw)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL " " FORCE)
set(GLFW_BUILD_DOCS OFF CACHE BOOL " " FORCE)
set(GLFW_INSTALL OFF CACHE BOOL " " FORCE)
igl_download_glfw()
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF)
option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF)
option(GLFW_BUILD_DOCS "Build the GLFW documentation" OFF)
option(GLFW_INSTALL "Generate installation target" OFF)
if(IGL_STATIC_RUNTIME)
set(USE_MSVC_RUNTIME_LIBRARY_DLL OFF CACHE BOOL "Use MSVC runtime library DLL" FORCE)
else()
set(USE_MSVC_RUNTIME_LIBRARY_DLL ON CACHE BOOL "Use MSVC runtime library DLL" FORCE)
endif()
add_subdirectory(${LIBIGL_EXTERNAL}/glfw glfw)
endif()
target_link_libraries(igl_opengl_glfw ${IGL_SCOPE} igl_opengl glfw)
+9 -13
View File
@@ -1,5 +1,5 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
@@ -26,34 +26,30 @@ namespace igl
SortableRow(const T & data):data(data){};
bool operator<(const SortableRow & that) const
{
// Get reference so that I can use parenthesis
const SortableRow<T> & THIS = *this;
// Lexicographical
int minc = (THIS.data.size() < that.data.size()?
THIS.data.size() : that.data.size());
int minc = (this->data.size() < that.data.size()?
this->data.size() : that.data.size());
// loop over columns
for(int i = 0;i<minc;i++)
{
if(THIS.data(i) == that.data(i))
if(this->data(i) == that.data(i))
{
continue;
}
return THIS.data(i) < that.data(i);
return this->data(i) < that.data(i);
}
// All characters the same, comes done to length
return THIS.data.size()<that.data.size();
return this->data.size()<that.data.size();
};
bool operator==(const SortableRow & that) const
{
// Get reference so that I can use parenthesis
const SortableRow<T> & THIS = *this;
if(THIS.data.size() != that.data.size())
if(this->data.size() != that.data.size())
{
return false;
}
for(int i = 0;i<THIS.data.size();i++)
for(int i = 0;i<this->data.size();i++)
{
if(THIS.data(i) != that.data(i))
if(this->data(i) != that.data(i))
{
return false;
}
+24 -14
View File
@@ -108,6 +108,12 @@ IGL_INLINE igl::SolverStatus igl::active_set(
Matrix<BOOL,Dynamic,1> as_ux = Matrix<BOOL,Dynamic,1>::Constant(n,1,FALSE);
Matrix<BOOL,Dynamic,1> as_ieq = Matrix<BOOL,Dynamic,1>::Constant(Aieq.rows(),1,FALSE);
Matrix<BOOL,Dynamic,1> fixed = Matrix<BOOL,Dynamic,1>::Constant(n,1,FALSE);
for(int k = 0;k<known.size();k++)
{
fixed[known(k)] = TRUE;
}
// Keep track of previous Z for comparison
DerivedZ old_Z;
old_Z = DerivedZ::Constant(
@@ -128,17 +134,21 @@ IGL_INLINE igl::SolverStatus igl::active_set(
{
for(int z = 0;z < n;z++)
{
if(Z(z) < lx(z))
// only check non-fixed values
if(!fixed(z))
{
new_as_lx += (as_lx(z)?0:1);
//new_as_lx++;
as_lx(z) = TRUE;
}
if(Z(z) > ux(z))
{
new_as_ux += (as_ux(z)?0:1);
//new_as_ux++;
as_ux(z) = TRUE;
if(Z(z) < lx(z))
{
new_as_lx += (as_lx(z)?0:1);
//new_as_lx++;
as_lx(z) = TRUE;
}
if(Z(z) > ux(z))
{
new_as_ux += (as_ux(z)?0:1);
//new_as_ux++;
as_ux(z) = TRUE;
}
}
}
if(Aieq.rows() > 0)
@@ -253,11 +263,11 @@ IGL_INLINE igl::SolverStatus igl::active_set(
#ifndef NDEBUG
{
// NO DUPES!
Matrix<BOOL,Dynamic,1> fixed = Matrix<BOOL,Dynamic,1>::Constant(n,1,FALSE);
Matrix<BOOL,Dynamic,1> fixed_i = Matrix<BOOL,Dynamic,1>::Constant(n,1,FALSE);
for(int k = 0;k<known_i.size();k++)
{
assert(!fixed[known_i(k)]);
fixed[known_i(k)] = TRUE;
assert(!fixed_i[known_i(k)]);
fixed_i[known_i(k)] = TRUE;
}
}
#endif
@@ -345,7 +355,7 @@ IGL_INLINE igl::SolverStatus igl::active_set(
{
if(Lambda_Aieq_i(a) < params.inactive_threshold)
{
as_ieq(as_ieq_list(a)) = FALSE;
as_ieq(int(as_ieq_list(a))) = FALSE;
}
}
+1 -1
View File
@@ -8,7 +8,7 @@
#include "average_onto_faces.h"
template <typename DerivedF, typename DerivedS, typename DerivedSF>
IGL_INLINE void average_onto_faces(
IGL_INLINE void igl::average_onto_faces(
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedS> & S,
Eigen::PlainObjectBase<DerivedSF> & SF)
+74
View File
@@ -0,0 +1,74 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2020 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "bezier.h"
#include <cassert>
// Adapted from main.c accompanying
// An Algorithm for Automatically Fitting Digitized Curves
// by Philip J. Schneider
// from "Graphics Gems", Academic Press, 1990
template <typename DerivedV, typename DerivedP>
IGL_INLINE void igl::bezier(
const Eigen::MatrixBase<DerivedV> & V,
const typename DerivedV::Scalar t,
Eigen::PlainObjectBase<DerivedP> & P)
{
// working local copy
DerivedV Vtemp = V;
int degree = Vtemp.rows()-1;
/* Triangle computation */
for (int i = 1; i <= degree; i++)
{
for (int j = 0; j <= degree-i; j++)
{
Vtemp.row(j) = ((1.0 - t) * Vtemp.row(j) + t * Vtemp.row(j+1)).eval();
}
}
P = Vtemp.row(0);
}
template <typename DerivedV, typename DerivedT, typename DerivedP>
IGL_INLINE void igl::bezier(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedT> & T,
Eigen::PlainObjectBase<DerivedP> & P)
{
P.resize(T.size(),V.cols());
for(int i = 0;i<T.size();i++)
{
Eigen::Matrix<typename DerivedV::Scalar,1,DerivedV::ColsAtCompileTime> Pi;
bezier(V,T(i),Pi);
P.row(i) = Pi;
}
}
template <typename VMat, typename DerivedT, typename DerivedP>
IGL_INLINE void igl::bezier(
const std::vector<VMat> & spline,
const Eigen::MatrixBase<DerivedT> & T,
Eigen::PlainObjectBase<DerivedP> & P)
{
if(spline.size() == 0) return;
const int m = T.rows();
const int dim = spline[0].cols();
P.resize(m*spline.size(),dim);
for(int c = 0;c<spline.size();c++)
{
assert(dim == spline[c].cols() && "All curves must have same dimension");
DerivedP Pc;
bezier(spline[c],T,Pc);
P.block(m*c,0,m,dim) = Pc;
}
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::bezier<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1> > > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template void igl::bezier<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template void igl::bezier<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 1, -1, 1, 1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> >&);
#endif
+51
View File
@@ -0,0 +1,51 @@
#ifndef BEZIER_H
#define BEZIER_H
#include "igl_inline.h"
#include <Eigen/Core>
#include <vector>
namespace igl
{
// Evaluate a polynomial Bezier Curve.
//
// Inputs:
// V #V by dim list of Bezier control points
// t evaluation parameter within [0,1]
// Outputs:
// P 1 by dim output point
template <typename DerivedV, typename DerivedP>
IGL_INLINE void bezier(
const Eigen::MatrixBase<DerivedV> & V,
const typename DerivedV::Scalar t,
Eigen::PlainObjectBase<DerivedP> & P);
// Evaluate a polynomial Bezier Curve.
//
// Inputs:
// V #V by dim list of Bezier control points
// T #T evaluation parameters within [0,1]
// Outputs:
// P #T by dim output points
template <typename DerivedV, typename DerivedT, typename DerivedP>
IGL_INLINE void bezier(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedT> & T,
Eigen::PlainObjectBase<DerivedP> & P);
// Evaluate a polynomial Bezier spline with a fixed parameter set for each
// sub-curve
//
// Inputs:
// spline #curves list of lists of Bezier control points
// T #T evaluation parameters within [0,1] to use for each spline
// Outputs:
// P #curves*#T by dim output points
template <typename VMat, typename DerivedT, typename DerivedP>
IGL_INLINE void bezier(
const std::vector<VMat> & spline,
const Eigen::MatrixBase<DerivedT> & T,
Eigen::PlainObjectBase<DerivedP> & P);
}
#ifndef IGL_STATIC_LIBRARY
# include "bezier.cpp"
#endif
#endif
+2
View File
@@ -93,6 +93,8 @@ IGL_INLINE void igl::bounding_box(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::bounding_box<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template void igl::bounding_box<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template void igl::bounding_box<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> > const&, Eigen::Matrix<double, -1, -1, 1, -1, -1>::Scalar, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
+2
View File
@@ -313,6 +313,8 @@ IGL_INLINE void igl::cat(const int dim, const std::vector<T> & A, Eigen::PlainOb
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::cat<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(int, std::vector<Eigen::Matrix<float, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<float, -1, -1, 0, -1, -1> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template Eigen::Matrix<double, -1, -1, 0, -1, -1> igl::cat<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(int, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1> const&);
// generated by autoexplicit.sh
template Eigen::SparseMatrix<double, 0, int> igl::cat<Eigen::SparseMatrix<double, 0, int> >(int, Eigen::SparseMatrix<double, 0, int> const&, Eigen::SparseMatrix<double, 0, int> const&);
+1
View File
@@ -12,6 +12,7 @@
#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
#include <Eigen/Sparse>
#include <Eigen/Dense>
#include <vector>
namespace igl
{
+4
View File
@@ -62,6 +62,10 @@ IGL_INLINE void igl::centroid(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::centroid<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, 3, 1, 0, 3, 1>, float>(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> >&, float&);
// generated by autoexplicit.sh
template void igl::centroid<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, 3, 1, 0, 3, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> >&);
// generated by autoexplicit.sh
template void igl::centroid<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> >&);
template void igl::centroid<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 3, 1, 0, 3, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >&);
template void igl::centroid<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
+2 -1
View File
@@ -88,11 +88,12 @@ IGL_INLINE void igl::combine(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::combine<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::vector<Eigen::Matrix<float, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<float, -1, -1, 0, -1, -1> > > const&, std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::combine<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<unsigned long, -1, 1, 0, -1, 1>, Eigen::Matrix<unsigned long, -1, 1, 0, -1, 1> >(std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1> > > const&, std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned long, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned long, -1, 1, 0, -1, 1> >&);
template void igl::combine<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(std::vector<Eigen::Matrix<double, -1, 3, 1, -1, 3>, std::allocator<Eigen::Matrix<double, -1, 3, 1, -1, 3> > > const&, std::vector<Eigen::Matrix<int, -1, 3, 1, -1, 3>, std::allocator<Eigen::Matrix<int, -1, 3, 1, -1, 3> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
template void igl::combine<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1> > > const&, std::vector<Eigen::Matrix<int, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<int, -1, -1, 0, -1, -1> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
#ifdef WIN32
template void igl::combine<Eigen::Matrix<double,-1,-1,0,-1,-1>, Eigen::Matrix<int,-1,-1,0,-1,-1>,Eigen::Matrix<double,-1,-1,0,-1,-1>,Eigen::Matrix<int,-1,-1,0,-1,-1>,Eigen::Matrix<unsigned __int64,-1,1,0,-1,1>,Eigen::Matrix<unsigned __int64,-1,1,0,-1,1> >(class std::vector<Eigen::Matrix<double,-1,-1,0,-1,-1>,class std::allocator<Eigen::Matrix<double,-1,-1,0,-1,-1> > > const &,class std::vector<Eigen::Matrix<int,-1,-1,0,-1,-1>,class std::allocator<Eigen::Matrix<int,-1,-1,0,-1,-1> > > const &,Eigen::PlainObjectBase<Eigen::Matrix<double,-1,-1,0,-1,-1> > &,Eigen::PlainObjectBase<Eigen::Matrix<int,-1,-1,0,-1,-1> > &,Eigen::PlainObjectBase<Eigen::Matrix<unsigned __int64,-1,1,0,-1,1> > &,Eigen::PlainObjectBase<Eigen::Matrix<unsigned __int64,-1,1,0,-1,1> > &);
template void igl::combine<Eigen::Matrix<double,-1,-1,0,-1,-1>, Eigen::Matrix<int,-1,-1,0,-1,-1>,Eigen::Matrix<double,-1,-1,0,-1,-1>,Eigen::Matrix<int,-1,-1,0,-1,-1>,Eigen::Matrix<unsigned __int64,-1,1,0,-1,1>,Eigen::Matrix<unsigned __int64,-1,1,0,-1,1> >(class std::vector<Eigen::Matrix<double,-1,-1,0,-1,-1>,class std::allocator<Eigen::Matrix<double,-1,-1,0,-1,-1> > > const &,class std::vector<Eigen::Matrix<int,-1,-1,0,-1,-1>,class std::allocator<Eigen::Matrix<int,-1,-1,0,-1,-1> > > const &,Eigen::PlainObjectBase<Eigen::Matrix<double,-1,-1,0,-1,-1> > &,Eigen::PlainObjectBase<Eigen::Matrix<int,-1,-1,0,-1,-1> > &,Eigen::PlainObjectBase<Eigen::Matrix<unsigned __int64,-1,1,0,-1,1> > &,Eigen::PlainObjectBase<Eigen::Matrix<unsigned __int64,-1,1,0,-1,1> > &);
#endif
#endif
+61
View File
@@ -0,0 +1,61 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2020 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "connected_components.h"
#include <queue>
template < typename Atype, typename DerivedC, typename DerivedK>
IGL_INLINE int igl::connected_components(
const Eigen::SparseMatrix<Atype> & A,
Eigen::PlainObjectBase<DerivedC> & C,
Eigen::PlainObjectBase<DerivedK> & K)
{
typedef typename Eigen::SparseMatrix<Atype>::Index Index;
const auto m = A.rows();
assert(A.cols() == A.rows() && "A should be square");
// 1.1 sec
// m means not yet visited
C.setConstant(m,1,m);
// Could use amortized dynamic array but didn't see real win.
K.setZero(m,1);
typename DerivedC::Scalar c = 0;
for(Eigen::Index f = 0;f<m;f++)
{
// already seen
if(C(f)<m) continue;
// start bfs
std::queue<Index> Q;
Q.push(f);
while(!Q.empty())
{
const Index g = Q.front();
Q.pop();
// already seen
if(C(g)<m) continue;
// see it
C(g) = c;
K(c)++;
for(typename Eigen::SparseMatrix<Atype>::InnerIterator it (A,g); it; ++it)
{
const Index n = it.index();
// already seen
if(C(n)<m) continue;
Q.push(n);
}
}
c++;
}
K.conservativeResize(c,1);
return c;
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template int igl::connected_components<int, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::SparseMatrix<int, 0, int> const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#endif
+35
View File
@@ -0,0 +1,35 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2020 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_CONNECTED_COMPONENTS_H
#define IGL_CONNECTED_COMPONENTS_H
#include "igl_inline.h"
#include <Eigen/Core>
#include <Eigen/Sparse>
namespace igl
{
// Determine the connected components of a graph described by the input
// adjacency matrix (similar to MATLAB's graphconncomp).
//
// Inputs:
// A #A by #A adjacency matrix (treated as describing an undirected graph)
// Outputs:
// C #A list of component indices into [0,#K-1]
// K #K list of sizes of each component
// Returns number of connected components
template < typename Atype, typename DerivedC, typename DerivedK>
IGL_INLINE int connected_components(
const Eigen::SparseMatrix<Atype> & A,
Eigen::PlainObjectBase<DerivedC> & C,
Eigen::PlainObjectBase<DerivedK> & K);
}
#ifndef IGL_STATIC_LIBRARY
# include "connected_components.cpp"
#endif
#endif
+6
View File
@@ -49,6 +49,12 @@ igl::copyleft::cgal::assign(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::copyleft::cgal::assign<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::assign<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::assign<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::assign<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::assign<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1> >&);
+49
View File
@@ -0,0 +1,49 @@
#include "coplanar.h"
#include "row_to_point.h"
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Point_3.h>
template <typename DerivedV>
IGL_INLINE bool igl::copyleft::cgal::coplanar(
const Eigen::MatrixBase<DerivedV> & V)
{
// 3 points in 3D are always coplanar
if(V.rows() < 4){ return true; }
// spanning points found so far
std::vector<CGAL::Point_3<CGAL::Epick> > p;
for(int i = 0;i<V.rows();i++)
{
const CGAL::Point_3<CGAL::Epick> pi(V(i,0), V(i,1), V(i,2));
switch(p.size())
{
case 0:
p.push_back(pi);
break;
case 1:
if(p[0] != pi)
{
p.push_back(pi);
}
break;
case 2:
if(!CGAL::collinear(p[0],p[1],pi))
{
p.push_back(pi);
}
break;
case 3:
if(!CGAL::coplanar(p[0],p[1],p[2],pi))
{
return false;
}
break;
}
}
return true;
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template bool igl::copyleft::cgal::coplanar<Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&);
#endif
+26
View File
@@ -0,0 +1,26 @@
#ifndef IGL_COPYLEFT_CGAL_COPLANAR_H
#define IGL_COPYLEFT_CGAL_COPLANAR_H
#include "../../igl_inline.h"
#include <Eigen/Core>
namespace igl
{
namespace copyleft
{
namespace cgal
{
// Test whether all points are on same plane.
//
// Inputs:
// V #V by 3 list of 3D vertex positions
// Returns true if all points lie on the same plane
template <typename DerivedV>
IGL_INLINE bool coplanar(
const Eigen::MatrixBase<DerivedV> & V);
}
}
}
#ifndef IGL_STATIC_LIBRARY
# include "coplanar.cpp"
#endif
#endif
+2 -2
View File
@@ -1,7 +1,7 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2015 Qingnan Zhou <qnzhou@gmail.com>
//
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
@@ -200,7 +200,7 @@ IGL_INLINE size_t igl::copyleft::cgal::extract_cells(
DerivedV bbox_max(num_components, 3);
// Assuming our mesh (in exact numbers) fits in the range of double.
bbox_min.setConstant(std::numeric_limits<double>::max());
bbox_max.setConstant(std::numeric_limits<double>::min());
bbox_max.setConstant(std::numeric_limits<double>::lowest());
// Loop over faces
for (size_t i=0; i<num_faces; i++)
{
@@ -435,6 +435,8 @@ IGL_INLINE bool igl::copyleft::cgal::mesh_boolean(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template bool igl::copyleft::cgal::mesh_boolean<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template bool igl::copyleft::cgal::mesh_boolean<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, 8, 3, 0, 8, 3>, Eigen::Matrix<int, 12, 3, 0, 12, 3>, Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, 8, 3, 0, 8, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, 12, 3, 0, 12, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template bool igl::copyleft::cgal::mesh_boolean<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::MeshBooleanType const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
@@ -48,6 +48,10 @@ IGL_INLINE void igl::copyleft::cgal::mesh_to_cgal_triangle_list(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::copyleft::cgal::mesh_to_cgal_triangle_list<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, CGAL::Epick>(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<CGAL::Triangle_3<CGAL::Epick>, std::allocator<CGAL::Triangle_3<CGAL::Epick> > >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::mesh_to_cgal_triangle_list<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, CGAL::Epeck>(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<CGAL::Triangle_3<CGAL::Epeck>, std::allocator<CGAL::Triangle_3<CGAL::Epeck> > >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::mesh_to_cgal_triangle_list<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, CGAL::Epick>(Eigen::MatrixBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, std::vector<CGAL::Triangle_3<CGAL::Epick>, std::allocator<CGAL::Triangle_3<CGAL::Epick> > >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::mesh_to_cgal_triangle_list<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, CGAL::Epeck>(Eigen::MatrixBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, std::vector<CGAL::Triangle_3<CGAL::Epeck>, std::allocator<CGAL::Triangle_3<CGAL::Epeck> > >&);
@@ -483,6 +483,10 @@ IGL_INLINE void igl::copyleft::cgal::remesh_intersections(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::copyleft::cgal::remesh_intersections<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, CGAL::Epick, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<CGAL::Triangle_3<CGAL::Epick>, std::allocator<CGAL::Triangle_3<CGAL::Epick> > > const&, std::map<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, std::vector<std::pair<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, CGAL::Object>, std::allocator<std::pair<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, CGAL::Object> > >, std::less<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index>, std::allocator<std::pair<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index const, std::vector<std::pair<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, CGAL::Object>, std::allocator<std::pair<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::remesh_intersections<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, CGAL::Epeck, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<CGAL::Triangle_3<CGAL::Epeck>, std::allocator<CGAL::Triangle_3<CGAL::Epeck> > > const&, std::map<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, std::vector<std::pair<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, CGAL::Object>, std::allocator<std::pair<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, CGAL::Object> > >, std::less<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index>, std::allocator<std::pair<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index const, std::vector<std::pair<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, CGAL::Object>, std::allocator<std::pair<Eigen::Matrix<int, -1, -1, 0, -1, -1>::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::remesh_intersections<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, CGAL::Epick, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, std::vector<CGAL::Triangle_3<CGAL::Epick>, std::allocator<CGAL::Triangle_3<CGAL::Epick> > > const&, std::map<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index, std::vector<std::pair<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index, CGAL::Object>, std::allocator<std::pair<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index, CGAL::Object> > >, std::less<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index>, std::allocator<std::pair<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index const, std::vector<std::pair<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index, CGAL::Object>, std::allocator<std::pair<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::remesh_intersections<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, CGAL::Epeck, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, std::vector<CGAL::Triangle_3<CGAL::Epeck>, std::allocator<CGAL::Triangle_3<CGAL::Epeck> > > const&, std::map<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index, std::vector<std::pair<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index, CGAL::Object>, std::allocator<std::pair<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index, CGAL::Object> > >, std::less<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index>, std::allocator<std::pair<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index const, std::vector<std::pair<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index, CGAL::Object>, std::allocator<std::pair<Eigen::Matrix<int, -1, 3, 1, -1, 3>::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
@@ -527,6 +531,8 @@ template void igl::copyleft::cgal::remesh_intersections<Eigen::Matrix<double, -1
template void igl::copyleft::cgal::remesh_intersections<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, CGAL::Epeck, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, std::vector<CGAL::Triangle_3<CGAL::Epeck>, std::allocator<CGAL::Triangle_3<CGAL::Epeck> > > const&, std::map<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index, std::vector<std::pair<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index, CGAL::Object>, std::allocator<std::pair<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index, CGAL::Object> > >, std::less<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index>, std::allocator<std::pair<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index const, std::vector<std::pair<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index, CGAL::Object>, std::allocator<std::pair<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template void igl::copyleft::cgal::remesh_intersections<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, CGAL::Epick, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, std::vector<CGAL::Triangle_3<CGAL::Epick>, std::allocator<CGAL::Triangle_3<CGAL::Epick> > > const&, std::map<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index, std::vector<std::pair<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index, CGAL::Object>, std::allocator<std::pair<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index, CGAL::Object> > >, std::less<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index>, std::allocator<std::pair<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index const, std::vector<std::pair<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index, CGAL::Object>, std::allocator<std::pair<Eigen::Matrix<int, -1, 3, 0, -1, 3>::Index, CGAL::Object> > > > > > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#ifdef WIN32
template void igl::copyleft::cgal::remesh_intersections<class Eigen::Matrix<float,-1,3,0,-1,3>,class Eigen::Matrix<int,-1,-1,0,-1,-1>,class CGAL::Epeck,class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>,-1,-1,0,-1,-1>,class Eigen::Matrix<int,-1,-1,0,-1,-1>,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix<int,-1,1,0,-1,1> >(class Eigen::MatrixBase<class Eigen::Matrix<float,-1,3,0,-1,3> > const &,class Eigen::MatrixBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > const &,class std::vector<class CGAL::Triangle_3<class CGAL::Epeck>,class std::allocator<class CGAL::Triangle_3<class CGAL::Epeck> > > const &,class std::map<__int64,class std::vector<struct std::pair<__int64,class CGAL::Object>,class std::allocator<struct std::pair<__int64,class CGAL::Object> > >,struct std::less<__int64>,class std::allocator<struct std::pair<__int64 const ,class std::vector<struct std::pair<__int64,class CGAL::Object>,class std::allocator<struct std::pair<__int64,class CGAL::Object> > > > > > const &,bool,class Eigen::PlainObjectBase<class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>,-1,-1,0,-1,-1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,1,0,-1,1> > &);
template void igl::copyleft::cgal::remesh_intersections<class Eigen::Matrix<float,-1,3,0,-1,3>,class Eigen::Matrix<int,-1,-1,0,-1,-1>,class CGAL::Epick,class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>,-1,-1,0,-1,-1>,class Eigen::Matrix<int,-1,-1,0,-1,-1>,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix<int,-1,1,0,-1,1> >(class Eigen::MatrixBase<class Eigen::Matrix<float,-1,3,0,-1,3> > const &,class Eigen::MatrixBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > const &,class std::vector<class CGAL::Triangle_3<class CGAL::Epick>,class std::allocator<class CGAL::Triangle_3<class CGAL::Epick> > > const &,class std::map<__int64,class std::vector<struct std::pair<__int64,class CGAL::Object>,class std::allocator<struct std::pair<__int64,class CGAL::Object> > >,struct std::less<__int64>,class std::allocator<struct std::pair<__int64 const ,class std::vector<struct std::pair<__int64,class CGAL::Object>,class std::allocator<struct std::pair<__int64,class CGAL::Object> > > > > > const &,bool,class Eigen::PlainObjectBase<class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>,-1,-1,0,-1,-1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,1,0,-1,1> > &);
template void igl::copyleft::cgal::remesh_intersections<class Eigen::Matrix<double, -1, 3, 0, -1, 3>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class CGAL::Epeck, class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<double, -1, 3, 0, -1, 3>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, class std::vector<class CGAL::Triangle_3<class CGAL::Epeck>, class std::allocator<class CGAL::Triangle_3<class CGAL::Epeck>>> const &, class std::map<__int64, class std::vector<struct std::pair<__int64, class CGAL::Object>, class std::allocator<struct std::pair<__int64, class CGAL::Object>>>, struct std::less<__int64>, class std::allocator<struct std::pair<__int64 const, class std::vector<struct std::pair<__int64, class CGAL::Object>, class std::allocator<struct std::pair<__int64, class CGAL::Object>>>>>> const &, bool, class Eigen::PlainObjectBase<class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
template void igl::copyleft::cgal::remesh_intersections<class Eigen::Matrix<double, -1, 3, 0, -1, 3>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class CGAL::Epick, class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<double, -1, 3, 0, -1, 3>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, class std::vector<class CGAL::Triangle_3<class CGAL::Epick>, class std::allocator<class CGAL::Triangle_3<class CGAL::Epick>>> const &, class std::map<__int64, class std::vector<struct std::pair<__int64, class CGAL::Object>, class std::allocator<struct std::pair<__int64, class CGAL::Object>>>, struct std::less<__int64>, class std::allocator<struct std::pair<__int64 const, class std::vector<struct std::pair<__int64, class CGAL::Object>, class std::allocator<struct std::pair<__int64, class CGAL::Object>>>>>> const &, bool, class Eigen::PlainObjectBase<class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
template void igl::copyleft::cgal::remesh_intersections<class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, 3, 0, -1, 3>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class CGAL::Epeck, class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, 3, 0, -1, 3>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, class std::vector<class CGAL::Triangle_3<class CGAL::Epeck>, class std::allocator<class CGAL::Triangle_3<class CGAL::Epeck>>> const &, class std::map<__int64, class std::vector<struct std::pair<__int64, class CGAL::Object>, class std::allocator<struct std::pair<__int64, class CGAL::Object>>>, struct std::less<__int64>, class std::allocator<struct std::pair<__int64 const, class std::vector<struct std::pair<__int64, class CGAL::Object>, class std::allocator<struct std::pair<__int64, class CGAL::Object>>>>>> const &, bool, class Eigen::PlainObjectBase<class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
@@ -83,6 +83,8 @@ IGL_INLINE void igl::copyleft::cgal::remesh_self_intersections(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::copyleft::cgal::remesh_self_intersections<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<long, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<long, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::remesh_self_intersections<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::remesh_self_intersections<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
@@ -104,6 +106,7 @@ template void igl::copyleft::cgal::remesh_self_intersections<Eigen::Matrix<doubl
template void igl::copyleft::cgal::remesh_self_intersections<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, igl::copyleft::cgal::RemeshSelfIntersectionsParam const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#ifdef WIN32
template void igl::copyleft::cgal::remesh_self_intersections<class Eigen::Matrix<double, -1, 3, 0, -1, 3>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<double, -1, 3, 0, -1, 3>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, struct igl::copyleft::cgal::RemeshSelfIntersectionsParam const &, class Eigen::PlainObjectBase<class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
template void igl::copyleft::cgal::remesh_self_intersections<class Eigen::Matrix< float, -1, 3, 0, -1, 3>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix<int, -1, 1, 0, -1, 1> >(class Eigen::MatrixBase<class Eigen::Matrix< float, -1, 3, 0, -1, 3> > const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1> > const &, struct igl::copyleft::cgal::RemeshSelfIntersectionsParam const &, class Eigen::PlainObjectBase<class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, -1, 0, -1, -1> > &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1> > &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1> > &, class Eigen::PlainObjectBase<class Eigen::Matrix<__int64, -1, 1, 0, -1, 1> > &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1> > &);
template void igl::copyleft::cgal::remesh_self_intersections<class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, 3, 0, -1, 3>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, 3, 0, -1, 3>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, struct igl::copyleft::cgal::RemeshSelfIntersectionsParam const &, class Eigen::PlainObjectBase<class Eigen::Matrix<class CGAL::Lazy_exact_nt<class CGAL::Gmpq>, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<__int64, -1, 1, 0, -1, 1>> &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
#endif
#endif
@@ -88,3 +88,9 @@ IGL_INLINE void igl::copyleft::cgal::resolve_intersections(
subdivide_segments(V,E,steiner,VI,EI,J,IM);
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::copyleft::cgal::resolve_intersections<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#endif
@@ -16,3 +16,10 @@ IGL_INLINE CGAL::Point_2<Kernel> igl::copyleft::cgal::row_to_point(
{
return CGAL::Point_2<Kernel>(V(i,0),V(i,1));
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
template CGAL::Point_2<CGAL::Epeck> igl::copyleft::cgal::row_to_point<CGAL::Epeck, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1>::Index const&);
#endif
@@ -204,3 +204,9 @@ IGL_INLINE void igl::copyleft::cgal::snap_rounding(
}
}
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::copyleft::cgal::snap_rounding<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#endif
@@ -132,3 +132,11 @@ IGL_INLINE void igl::copyleft::cgal::subdivide_segments(
list_to_matrix(vIM,IM);
}
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::copyleft::cgal::subdivide_segments<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, CGAL::Epeck, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<CGAL::Point_2<CGAL::Epeck>, std::allocator<CGAL::Point_2<CGAL::Epeck> > >, std::allocator<std::vector<CGAL::Point_2<CGAL::Epeck>, std::allocator<CGAL::Point_2<CGAL::Epeck> > > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template void igl::copyleft::cgal::subdivide_segments<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, CGAL::Epeck, Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<CGAL::Point_2<CGAL::Epeck>, std::allocator<CGAL::Point_2<CGAL::Epeck> > >, std::allocator<std::vector<CGAL::Point_2<CGAL::Epeck>, std::allocator<CGAL::Point_2<CGAL::Epeck> > > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<CGAL::Lazy_exact_nt<CGAL::Gmpq>, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#endif
+1
View File
@@ -11,4 +11,5 @@
#ifdef IGL_STATIC_LIBRARY
#undef IGL_STATIC_LIBRARY
#include "../../unique.cpp"
template void igl::unique<CGAL::Point_2<CGAL::Epeck> >(std::vector<CGAL::Point_2<CGAL::Epeck>, std::allocator<CGAL::Point_2<CGAL::Epeck> > > const&, std::vector<CGAL::Point_2<CGAL::Epeck>, std::allocator<CGAL::Point_2<CGAL::Epeck> > >&, std::vector<unsigned long, std::allocator<unsigned long> >&, std::vector<unsigned long, std::allocator<unsigned long> >&);
#endif
+32 -3
View File
@@ -4,6 +4,7 @@
#include "../../slice.h"
#include "../../PI.h"
#include "convex_hull.h"
#include "coplanar.h"
#include "mesh_boolean.h"
#include <Eigen/Geometry>
#include <vector>
@@ -11,19 +12,22 @@
template <
typename DerivedWV,
typename DerivedWE,
typename Derivedth,
typename DerivedV,
typename DerivedF,
typename DerivedJ>
IGL_INLINE void igl::copyleft::cgal::wire_mesh(
const Eigen::MatrixBase<DerivedWV> & WV,
const Eigen::MatrixBase<DerivedWE> & WE,
const double th,
const Eigen::MatrixBase<Derivedth> & th,
const int poly_size,
const bool solid,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedJ> & J)
{
assert((th.size()==1 || th.size()==WE.rows()) &&
"th should be scalar or size of WE");
typedef typename DerivedWV::Scalar Scalar;
// Canonical polygon to place at each endpoint
@@ -87,7 +91,7 @@ IGL_INLINE void igl::copyleft::cgal::wire_mesh(
// loop over polygon vertices
for(int p = 0;p<PV.rows();p++)
{
RowVector3S qp = q*(PV.row(p)*th);
RowVector3S qp = q*(PV.row(p)*th(e%th.size()));
// loop over endpoints
for(int c = 0;c<2;c++)
{
@@ -98,7 +102,8 @@ IGL_INLINE void igl::copyleft::cgal::wire_mesh(
// Max out amount at 1/3 of edge length so that there's always some
// amount of edge
// Zero out if vertex is incident on only one edge
Scalar dist = std::min(1.*th,len/3.0) * (nedges[WE(e,c)] > 1);
Scalar dist =
std::min(1.*th(e%th.size()),len/3.0)*(nedges[WE(e,c)] > 1);
// Move to endpoint, offset by amount
V.row(index(e,c,p)) =
qp+WV.row(WE(e,c)) + dist*dir*uv;
@@ -113,6 +118,10 @@ IGL_INLINE void igl::copyleft::cgal::wire_mesh(
{
MatrixX3S Vv;
igl::slice(V,I,1,Vv);
if(coplanar(Vv))
{
return;
}
Eigen::MatrixXi Fv;
convex_hull(Vv,Fv);
for(int f = 0;f<Fv.rows();f++)
@@ -201,6 +210,26 @@ IGL_INLINE void igl::copyleft::cgal::wire_mesh(
}
}
template <
typename DerivedWV,
typename DerivedWE,
typename DerivedV,
typename DerivedF,
typename DerivedJ>
IGL_INLINE void igl::copyleft::cgal::wire_mesh(
const Eigen::MatrixBase<DerivedWV> & WV,
const Eigen::MatrixBase<DerivedWE> & WE,
const double th,
const int poly_size,
const bool solid,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedJ> & J)
{
return wire_mesh(
WV,WE,(Eigen::VectorXd(1,1)<<th).finished(),poly_size,solid,V,F,J);
}
template <
typename DerivedWV,
typename DerivedWE,
+17 -1
View File
@@ -14,7 +14,7 @@ namespace igl
// Inputs:
// WV #WV by 3 list of vertex positions
// WE #WE by 2 list of edge indices into WV
// th diameter thickness of wire
// th #WE diameter thicknesses of wire edges
// poly_size number of sides on each wire (e.g., 4 would produce wires by
// connecting rectangular prisms).
// solid whether to resolve self-intersections to
@@ -26,6 +26,22 @@ namespace igl
// output faces J(j) < #WV means the face corresponds to the J(j)th
// vertex in WV. J(j) >= #WV means the face corresponds to the
// (J(j)-#WV)th edge in WE.
template <
typename DerivedWV,
typename DerivedWE,
typename Derivedth,
typename DerivedV,
typename DerivedF,
typename DerivedJ>
IGL_INLINE void wire_mesh(
const Eigen::MatrixBase<DerivedWV> & WV,
const Eigen::MatrixBase<DerivedWE> & WE,
const Eigen::MatrixBase<Derivedth> & th,
const int poly_size,
const bool solid,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedJ> & J);
template <
typename DerivedWV,
typename DerivedWE,
+2
View File
@@ -531,6 +531,8 @@ IGL_INLINE void igl::copyleft::marching_cubes(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::copyleft::marching_cubes<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, unsigned int, unsigned int, unsigned int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
template void igl::copyleft::marching_cubes<Eigen::Matrix<float, -1, 1, 0, -1, 1>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, unsigned int, unsigned int, unsigned int, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
template void igl::copyleft::marching_cubes<Eigen::Matrix<float, -1, 1, 0, -1, 1>, Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, unsigned int, unsigned int, unsigned int, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
template void igl::copyleft::marching_cubes<Eigen::Matrix<float, -1, 1, 0, -1, 1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, unsigned int, unsigned int, unsigned int, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
+38 -16
View File
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "cumsum.h"
#include <numeric>
@@ -14,43 +14,65 @@ IGL_INLINE void igl::cumsum(
const Eigen::MatrixBase<DerivedX > & X,
const int dim,
Eigen::PlainObjectBase<DerivedY > & Y)
{
return cumsum(X,dim,false,Y);
}
template <typename DerivedX, typename DerivedY>
IGL_INLINE void igl::cumsum(
const Eigen::MatrixBase<DerivedX > & X,
const int dim,
const bool zero_prefix,
Eigen::PlainObjectBase<DerivedY > & Y)
{
using namespace Eigen;
using namespace std;
Y.resizeLike(X);
Y.resize(
X.rows()+(zero_prefix&&dim==1?1:0),
X.cols()+(zero_prefix&&dim==2?1:0));
// get number of columns (or rows)
int num_outer = (dim == 1 ? X.cols() : X.rows() );
Eigen::Index num_outer = (dim == 1 ? X.cols() : X.rows() );
// get number of rows (or columns)
int num_inner = (dim == 1 ? X.rows() : X.cols() );
Eigen::Index num_inner = (dim == 1 ? X.rows() : X.cols() );
// This has been optimized so that dim = 1 or 2 is roughly the same cost.
// (Optimizations assume ColMajor order)
if(dim == 1)
{
if(zero_prefix)
{
Y.row(0).setConstant(0);
}
#pragma omp parallel for
for(int o = 0;o<num_outer;o++)
for(Eigen::Index o = 0;o<num_outer;o++)
{
typename DerivedX::Scalar sum = 0;
for(int i = 0;i<num_inner;i++)
for(Eigen::Index i = 0;i<num_inner;i++)
{
sum += X(i,o);
Y(i,o) = sum;
const Eigen::Index yi = zero_prefix?i+1:i;
Y(yi,o) = sum;
}
}
}else
{
for(int i = 0;i<num_inner;i++)
if(zero_prefix)
{
Y.col(0).setConstant(0);
}
for(Eigen::Index i = 0;i<num_inner;i++)
{
const Eigen::Index yi = zero_prefix?i+1:i;
// Notice that it is *not* OK to put this above the inner loop
// Though here it doesn't seem to pay off...
//#pragma omp parallel for
for(int o = 0;o<num_outer;o++)
for(Eigen::Index o = 0;o<num_outer;o++)
{
if(i == 0)
{
Y(o,i) = X(o,i);
Y(o,yi) = X(o,i);
}else
{
Y(o,i) = Y(o,i-1) + X(o,i);
Y(o,yi) = Y(o,yi-1) + X(o,i);
}
}
}
@@ -59,9 +81,8 @@ IGL_INLINE void igl::cumsum(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::cumsum<Eigen::Matrix<float, -1, 1, 0, -1, 1>, Eigen::Matrix<float, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >&);
template void igl::cumsum<Eigen::Matrix<double, 4, 1, 0, 4, 1>, Eigen::Matrix<double, 4, 1, 0, 4, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, 4, 1, 0, 4, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 4, 1, 0, 4, 1> >&);
// generated by autoexplicit.sh
template void igl::cumsum<Eigen::Matrix<double, 1, 4, 1, 1, 4>, Eigen::Matrix<double, 1, 4, 1, 1, 4> >(Eigen::MatrixBase<Eigen::Matrix<double, 1, 4, 1, 1, 4> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 4, 1, 1, 4> >&);
template void igl::cumsum<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template void igl::cumsum<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
@@ -69,6 +90,7 @@ template void igl::cumsum<Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<do
template void igl::cumsum<Eigen::Matrix<unsigned long, 2, 1, 0, 2, 1>, Eigen::Matrix<unsigned long, 2, 1, 0, 2, 1> >(Eigen::MatrixBase<Eigen::Matrix<unsigned long, 2, 1, 0, 2, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<unsigned long, 2, 1, 0, 2, 1> >&);
template void igl::cumsum<Eigen::Matrix<unsigned long, -1, 1, 0, -1, 1>, Eigen::Matrix<unsigned long, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<unsigned long, -1, 1, 0, -1, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<unsigned long, -1, 1, 0, -1, 1> >&);
template void igl::cumsum<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template void igl::cumsum<Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, int, bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#ifdef WIN32
template void igl::cumsum<class Eigen::Matrix<unsigned __int64, -1, 1, 0, -1, 1>, class Eigen::Matrix<unsigned __int64, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<unsigned __int64, -1, 1, 0, -1, 1>> const &, int, class Eigen::PlainObjectBase<class Eigen::Matrix<unsigned __int64, -1, 1, 0, -1, 1>> &);
template void igl::cumsum<class Eigen::Matrix<unsigned __int64, 2, 1, 0, 2, 1>, class Eigen::Matrix<unsigned __int64, 2, 1, 0, 2, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<unsigned __int64, 2, 1, 0, 2, 1>> const &, int, class Eigen::PlainObjectBase<class Eigen::Matrix<unsigned __int64, 2, 1, 0, 2, 1>> &);
+19
View File
@@ -29,6 +29,25 @@ namespace igl
const Eigen::MatrixBase<DerivedX > & X,
const int dim,
Eigen::PlainObjectBase<DerivedY > & Y);
// Computes a cumulative sum of the columns of [0;X]
//
// Inputs:
// X m by n Matrix to be cumulatively summed.
// dim dimension to take cumulative sum (1 or 2)
// zero_prefix whe
// Output:
// if zero_prefix == false
// Y m by n Matrix containing cumulative sum
// else
// Y m+1 by n Matrix containing cumulative sum if dim=1
// or
// Y m by n+1 Matrix containing cumulative sum if dim=2
template <typename DerivedX, typename DerivedY>
IGL_INLINE void cumsum(
const Eigen::MatrixBase<DerivedX > & X,
const int dim,
const bool zero_prefix,
Eigen::PlainObjectBase<DerivedY > & Y);
//template <typename DerivedX, typename DerivedY>
//IGL_INLINE void cumsum(
// const Eigen::MatrixBase<DerivedX > & X,
-3
View File
@@ -60,7 +60,4 @@ IGL_INLINE void igl::delaunay_triangulation(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::delaunay_triangulation<Eigen::Matrix<double, -1, -1, 0, -1, -1>, short (*)(double const*, double const*, double const*), short (*)(double const*, double const*, double const*, double const*), Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, short (*)(double const*, double const*, double const*), short (*)(double const*, double const*, double const*, double const*), Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
#ifdef WIN32
template void igl::delaunay_triangulation<class Eigen::Matrix<double, -1, -1, 0, -1, -1>, short(*)(double const *, double const *, double const *), short(*)(double const *, double const *, double const *, double const *), class Eigen::Matrix<int, -1, -1, 0, -1, -1>>(class Eigen::MatrixBase<class Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, short(*const)(double const *, double const *, double const *), short(*const)(double const *, double const *, double const *, double const *), class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> &);
#endif
#endif
+2
View File
@@ -231,6 +231,8 @@ IGL_INLINE void igl::doublearea_quad(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::doublearea<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >&);
template void igl::doublearea<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
template void igl::doublearea<Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
template void igl::doublearea<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> > const&, Eigen::Matrix<double, -1, -1, 1, -1, -1>::Scalar, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+2
View File
@@ -22,6 +22,8 @@ IGL_INLINE void igl::edge_lengths(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::edge_lengths<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&);
// generated by autoexplicit.sh
template void igl::edge_lengths<Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
// generated by autoexplicit.sh
template void igl::edge_lengths<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&);
+5 -8
View File
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2016 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "eigs.h"
@@ -135,7 +135,7 @@ IGL_INLINE bool igl::eigs(
return false;
}
if(
i==0 ||
i==0 ||
(S.head(i).array()-sigma).abs().maxCoeff()>1e-14 ||
((U.leftCols(i).transpose()*B*x).array().abs()<=1e-7).all()
)
@@ -170,7 +170,4 @@ IGL_INLINE bool igl::eigs(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template bool igl::eigs<double, double, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::SparseMatrix<double, 0, int> const&, const size_t, igl::EigsType, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
#ifdef WIN32
template bool igl::eigs<double, double, Eigen::Matrix<double,-1,-1,0,-1,-1>, Eigen::Matrix<double,-1,1,0,-1,1> >(Eigen::SparseMatrix<double,0,int> const &,Eigen::SparseMatrix<double,0,int> const &, const size_t, igl::EigsType, Eigen::PlainObjectBase< Eigen::Matrix<double,-1,-1,0,-1,-1> > &, Eigen::PlainObjectBase<Eigen::Matrix<double,-1,1,0,-1,1> > &);
#endif
#endif
+70
View File
@@ -0,0 +1,70 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2020 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "exploded_view.h"
#include "barycenter.h"
#include "volume.h"
template <
typename DerivedV,
typename DerivedT,
typename DerivedEV,
typename DerivedEF,
typename DerivedI,
typename DerivedJ>
IGL_INLINE void igl::exploded_view(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedT> & T,
const typename DerivedV::Scalar s,
const typename DerivedV::Scalar t,
Eigen::PlainObjectBase<DerivedEV> & EV,
Eigen::PlainObjectBase<DerivedEF> & EF,
Eigen::PlainObjectBase<DerivedI> & I,
Eigen::PlainObjectBase<DerivedJ> & J)
{
assert(T.cols() == 4 && "T should be a tet mesh");
EV.resize(4*T.rows(),3);
EF.resize(4*T.rows(),3);
I.resize(EV.rows());
J.resize(EF.rows());
Eigen::MatrixXd BC;
igl::barycenter(V,T,BC);
Eigen::VectorXd vol;
igl::volume(V,T,vol);
const Eigen::RowVectorXd c = vol.transpose()*BC/vol.array().sum();
for(int i = 0;i<T.rows();i++)
{
// scale the barycenters outward
const auto tbc = ((BC.row(i)-c)*t+c).eval();
for(int j = 0;j<4;j++)
{
// vector to barycenter
const auto v = V.row(T(i,j))-BC.row(i);
// scale vector and add to scaled barycenter
EV.row(i*4+j) = v*s+tbc;
I(i*4+j) = T(i,j);
J(i*4+j) = i;
if(j%2)
{
EF(i*4+j,0) = i*4+((j+3)%4);
EF(i*4+j,1) = i*4+((j+2)%4);
EF(i*4+j,2) = i*4+((j+1)%4);
}else
{
EF(i*4+j,0) = i*4+((j+1)%4);
EF(i*4+j,1) = i*4+((j+2)%4);
EF(i*4+j,2) = i*4+((j+3)%4);
}
}
}
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::exploded_view<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, Eigen::Matrix<double, -1, -1, 0, -1, -1>::Scalar, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#endif
+50
View File
@@ -0,0 +1,50 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2020 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_EXPLODED_VIEW_H
#define IGL_EXPLODED_VIEW_H
#include "igl_inline.h"
#include <Eigen/Core>
namespace igl
{
// Given a tet-mesh, create a trivial surface mesh (4 triangles per tet) with
// each tet scaled individually and translated outward from the mesh's
// centroid, creating an exploded-view visualization.
//
// Inputs:
// V #V by 3 list of tet mesh vertex positions
// T #T by 4 list of tet mesh indices into rows of V
// s amount to scale each tet indvidually, typically (0,1]
// t amount to scale away from mesh's centroid, typically >=1
// Outputs:
// EV #T*4 by 3 list of output mesh vertex positions
// EF #T*4 by 3 list of output triangle indices into rows of EV
// I #EV list of indices into V revealing birth parent
// J #EF list of indices into F revealing birth parent
template <
typename DerivedV,
typename DerivedT,
typename DerivedEV,
typename DerivedEF,
typename DerivedI,
typename DerivedJ>
IGL_INLINE void exploded_view(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedT> & T,
const typename DerivedV::Scalar s,
const typename DerivedV::Scalar t,
Eigen::PlainObjectBase<DerivedEV> & EV,
Eigen::PlainObjectBase<DerivedEF> & EF,
Eigen::PlainObjectBase<DerivedI> & I,
Eigen::PlainObjectBase<DerivedJ> & J);
}
#ifndef IGL_STATIC_LIBRARY
# include "exploded_view.cpp"
#endif
#endif
+16 -16
View File
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2016 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "extract_manifold_patches.h"
#include "unique_edge_map.h"
@@ -17,8 +17,8 @@ template<
typename uE2EType,
typename DerivedP>
IGL_INLINE size_t igl::extract_manifold_patches(
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedEMAP>& EMAP,
const std::vector<std::vector<uE2EType> >& uE2E,
Eigen::PlainObjectBase<DerivedP>& P)
{
@@ -76,12 +76,12 @@ IGL_INLINE size_t igl::extract_manifold_patches(
return num_patches;
}
template<
typename DerivedF,
typename DerivedP>
template <
typename DerivedF,
typename DerivedP>
IGL_INLINE size_t igl::extract_manifold_patches(
const Eigen::PlainObjectBase<DerivedF>& F,
Eigen::PlainObjectBase<DerivedP>& P)
const Eigen::MatrixBase<DerivedF> &F,
Eigen::PlainObjectBase<DerivedP> &P)
{
Eigen::MatrixXi E, uE;
Eigen::VectorXi EMAP;
@@ -93,11 +93,11 @@ IGL_INLINE size_t igl::extract_manifold_patches(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template unsigned long igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template size_t igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template unsigned long igl::extract_manifold_patches<Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template size_t igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template size_t igl::extract_manifold_patches<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template size_t igl::extract_manifold_patches<Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned long, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#ifdef WIN32
template unsigned __int64 igl::extract_manifold_patches<class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned __int64, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> const &, class std::vector<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>, class std::allocator<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
template unsigned __int64 igl::extract_manifold_patches<class Eigen::Matrix<int, -1, 3, 1, -1, 3>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned __int64, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 3, 1, -1, 3>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> const &, class std::vector<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>, class std::allocator<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
template unsigned __int64 igl::extract_manifold_patches<class Eigen::Matrix<int, -1, -1, 0, -1, -1>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned __int64, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<int, -1, -1, 0, -1, -1>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> const &, class std::vector<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>, class std::allocator<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
template unsigned __int64 igl::extract_manifold_patches<class Eigen::Matrix<int, -1, 3, 1, -1, 3>, class Eigen::Matrix<int, -1, 1, 0, -1, 1>, unsigned __int64, class Eigen::Matrix<int, -1, 1, 0, -1, 1>>(class Eigen::MatrixBase<class Eigen::Matrix<int, -1, 3, 1, -1, 3>> const &, class Eigen::MatrixBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> const &, class std::vector<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>, class std::allocator<class std::vector<unsigned __int64, class std::allocator<unsigned __int64>>>> const &, class Eigen::PlainObjectBase<class Eigen::Matrix<int, -1, 1, 0, -1, 1>> &);
#endif
#endif
+10 -10
View File
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2016 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_EXTRACT_MANIFOLD_PATCHES
#define IGL_EXTRACT_MANIFOLD_PATCHES
@@ -33,16 +33,16 @@ namespace igl {
typename uE2EType,
typename DerivedP>
IGL_INLINE size_t extract_manifold_patches(
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedEMAP>& EMAP,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedEMAP>& EMAP,
const std::vector<std::vector<uE2EType> >& uE2E,
Eigen::PlainObjectBase<DerivedP>& P);
template <
typename DerivedF,
typename DerivedP>
typename DerivedF,
typename DerivedP>
IGL_INLINE size_t extract_manifold_patches(
const Eigen::PlainObjectBase<DerivedF>& F,
Eigen::PlainObjectBase<DerivedP>& P);
const Eigen::MatrixBase<DerivedF> &F,
Eigen::PlainObjectBase<DerivedP> &P);
}
#ifndef IGL_STATIC_LIBRARY
# include "extract_manifold_patches.cpp"
+6 -6
View File
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "face_occurrences.h"
#include "list_to_matrix.h"
@@ -48,7 +48,7 @@ IGL_INLINE void igl::face_occurrences(
{
// sorted face should definitely be in counts map
assert(counts.find(sortedF[i]) != counts.end());
C[i] = counts[sortedF[i]];
C[i] = static_cast<IntegerC>(counts[sortedF[i]]);
}
}
@@ -60,7 +60,7 @@ IGL_INLINE void igl::face_occurrences(
// Should really just rewrite using Eigen+libigl ...
std::vector<std::vector<typename DerivedF::Scalar> > vF;
matrix_to_list(F,vF);
std::vector<std::vector<typename DerivedC::Scalar> > vC;
std::vector<typename DerivedC::Scalar> vC;
igl::face_occurrences(vF,vC);
list_to_matrix(vC,C);
}
+58
View File
@@ -0,0 +1,58 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2020 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "facet_adjacency_matrix.h"
#include "unique_edge_map.h"
template <typename DerivedF, typename Atype>
IGL_INLINE void igl::facet_adjacency_matrix(
const Eigen::MatrixBase<DerivedF> & F, Eigen::SparseMatrix<Atype> & A)
{
using namespace Eigen;
typedef typename DerivedF::Scalar Index;
const auto m = F.rows();
Eigen::Matrix<Index,Dynamic,1> EMAP,uEE,uEC;
Eigen::Matrix<Index,Dynamic,2> E,uE;
igl::unique_edge_map(F,E,uE,EMAP,uEC,uEE);
std::vector<Eigen::Triplet<Index> > AIJV;
AIJV.reserve(2*uE.rows());
const Eigen::Index nu = uE.rows();
for(Eigen::Index ue = 0;ue<nu;ue++)
{
// number of faces incident on this unique edge
const Eigen::Index mue = uEC(ue+1)-uEC(ue);
// base offset in uEE
const Eigen::Index uECue = uEC(ue);
assert(uECue < uEE.rows());
for(Eigen::Index i = 0;i<mue;i++)
{
const auto ii = uEE(uECue+i)%m;
for(Eigen::Index j = 0;j<mue;j++)
{
const auto jj = uEE(uECue+j)%m;
if(ii != jj){ AIJV.emplace_back(ii,jj,1);}
}
}
}
// Facet Adjacency matrix (with (arbitrary) >0
A.resize(m,m);
A.setFromTriplets(AIJV.begin(),AIJV.end());
// Set all non-zerro values to 1
for(Eigen::Index g = 0;g<A.outerSize();g++)
{
for(typename Eigen::SparseMatrix<Atype>::InnerIterator it (A,g); it; ++it)
{
if(it.value()) it.valueRef() = 1;
}
}
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::facet_adjacency_matrix<Eigen::Matrix<int, -1, -1, 0, -1, -1>, int>(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::SparseMatrix<int, 0, int>&);
#endif
+33
View File
@@ -0,0 +1,33 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2020 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_FACET_ADJACENCY_MATRIX_H
#define IGL_FACET_ADJACENCY_MATRIX_H
#include <Eigen/Core>
#include <Eigen/Sparse>
#include "igl_inline.h"
namespace igl
{
// Construct a #F×#F adjacency matrix with A(i,j)>0 indicating that faces i and j
// share an edge.
//
// Inputs:
// F #F by 3 list of facets
// Outputs:
// A #F by #F adjacency matrix
template <typename DerivedF, typename Atype>
IGL_INLINE void facet_adjacency_matrix(
const Eigen::MatrixBase<DerivedF> & F,
Eigen::SparseMatrix<Atype> & A);
};
#ifndef IGL_STATIC_LIBRARY
# include "facet_adjacency_matrix.cpp"
#endif
#endif
+11 -8
View File
@@ -1,26 +1,29 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com>
// Copyright (C) 2020 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "facet_components.h"
#include <igl/triangle_triangle_adjacency.h>
#include "triangle_triangle_adjacency.h"
#include "facet_adjacency_matrix.h"
#include "connected_components.h"
#include <vector>
#include <queue>
template <typename DerivedF, typename DerivedC>
IGL_INLINE void igl::facet_components(
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedC> & C)
{
using namespace std;
typedef typename DerivedF::Index Index;
vector<vector<vector<Index > > > TT;
vector<vector<vector<Index > > > TTi;
triangle_triangle_adjacency(F,TT,TTi);
Eigen::VectorXi counts;
return facet_components(TT,C,counts);
typedef typename DerivedF::Scalar Index;
Eigen::SparseMatrix<Index> A;
igl::facet_adjacency_matrix(F,A);
Eigen::Matrix<Index,Eigen::Dynamic,1> counts;
C = DerivedC::Zero(1,1);
connected_components(A,C,counts);
}
template <
+2
View File
@@ -449,6 +449,8 @@ IGL_INLINE void igl::fast_winding_number(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::fast_winding_number<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
template void igl::fast_winding_number<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, int, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, int, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
template void igl::fast_winding_number<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, int, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template void igl::fast_winding_number<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(igl::FastWindingNumberBVH const&, float, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
+308
View File
@@ -0,0 +1,308 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2020 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "fit_cubic_bezier.h"
#include "bezier.h"
#include "EPS.h"
// Adapted from main.c accompanying
// An Algorithm for Automatically Fitting Digitized Curves
// by Philip J. Schneider
// from "Graphics Gems", Academic Press, 1990
IGL_INLINE void igl::fit_cubic_bezier(
const Eigen::MatrixXd & d,
const double error,
std::vector<Eigen::MatrixXd> & cubics)
{
const int nPts = d.rows();
// Don't attempt to fit curve to single point
if(nPts==1) { return; }
// Avoid using zero tangent
const static auto tangent = [](
const Eigen::MatrixXd & d,
const int i,const int dir)->Eigen::RowVectorXd
{
int j = i;
const int nPts = d.rows();
Eigen::RowVectorXd t;
while(true)
{
// look at next point
j += dir;
if(j < 0 || j>=nPts)
{
// All points are coincident?
// give up and use zero tangent...
return Eigen::RowVectorXd::Zero(1,d.cols());
}
t = d.row(j)-d.row(i);
if(t.squaredNorm() > igl::DOUBLE_EPS)
{
break;
}
}
return t.normalized();
};
Eigen::RowVectorXd tHat1 = tangent(d,0,+1);
Eigen::RowVectorXd tHat2 = tangent(d,nPts-1,-1);
// If first and last points are identically equal, then consider closed
const bool closed = (d.row(0) - d.row(d.rows()-1)).squaredNorm() == 0;
// If closed loop make tangents match
if(closed)
{
tHat1 = (tHat1 - tHat2).eval().normalized();
tHat2 = -tHat1;
}
cubics.clear();
fit_cubic_bezier_substring(d,0,nPts-1,tHat1,tHat2,error,closed,cubics);
};
IGL_INLINE void igl::fit_cubic_bezier_substring(
const Eigen::MatrixXd & d,
const int first,
const int last,
const Eigen::RowVectorXd & tHat1,
const Eigen::RowVectorXd & tHat2,
const double error,
const bool force_split,
std::vector<Eigen::MatrixXd> & cubics)
{
// Helper functions
// Evaluate a Bezier curve at a particular parameter value
const static auto bezier_eval = [](const Eigen::MatrixXd & V, const double t)
{ Eigen::RowVectorXd P; bezier(V,t,P); return P; };
//
// Use Newton-Raphson iteration to find better root.
const static auto NewtonRaphsonRootFind = [](
const Eigen::MatrixXd & Q,
const Eigen::RowVectorXd & P,
const double u)->double
{
/* Compute Q(u) */
Eigen::RowVectorXd Q_u = bezier_eval(Q, u);
Eigen::MatrixXd Q1(3,Q.cols());
Eigen::MatrixXd Q2(2,Q.cols());
/* Generate control vertices for Q' */
for (int i = 0; i <= 2; i++)
{
Q1.row(i) = (Q.row(i+1) - Q.row(i)) * 3.0;
}
/* Generate control vertices for Q'' */
for (int i = 0; i <= 1; i++)
{
Q2.row(i) = (Q1.row(i+1) - Q1.row(i)) * 2.0;
}
/* Compute Q'(u) and Q''(u) */
const Eigen::RowVectorXd Q1_u = bezier_eval(Q1, u);
const Eigen::RowVectorXd Q2_u = bezier_eval(Q2, u);
/* Compute f(u)/f'(u) */
const double numerator = ((Q_u-P).array() * Q1_u.array()).array().sum();
const double denominator =
Q1_u.squaredNorm() + ((Q_u-P).array() * Q2_u.array()).array().sum();
/* u = u - f(u)/f'(u) */
return u - (numerator/denominator);
};
const static auto ComputeMaxError = [](
const Eigen::MatrixXd & d,
const int first,
const int last,
const Eigen::MatrixXd & bezCurve,
const Eigen::VectorXd & u,
int & splitPoint)->double
{
Eigen::VectorXd E(last - (first+1));
splitPoint = (last-first + 1)/2;
double maxDist = 0.0;
for (int i = first + 1; i < last; i++)
{
Eigen::RowVectorXd P = bezier_eval(bezCurve, u(i-first));
const double dist = (P-d.row(i)).squaredNorm();
E(i-(first+1)) = dist;
if (dist >= maxDist)
{
maxDist = dist;
// Worst offender
splitPoint = i;
}
}
//const double half_total = E.array().sum()/2;
//double run = 0;
//for (int i = first + 1; i < last; i++)
//{
// run += E(i-(first+1));
// if(run>half_total)
// {
// // When accumulated ½ the error --> more symmetric, but requires more
// // curves
// splitPoint = i;
// break;
// }
//}
return maxDist;
};
const static auto Straight = [](
const Eigen::MatrixXd & d,
const int first,
const int last,
const Eigen::RowVectorXd & tHat1,
const Eigen::RowVectorXd & tHat2,
Eigen::MatrixXd & bezCurve)
{
bezCurve.resize(4,d.cols());
const double dist = (d.row(last)-d.row(first)).norm()/3.0;
bezCurve.row(0) = d.row(first);
bezCurve.row(1) = d.row(first) + tHat1*dist;
bezCurve.row(2) = d.row(last) + tHat2*dist;
bezCurve.row(3) = d.row(last);
};
const static auto GenerateBezier = [](
const Eigen::MatrixXd & d,
const int first,
const int last,
const Eigen::VectorXd & uPrime,
const Eigen::RowVectorXd & tHat1,
const Eigen::RowVectorXd & tHat2,
Eigen::MatrixXd & bezCurve)
{
bezCurve.resize(4,d.cols());
const int nPts = last - first + 1;
const static auto B0 = [](const double u)->double
{ double tmp = 1.0 - u; return (tmp * tmp * tmp);};
const static auto B1 = [](const double u)->double
{ double tmp = 1.0 - u; return (3 * u * (tmp * tmp));};
const static auto B2 = [](const double u)->double
{ double tmp = 1.0 - u; return (3 * u * u * tmp); };
const static auto B3 = [](const double u)->double
{ return (u * u * u); };
/* Compute the A's */
std::vector<std::vector<Eigen::RowVectorXd> > A(nPts);
for (int i = 0; i < nPts; i++)
{
Eigen::RowVectorXd v1 = tHat1*B1(uPrime(i));
Eigen::RowVectorXd v2 = tHat2*B2(uPrime(i));
A[i] = {v1,v2};
}
/* Create the C and X matrices */
Eigen::MatrixXd C(2,2);
Eigen::VectorXd X(2);
C(0,0) = 0.0;
C(0,1) = 0.0;
C(1,0) = 0.0;
C(1,1) = 0.0;
X(0) = 0.0;
X(1) = 0.0;
for( int i = 0; i < nPts; i++)
{
C(0,0) += A[i][0].dot(A[i][0]);
C(0,1) += A[i][0].dot(A[i][1]);
C(1,0) = C(0,1);
C(1,1) += A[i][1].dot(A[i][1]);
const Eigen::RowVectorXd tmp =
d.row(first+i)-(
d.row(first)*B0(uPrime(i))+
d.row(first)*B1(uPrime(i))+
d.row(last)*B2(uPrime(i))+
d.row(last)*B3(uPrime(i)));
X(0) += A[i][0].dot(tmp);
X(1) += A[i][1].dot(tmp);
}
/* Compute the determinants of C and X */
double det_C0_C1 = C(0,0) * C(1,1) - C(1,0) * C(0,1);
const double det_C0_X = C(0,0) * X(1) - C(0,1) * X(0);
const double det_X_C1 = X(0) * C(1,1) - X(1) * C(0,1);
/* Finally, derive alpha values */
if (det_C0_C1 == 0.0)
{
det_C0_C1 = (C(0,0) * C(1,1)) * 10e-12;
}
const double alpha_l = det_X_C1 / det_C0_C1;
const double alpha_r = det_C0_X / det_C0_C1;
/* If alpha negative, use the Wu/Barsky heuristic (see text) */
/* (if alpha is 0, you get coincident control points that lead to
* divide by zero in any subsequent NewtonRaphsonRootFind() call. */
if (alpha_l < 1.0e-6 || alpha_r < 1.0e-6)
{
return Straight(d,first,last,tHat1,tHat2,bezCurve);
}
bezCurve.row(0) = d.row(first);
bezCurve.row(1) = d.row(first) + tHat1*alpha_l;
bezCurve.row(2) = d.row(last) + tHat2*alpha_r;
bezCurve.row(3) = d.row(last);
};
const int maxIterations = 4;
// This is a bad idea if error<1 ...
//const double iterationError = error * error;
const double iterationError = 100 * error;
const int nPts = last - first + 1;
/* Use heuristic if region only has two points in it */
if(nPts == 2)
{
Eigen::MatrixXd bezCurve;
Straight(d,first,last,tHat1,tHat2,bezCurve);
cubics.push_back(bezCurve);
return;
}
// ChordLengthParameterize
Eigen::VectorXd u(last-first+1);
u(0) = 0;
for (int i = first+1; i <= last; i++)
{
u(i-first) = u(i-first-1) + (d.row(i)-d.row(i-1)).norm();
}
for (int i = first + 1; i <= last; i++)
{
u(i-first) = u(i-first) / u(last-first);
}
Eigen::MatrixXd bezCurve;
GenerateBezier(d, first, last, u, tHat1, tHat2, bezCurve);
int splitPoint;
double maxError = ComputeMaxError(d, first, last, bezCurve, u, splitPoint);
if (!force_split && maxError < error)
{
cubics.push_back(bezCurve);
return;
}
/* If error not too large, try some reparameterization */
/* and iteration */
if (maxError < iterationError)
{
for (int i = 0; i < maxIterations; i++)
{
Eigen::VectorXd uPrime;
// Reparameterize
uPrime.resize(last-first+1);
for (int i = first; i <= last; i++)
{
uPrime(i-first) = NewtonRaphsonRootFind(bezCurve, d.row(i), u(i- first));
}
GenerateBezier(d, first, last, uPrime, tHat1, tHat2, bezCurve);
maxError = ComputeMaxError(d, first, last, bezCurve, uPrime, splitPoint);
if (!force_split && maxError < error) {
cubics.push_back(bezCurve);
return;
}
u = uPrime;
}
}
/* Fitting failed -- split at max error point and fit recursively */
const Eigen::RowVectorXd tHatCenter =
(d.row(splitPoint-1)-d.row(splitPoint+1)).normalized();
//foobar
fit_cubic_bezier_substring(
d,first,splitPoint,tHat1,tHatCenter,error,false,cubics);
fit_cubic_bezier_substring(
d,splitPoint,last,(-tHatCenter).eval(),tHat2,error,false,cubics);
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
#endif
+57
View File
@@ -0,0 +1,57 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2020 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef FIT_CUBIC_BEZIER_H
#define FIT_CUBIC_BEZIER_H
#include "igl_inline.h"
#include <Eigen/Core>
#include <vector>
namespace igl
{
// Fit a cubic bezier spline (G1 continuous) to an ordered list of input
// points in any dimension, according to "An algorithm for automatically
// fitting digitized curves" [Schneider 1990].
//
// Inputs:
// d #d by dim list of points along a curve to be fit with a cubic bezier
// spline (should probably be roughly uniformly spaced). If d(0)==d(end),
// then will treat as a closed curve.
// error maximum squared distance allowed
// Output:
// cubics #cubics list of 4 by dim lists of cubic control points
IGL_INLINE void fit_cubic_bezier(
const Eigen::MatrixXd & d,
const double error,
std::vector<Eigen::MatrixXd> & cubics);
// Recursive helper function.
//
// Inputs:
// first index of first point in d of substring
// last index of last point in d of substring
// tHat1 tangent to use at beginning of spline
// tHat2 tangent to use at end of spline
// error see above
// force_split whether to force a split (i.e., force a recursive call)
// cubics running list of cubics so far
// Outputs
// cubics running list of cubics so far (new cubics appended)
IGL_INLINE void fit_cubic_bezier_substring(
const Eigen::MatrixXd & d,
const int first,
const int last,
const Eigen::RowVectorXd & tHat1,
const Eigen::RowVectorXd & tHat2,
const double error,
const bool force_split,
std::vector<Eigen::MatrixXd> & cubics);
}
#ifndef IGL_STATIC_LIBRARY
#include "fit_cubic_bezier.cpp"
#endif
#endif
+1 -1
View File
@@ -160,7 +160,7 @@ IGL_INLINE void igl::flip_edge(
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::flip_edge<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, int>(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, unsigned long);
template void igl::flip_edge<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, int>(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, unsigned long);
template void igl::flip_edge<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, int>(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, const size_t);
#ifdef WIN32
template void igl::flip_edge<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, int>(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, unsigned __int64);
template void igl::flip_edge<class Eigen::Matrix<int,-1,-1,0,-1,-1>,class Eigen::Matrix<int,-1,2,0,-1,2>,class Eigen::Matrix<int,-1,2,0,-1,2>,class Eigen::Matrix<int,-1,1,0,-1,1>,int>(class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,2,0,-1,2> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,2,0,-1,2> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<int,-1,1,0,-1,1> > &,class std::vector<class std::vector<int,class std::allocator<int> >,class std::allocator<class std::vector<int,class std::allocator<int> > > > &,unsigned __int64);
+6 -6
View File
@@ -11,8 +11,8 @@
#include <vector>
template <typename DerivedV, typename DerivedF, typename DerivedX>
IGL_INLINE void igl::flipped_triangles(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedX> & X)
{
assert(V.cols() == 2 && "V should contain 2D positions");
@@ -40,8 +40,8 @@ IGL_INLINE void igl::flipped_triangles(
template <typename DerivedV, typename DerivedF>
IGL_INLINE Eigen::VectorXi igl::flipped_triangles(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F)
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F)
{
Eigen::VectorXi X;
flipped_triangles(V,F,X);
@@ -50,6 +50,6 @@ IGL_INLINE Eigen::VectorXi igl::flipped_triangles(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::flipped_triangles<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template Eigen::Matrix<int, -1, 1, 0, -1, 1> igl::flipped_triangles<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
template void igl::flipped_triangles<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template Eigen::Matrix<int, -1, 1, 0, -1, 1> igl::flipped_triangles<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
#endif
+4 -4
View File
@@ -22,13 +22,13 @@ namespace igl
// Wrapper with return type
template <typename DerivedV, typename DerivedF, typename DerivedX>
IGL_INLINE void flipped_triangles(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedX> & X);
template <typename Scalar, typename Index>
IGL_INLINE Eigen::VectorXi flipped_triangles(
const Eigen::PlainObjectBase<Scalar> & V,
const Eigen::PlainObjectBase<Index> & F);
const Eigen::MatrixBase<Scalar> & V,
const Eigen::MatrixBase<Index> & F);
}
+14 -14
View File
@@ -1,41 +1,41 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2016 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "flood_fill.h"
#include <limits>
template <typename Derivedres, typename DerivedS>
IGL_INLINE void igl::flood_fill(
const Eigen::MatrixBase<Derivedres>& res,
const Eigen::MatrixBase<Derivedres>& res,
Eigen::PlainObjectBase<DerivedS> & S)
{
using namespace Eigen;
using namespace std;
typedef typename DerivedS::Scalar Scalar;
const auto flood = [&res,&S] (
const int xi,
const int yi,
const int xi,
const int yi,
const int zi,
const int signed_xi,
const int signed_yi,
const int signed_xi,
const int signed_yi,
const int signed_zi,
const Scalar s)
{
// flood fill this value back on this row
for(int bxi = xi;signed_xi<--bxi;)
{
S(bxi+res(0)*(yi + res(1)*zi)) = s;
S(bxi+int(res(0))*(yi + int(res(1))*zi)) = s;
}
// flood fill this value back on any previous rows
for(int byi = yi;signed_yi<--byi;)
{
for(int xi = 0;xi<res(0);xi++)
{
S(xi+res(0)*(byi + res(1)*zi)) = s;
S(xi+int(res(0))*(byi + int(res(1))*zi)) = s;
}
}
// flood fill this value back on any previous "sheets"
@@ -45,7 +45,7 @@ IGL_INLINE void igl::flood_fill(
{
for(int xi = 0;xi<res(0);xi++)
{
S(xi+res(0)*(yi + res(1)*bzi)) = s;
S(xi+int(res(0))*(yi + int(res(1))*bzi)) = s;
}
}
}
@@ -57,7 +57,7 @@ IGL_INLINE void igl::flood_fill(
int signed_yi = -1;
if(zi != 0)
{
s = S(0+res(0)*(0 + res(1)*(zi-1)));
s = S(0+int(res(0))*(0 + int(res(1))*(zi-1)));
}
for(int yi = 0;yi<res(1);yi++)
{
@@ -65,7 +65,7 @@ IGL_INLINE void igl::flood_fill(
int signed_xi = -1;
if(yi != 0)
{
s = S(0+res(0)*(yi-1 + res(1)*zi));
s = S(0+int(res(0))*(yi-1 + int(res(1))*zi));
}
for(int xi = 0;xi<res(0);xi++)
{
+2
View File
@@ -48,6 +48,8 @@ IGL_INLINE void igl::grid(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::grid<Eigen::Matrix<int, 3, 1, 0, 3, 1>, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, 3, 1, 0, 3, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template void igl::grid<Eigen::Matrix<int, 2, 1, 0, 2, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, 2, 1, 0, 2, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template void igl::grid<Eigen::Matrix<int, 1, 3, 1, 1, 3>, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
+6 -12
View File
@@ -3,7 +3,6 @@
#include <string.h>
#include "is_stl.h"
#include "ply.h"
IGL_INLINE void igl::guess_extension(FILE * fp, std::string & guess)
{
@@ -20,18 +19,13 @@ IGL_INLINE void igl::guess_extension(FILE * fp, std::string & guess)
rewind(fp);
return f;
};
const auto is_ply = [](FILE * ply_file) -> bool
const auto is_ply = [](FILE * fp) -> bool
{
int nelems;
char ** elem_names;
igl::ply::PlyFile * in_ply = igl::ply::ply_read(ply_file,&nelems,&elem_names);
if(in_ply==NULL)
{
return false;
}
free(in_ply);
rewind(ply_file);
return true;
char header[1000];
const std::string PLY("ply");
bool f = (fscanf(fp,"%s\n",header)==1 && (std::string(header).compare(0, PLY.length(), PLY)==0 ));
rewind(fp);
return f;
};
const auto is_wrl = [](FILE * wrl_file)->bool
{
+6 -5
View File
@@ -28,7 +28,7 @@ IGL_INLINE void igl::histc(
if(B(j) >= 0)
{
#pragma omp atomic
N(B(j))++;
N(int(B(j)))++;
}
}
}
@@ -99,13 +99,14 @@ IGL_INLINE void igl::histc(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, 1, 1, 0, 1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >&);
template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::histc<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<double, 1, 1, 0, 1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 1, 0, 1, 1> >&);
template void igl::histc<Eigen::Matrix<float, -1, 1, 0, -1, 1>, Eigen::Matrix<float, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::histc<Eigen::Matrix<float, -1, 1, 0, -1, 1>, Eigen::Matrix<float, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#if EIGEN_VERSION_AT_LEAST(3,3,0)
#else
template void igl::histc<Eigen::CwiseNullaryOp<Eigen::internal::linspaced_op<int, true>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::CwiseNullaryOp<Eigen::internal::linspaced_op<int, true>, Eigen::Matrix<int, -1, 1, 0, -1, 1> > > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+8 -8
View File
@@ -1,27 +1,27 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2016 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "inradius.h"
#include "edge_lengths.h"
#include "doublearea.h"
template <
typename DerivedV,
typename DerivedV,
typename DerivedF,
typename DerivedR>
IGL_INLINE void igl::inradius(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedR> & r)
{
Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,3> l;
Eigen::Matrix<typename DerivedV::Scalar,Eigen::Dynamic,1> R;
igl::edge_lengths(V,F,l);
// If R is the circumradius,
// If R is the circumradius,
// R*r = (abc)/(2*(a+b+c))
// R = abc/(4*area)
// r(abc/(4*area)) = (abc)/(2*(a+b+c))
+7 -7
View File
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2016 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_INRADIUS_H
#define IGL_INRADIUS_H
@@ -20,12 +20,12 @@ namespace igl
// R #F list of inradii
//
template <
typename DerivedV,
typename DerivedV,
typename DerivedF,
typename DerivedR>
IGL_INLINE void inradius(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedR> & R);
}
#ifndef IGL_STATIC_LIBRARY
+7 -38
View File
@@ -34,6 +34,8 @@ IGL_INLINE bool igl::is_edge_manifold(
// Find unique undirected edges and mapping
VectorXF _;
unique_simplices(allE,E,_,EMAP);
// could use "face_occurrences.h", but that implementation uses
// vector<vector>>
std::vector<typename DerivedF::Index> count(E.rows(),0);
for(Index e = 0;e<EMAP.rows();e++)
{
@@ -56,49 +58,16 @@ template <typename DerivedF>
IGL_INLINE bool igl::is_edge_manifold(
const Eigen::MatrixBase<DerivedF>& F)
{
// TODO: It's bothersome that this is not calling/reusing the code from the
// overload above. This could result in disagreement.
// List of edges (i,j,f,c) where edge i<j is associated with corner i of face
// f
std::vector<std::vector<int> > TTT;
for(int f=0;f<F.rows();++f)
for (int i=0;i<3;++i)
{
// v1 v2 f ei
int v1 = F(f,i);
int v2 = F(f,(i+1)%3);
if (v1 > v2) std::swap(v1,v2);
std::vector<int> r(4);
r[0] = v1; r[1] = v2;
r[2] = f; r[3] = i;
TTT.push_back(r);
}
// Sort lexicographically
std::sort(TTT.begin(),TTT.end());
for(int i=2;i<(int)TTT.size();++i)
{
// Check any edges occur 3 times
std::vector<int>& r1 = TTT[i-2];
std::vector<int>& r2 = TTT[i-1];
std::vector<int>& r3 = TTT[i];
if ( (r1[0] == r2[0] && r2[0] == r3[0])
&&
(r1[1] == r2[1] && r2[1] == r3[1]) )
{
return false;
}
}
return true;
Eigen::Array<bool,Eigen::Dynamic,Eigen::Dynamic> BF;
Eigen::Array<bool,Eigen::Dynamic,1> BE;
Eigen::MatrixXi E;
Eigen::VectorXi EMAP;
return is_edge_manifold(F,BF,E,EMAP,BE);
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template bool igl::is_edge_manifold<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> > const&);
// generated by autoexplicit.sh
//template bool igl::is_edge_manifold<double>(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<int, -1, -1, 0, -1, -1> const&);
template bool igl::is_edge_manifold<Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
template bool igl::is_edge_manifold<Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&);
#endif
+6 -5
View File
@@ -13,14 +13,15 @@
namespace igl
{
// check if the mesh is edge-manifold
// check if the mesh is edge-manifold (every edge is incident one one face
// (boundary) or two oppositely oriented faces).
//
// Inputs:
// F #F by 3 list of triangle indices
// Returns whether mesh is edge manifold.
//
// Known Bugs:
// Does not check for non-manifold vertices
// Outputs:
// BF #F by 3 list of flags revealing if edge opposite corresponding vertex
// is non-manifold.
// Returns true iff all edges are manifold
//
// See also: is_vertex_manifold
template <
+3 -1
View File
@@ -1,4 +1,4 @@
#include "is_stl.h"
#include "is_stl.h"
#include <string>
IGL_INLINE bool igl::is_stl(FILE * stl_file, bool & is_ascii)
{
@@ -41,6 +41,8 @@ IGL_INLINE bool igl::is_stl(FILE * stl_file, bool & is_ascii)
f = false;
goto finish;
}
// make sure sscanf doesn't read past the end of the header, overwriting stack
header[sizeof(header)-1]='\0';
sscanf(header,"%s",solid);
if(std::string("solid") == solid)
+2 -3
View File
@@ -95,13 +95,12 @@ IGL_INLINE void igl::lexicographic_triangulation(
for (auto itr=left_itr; itr!=right_itr; itr++) {
if (itr == boundary.end()) itr = boundary.begin();
if (itr == right_itr) break;
if (itr == left_itr || itr == right_itr) continue;
if (itr == left_itr) continue;
itr = boundary.erase(itr);
if (itr == boundary.begin()) {
itr = boundary.end();
} else {
itr--;
}
itr--;
}
if (right_itr == boundary.begin()) {
+6
View File
@@ -123,6 +123,12 @@ IGL_INLINE bool igl::list_to_matrix(const std::vector<T > & V,Eigen::PlainObject
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template bool igl::list_to_matrix<int, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >&);
// generated by autoexplicit.sh
template bool igl::list_to_matrix<double, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template bool igl::list_to_matrix<double, Eigen::Matrix<float, -1, 2, 1, -1, 2> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 2, 1, -1, 2> >&);
// generated by autoexplicit.sh
template bool igl::list_to_matrix<double, Eigen::Matrix<float, -1, 3, 0, -1, 3> >(std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&);
// generated by autoexplicit.sh
// generated by autoexplicit.sh
+2
View File
@@ -80,4 +80,6 @@ template void igl::matlab::parse_rhs_index<Eigen::Matrix<int, -1, -1, 0, -1, -1>
template void igl::matlab::parse_rhs_double<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(mxArray_tag const**, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template void igl::matlab::parse_rhs_index<Eigen::Matrix<int, -1, 3, 1, -1, 3> >(mxArray_tag const**, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
template void igl::matlab::parse_rhs_double<Eigen::Matrix<double, -1, 3, 1, -1, 3> >(mxArray_tag const**, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&);
template void igl::matlab::parse_rhs_double<Eigen::Matrix<double, -1, 1, 0, -1, 1> >(mxArray_tag const**, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
template void igl::matlab::parse_rhs_double<Eigen::Matrix<float, -1, -1, 0, -1, -1> >(mxArray_tag const**, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
#endif
+38 -12
View File
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "prepare_lhs.h"
#include <algorithm>
@@ -14,10 +14,10 @@ IGL_INLINE void igl::matlab::prepare_lhs_double(
{
using namespace std;
using namespace Eigen;
const int m = V.rows();
const int n = V.cols();
const auto m = V.rows();
const auto n = V.cols();
plhs[0] = mxCreateDoubleMatrix(m,n, mxREAL);
Eigen::Map< Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> >
Eigen::Map< Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> >
map(mxGetPr(plhs[0]),m,n);
map = V.template cast<double>();
}
@@ -29,11 +29,11 @@ IGL_INLINE void igl::matlab::prepare_lhs_logical(
{
using namespace std;
using namespace Eigen;
const int m = V.rows();
const int n = V.cols();
const auto m = V.rows();
const auto n = V.cols();
plhs[0] = mxCreateLogicalMatrix(m,n);
mxLogical * Vp = static_cast<mxLogical*>(mxGetData(plhs[0]));
Eigen::Map< Eigen::Matrix<mxLogical,Eigen::Dynamic,Eigen::Dynamic> >
Eigen::Map< Eigen::Matrix<mxLogical,Eigen::Dynamic,Eigen::Dynamic> >
map(static_cast<mxLogical*>(mxGetData(plhs[0])),m,n);
map = V.template cast<mxLogical>();
}
@@ -54,8 +54,8 @@ IGL_INLINE void igl::matlab::prepare_lhs_double(
mxArray *plhs[])
{
using namespace std;
const int m = M.rows();
const int n = M.cols();
const auto m = M.rows();
const auto n = M.cols();
// THIS WILL NOT WORK FOR ROW-MAJOR
assert(n==M.outerSize());
const int nzmax = M.nonZeros();
@@ -84,7 +84,30 @@ IGL_INLINE void igl::matlab::prepare_lhs_double(
}
template <typename Vtype>
IGL_INLINE void igl::matlab::prepare_lhs_double(
const std::vector<Vtype> & V,
mxArray *plhs[])
{
plhs[0] = mxCreateCellMatrix(V.size(), 1);
for(int i=0; i<V.size(); i++)
{
const auto m = V[i].rows();
const auto n = V[i].cols();
mxArray * ai = mxCreateDoubleMatrix(m,n, mxREAL);
Eigen::Map< Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> >
map(mxGetPr(ai),m,n);
map = V[i].template cast<double>();
mxSetCell(plhs[0],i,ai);
}
}
#ifdef IGL_STATIC_LIBRARY
template void igl::matlab::prepare_lhs_double<Eigen::Matrix<double, 3, 3, 0, 3, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 3, 0, 3, 3> > const&, mxArray_tag**);
template void igl::matlab::prepare_lhs_double<Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, mxArray_tag**);
template void igl::matlab::prepare_lhs_index<Eigen::Matrix<double, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> > const&, mxArray_tag**);
template void igl::matlab::prepare_lhs_index<Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, mxArray_tag**);
template void igl::matlab::prepare_lhs_double<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, mxArray_tag**);
@@ -96,4 +119,7 @@ template void igl::matlab::prepare_lhs_index<Eigen::Matrix<int, -1, 3, 1, -1, 3>
template void igl::matlab::prepare_lhs_double<Eigen::Matrix<double, -1, 3, 1, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, mxArray_tag**);
template void igl::matlab::prepare_lhs_double<Eigen::Matrix<int, 1, -1, 1, 1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<int, 1, -1, 1, 1, -1> > const&, mxArray_tag**);
template void igl::matlab::prepare_lhs_double<Eigen::Matrix<int, 1, 3, 1, 1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<int, 1, 3, 1, 1, 3> > const&, mxArray_tag**);
template void igl::matlab::prepare_lhs_double<Eigen::Matrix<float, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> > const&, mxArray_tag**);
template void igl::matlab::prepare_lhs_double<Eigen::Matrix<float, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, mxArray_tag**);
template void igl::matlab::prepare_lhs_double<double>(Eigen::SparseMatrix<double, 0, int> const&, mxArray_tag**);
#endif
+5
View File
@@ -40,6 +40,11 @@ namespace igl
IGL_INLINE void prepare_lhs_double(
const Eigen::SparseMatrix<Vtype> & V,
mxArray *plhs[]);
// Vector of matrices -> cell array of matrices
template <typename Vtype>
IGL_INLINE void prepare_lhs_double(
const std::vector<Vtype> & V,
mxArray *plhs[]);
};
}
#ifndef IGL_STATIC_LIBRARY
+3 -3
View File
@@ -16,8 +16,8 @@ template <
typename DerivedEle,
typename Scalar>
IGL_INLINE void igl::normal_derivative(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedEle> & Ele,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedEle> & Ele,
Eigen::SparseMatrix<Scalar>& DD)
{
using namespace Eigen;
@@ -114,5 +114,5 @@ IGL_INLINE void igl::normal_derivative(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::normal_derivative<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double>(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::SparseMatrix<double, 0, int>&);
template void igl::normal_derivative<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double>(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::SparseMatrix<double, 0, int>&);
#endif
+9 -9
View File
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_NORMAL_DERIVATIVE_H
#define IGL_NORMAL_DERIVATIVE_H
@@ -11,7 +11,7 @@
#include <Eigen/Core>
#include <Eigen/Sparse>
namespace igl
namespace igl
{
// NORMAL_DERIVATIVE Computes the directional derivative **normal** to
// **all** (half-)edges of a triangle mesh (not just boundary edges). These
@@ -27,12 +27,12 @@ namespace igl
// directional derivative with respect to each facet of each element.
//
template <
typename DerivedV,
typename DerivedEle,
typename DerivedV,
typename DerivedEle,
typename Scalar>
IGL_INLINE void normal_derivative(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedEle> & Ele,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedEle> & Ele,
Eigen::SparseMatrix<Scalar>& DD);
}
+24 -15
View File
@@ -220,26 +220,35 @@ R"(#version 150
uniform float specular_exponent;
uniform float lighting_factor;
uniform float texture_factor;
uniform float matcap_factor;
uniform float double_sided;
out vec4 outColor;
void main()
{
vec3 Ia = La * vec3(Kai); // ambient intensity
if(matcap_factor == 1.0f)
{
vec2 uv = normalize(normal_eye).xy * 0.5 + 0.5;
outColor = texture(tex, uv);
}else
{
vec3 Ia = La * vec3(Kai); // ambient intensity
vec3 vector_to_light_eye = light_position_eye - position_eye;
vec3 direction_to_light_eye = normalize (vector_to_light_eye);
float dot_prod = dot (direction_to_light_eye, normalize(normal_eye));
float clamped_dot_prod = max (dot_prod, 0.0);
vec3 Id = Ld * vec3(Kdi) * clamped_dot_prod; // Diffuse intensity
vec3 vector_to_light_eye = light_position_eye - position_eye;
vec3 direction_to_light_eye = normalize (vector_to_light_eye);
float dot_prod = dot (direction_to_light_eye, normalize(normal_eye));
float clamped_dot_prod = abs(max (dot_prod, -double_sided));
vec3 Id = Ld * vec3(Kdi) * clamped_dot_prod; // Diffuse intensity
vec3 reflection_eye = reflect (-direction_to_light_eye, normalize(normal_eye));
vec3 surface_to_viewer_eye = normalize (-position_eye);
float dot_prod_specular = dot (reflection_eye, surface_to_viewer_eye);
dot_prod_specular = float(abs(dot_prod)==dot_prod) * max (dot_prod_specular, 0.0);
float specular_factor = pow (dot_prod_specular, specular_exponent);
vec3 Is = Ls * vec3(Ksi) * specular_factor; // specular intensity
vec4 color = vec4(lighting_factor * (Is + Id) + Ia + (1.0-lighting_factor) * vec3(Kdi),(Kai.a+Ksi.a+Kdi.a)/3);
outColor = mix(vec4(1,1,1,1), texture(tex, texcoordi), texture_factor) * color;
if (fixed_color != vec4(0.0)) outColor = fixed_color;
vec3 reflection_eye = reflect (-direction_to_light_eye, normalize(normal_eye));
vec3 surface_to_viewer_eye = normalize (-position_eye);
float dot_prod_specular = dot (reflection_eye, surface_to_viewer_eye);
dot_prod_specular = float(abs(dot_prod)==dot_prod) * abs(max (dot_prod_specular, -double_sided));
float specular_factor = pow (dot_prod_specular, specular_exponent);
vec3 Is = Ls * vec3(Ksi) * specular_factor; // specular intensity
vec4 color = vec4(lighting_factor * (Is + Id) + Ia + (1.0-lighting_factor) * vec3(Kdi),(Kai.a+Ksi.a+Kdi.a)/3);
outColor = mix(vec4(1,1,1,1), texture(tex, texcoordi), texture_factor) * color;
if (fixed_color != vec4(0.0)) outColor = fixed_color;
}
}
)";
+5
View File
@@ -172,6 +172,8 @@ IGL_INLINE void igl::opengl::ViewerCore::draw(
GLint lighting_factori = glGetUniformLocation(data.meshgl.shader_mesh,"lighting_factor");
GLint fixed_colori = glGetUniformLocation(data.meshgl.shader_mesh,"fixed_color");
GLint texture_factori = glGetUniformLocation(data.meshgl.shader_mesh,"texture_factor");
GLint matcap_factori = glGetUniformLocation(data.meshgl.shader_mesh,"matcap_factor");
GLint double_sidedi = glGetUniformLocation(data.meshgl.shader_mesh,"double_sided");
glUniform1f(specular_exponenti, data.shininess);
glUniform3fv(light_position_eyei, 1, light_position.data());
@@ -185,7 +187,10 @@ IGL_INLINE void igl::opengl::ViewerCore::draw(
{
// Texture
glUniform1f(texture_factori, is_set(data.show_texture) ? 1.0f : 0.0f);
glUniform1f(matcap_factori, is_set(data.use_matcap) ? 1.0f : 0.0f);
glUniform1f(double_sidedi, data.double_sided ? 1.0f : 0.0f);
data.meshgl.draw_mesh(true);
glUniform1f(matcap_factori, 0.0f);
glUniform1f(texture_factori, 0.0f);
}
+60 -41
View File
@@ -23,6 +23,8 @@ IGL_INLINE igl::opengl::ViewerData::ViewerData()
: dirty(MeshGL::DIRTY_ALL),
show_faces (~unsigned(0)),
show_lines (~unsigned(0)),
face_based (false),
double_sided (false),
invert_normals (false),
show_overlay (~unsigned(0)),
show_overlay_depth(~unsigned(0)),
@@ -30,6 +32,7 @@ IGL_INLINE igl::opengl::ViewerData::ViewerData()
show_faceid (false),
show_labels (false),
show_texture (false),
use_matcap (false),
point_size(30),
line_width(0.5f),
line_color(0,0,0,1),
@@ -78,6 +81,7 @@ IGL_INLINE void igl::opengl::ViewerData::set_mesh(
Eigen::Vector3d(GOLD_DIFFUSE[0], GOLD_DIFFUSE[1], GOLD_DIFFUSE[2]),
Eigen::Vector3d(GOLD_SPECULAR[0], GOLD_SPECULAR[1], GOLD_SPECULAR[2]));
// Generates a checkerboard texture
grid_texture();
}
else
@@ -131,6 +135,7 @@ IGL_INLINE void igl::opengl::ViewerData::copy_options(const ViewerCore &from, co
to.set(show_overlay , from.is_set(show_overlay) );
to.set(show_overlay_depth, from.is_set(show_overlay_depth));
to.set(show_texture , from.is_set(show_texture) );
to.set(use_matcap , from.is_set(use_matcap) );
to.set(show_faces , from.is_set(show_faces) );
to.set(show_lines , from.is_set(show_lines) );
}
@@ -184,31 +189,35 @@ IGL_INLINE void igl::opengl::ViewerData::set_colors(const Eigen::MatrixXd &C)
F_material_ambient = ambient(F_material_diffuse);
F_material_specular = specular(F_material_diffuse);
}
else if (C.rows() == V.rows())
else if(C.rows() == V.rows() || C.rows() == F.rows())
{
set_face_based(false);
for (unsigned i=0;i<V_material_diffuse.rows();++i)
// face based colors?
if((C.rows()==F.rows()) && (C.rows() != V.rows() || face_based))
{
if (C.cols() == 3)
V_material_diffuse.row(i) << C.row(i), 1;
else if (C.cols() == 4)
V_material_diffuse.row(i) << C.row(i);
set_face_based(true);
for (unsigned i=0;i<F_material_diffuse.rows();++i)
{
if (C.cols() == 3)
F_material_diffuse.row(i) << C.row(i), 1;
else if (C.cols() == 4)
F_material_diffuse.row(i) << C.row(i);
}
F_material_ambient = ambient(F_material_diffuse);
F_material_specular = specular(F_material_diffuse);
}
V_material_ambient = ambient(V_material_diffuse);
V_material_specular = specular(V_material_diffuse);
}
else if (C.rows() == F.rows())
{
set_face_based(true);
for (unsigned i=0;i<F_material_diffuse.rows();++i)
else/*(C.rows() == V.rows())*/
{
if (C.cols() == 3)
F_material_diffuse.row(i) << C.row(i), 1;
else if (C.cols() == 4)
F_material_diffuse.row(i) << C.row(i);
set_face_based(false);
for (unsigned i=0;i<V_material_diffuse.rows();++i)
{
if (C.cols() == 3)
V_material_diffuse.row(i) << C.row(i), 1;
else if (C.cols() == 4)
V_material_diffuse.row(i) << C.row(i);
}
V_material_ambient = ambient(V_material_diffuse);
V_material_specular = specular(V_material_diffuse);
}
F_material_ambient = ambient(F_material_diffuse);
F_material_specular = specular(F_material_diffuse);
}
else
cerr << "ERROR (set_colors): Please provide a single color, or a color per face or per vertex."<<endl;
@@ -297,7 +306,7 @@ IGL_INLINE void igl::opengl::ViewerData::set_colormap(const Eigen::MatrixXd & CM
(CM.col(2)*255.0).cast<unsigned char>();
set_colors(Eigen::RowVector3d(1,1,1));
set_texture(R,G,B);
show_texture = true;
show_texture = ~unsigned(0);
meshgl.tex_filter = GL_NEAREST;
meshgl.tex_wrap = GL_CLAMP_TO_EDGE;
}
@@ -449,7 +458,10 @@ IGL_INLINE void igl::opengl::ViewerData::clear()
labels_strings.clear();
face_based = false;
double_sided = false;
invert_normals = false;
show_texture = false;
use_matcap = false;
}
IGL_INLINE void igl::opengl::ViewerData::compute_normals()
@@ -504,25 +516,33 @@ IGL_INLINE void igl::opengl::ViewerData::uniform_colors(
dirty |= MeshGL::DIRTY_SPECULAR | MeshGL::DIRTY_DIFFUSE | MeshGL::DIRTY_AMBIENT;
}
IGL_INLINE void igl::opengl::ViewerData::normal_matcap()
{
const int size = 512;
texture_R.resize(size, size);
texture_G.resize(size, size);
texture_B.resize(size, size);
const Eigen::Vector3d navy(0.3,0.3,0.5);
static const auto clamp = [](double t){ return std::max(std::min(t,1.0),0.0);};
for(int i = 0;i<size;i++)
{
const double x = (double(i)/double(size-1)*2.-1.);
for(int j = 0;j<size;j++)
{
const double y = (double(j)/double(size-1)*2.-1.);
const double z = sqrt(1.0-std::min(x*x+y*y,1.0));
Eigen::Vector3d C = Eigen::Vector3d(x*0.5+0.5,y*0.5+0.5,z);
texture_R(i,j) = clamp(C(0))*255;
texture_G(i,j) = clamp(C(1))*255;
texture_B(i,j) = clamp(C(2))*255;
}
}
texture_A.setConstant(texture_R.rows(),texture_R.cols(),255);
dirty |= MeshGL::DIRTY_TEXTURE;
}
IGL_INLINE void igl::opengl::ViewerData::grid_texture()
{
// Don't do anything for an empty mesh
if(V.rows() == 0)
{
V_uv.resize(V.rows(),2);
return;
}
if (V_uv.rows() == 0)
{
V_uv = V.block(0, 0, V.rows(), 2);
V_uv.col(0) = V_uv.col(0).array() - V_uv.col(0).minCoeff();
V_uv.col(0) = V_uv.col(0).array() / V_uv.col(0).maxCoeff();
V_uv.col(1) = V_uv.col(1).array() - V_uv.col(1).minCoeff();
V_uv.col(1) = V_uv.col(1).array() / V_uv.col(1).maxCoeff();
V_uv = V_uv.array() * 10;
dirty |= MeshGL::DIRTY_TEXTURE;
}
unsigned size = 128;
unsigned size2 = size/2;
texture_R.resize(size, size);
@@ -684,8 +704,7 @@ IGL_INLINE void igl::opengl::ViewerData::updateGL(
data.F_uv(i,j) : data.F(i,j)).cast<float>();
}
}
}
else
} else
{
if (meshgl.dirty & MeshGL::DIRTY_POSITION)
{
@@ -725,7 +744,7 @@ IGL_INLINE void igl::opengl::ViewerData::updateGL(
meshgl.F_vbo.row(i) << i*3+0, i*3+1, i*3+2;
}
if (meshgl.dirty & MeshGL::DIRTY_UV)
if( (meshgl.dirty & MeshGL::DIRTY_UV) && data.V_uv.rows()>0)
{
meshgl.V_uv_vbo.resize(data.F.rows()*3,2);
for (unsigned i=0; i<data.F.rows();++i)
+9 -1
View File
@@ -183,7 +183,10 @@ public:
const Eigen::Vector4d& diffuse,
const Eigen::Vector4d& specular);
// Generates a default grid texture
// Generate a normal image matcap
IGL_INLINE void normal_matcap();
// Generates a default grid texture (without uvs)
IGL_INLINE void grid_texture();
// Copy visualization options from one viewport to another
@@ -240,6 +243,9 @@ public:
// Enable per-face or per-vertex properties
bool face_based;
// Enable double-sided lighting on faces
bool double_sided;
// Invert mesh normals
bool invert_normals;
@@ -250,6 +256,7 @@ public:
unsigned int show_overlay;
unsigned int show_overlay_depth;
unsigned int show_texture;
unsigned int use_matcap;
unsigned int show_faces;
unsigned int show_lines;
bool show_vertid; // shared across viewports for now
@@ -321,6 +328,7 @@ namespace igl
SERIALIZE_MEMBER(show_faceid);
SERIALIZE_MEMBER(show_labels);
SERIALIZE_MEMBER(show_texture);
SERIALIZE_MEMBER(double_sided);
SERIALIZE_MEMBER(point_size);
SERIALIZE_MEMBER(line_width);
SERIALIZE_MEMBER(line_color);
+17 -10
View File
@@ -210,13 +210,18 @@ namespace glfw
glfwGetWindowSize(window, &width_window, &height_window);
highdpi = windowWidth/width_window;
glfw_window_size(window,width_window,height_window);
//opengl.init();
for(int i=0;i<core_list.size(); i++)
{
core_list[i].align_camera_center(data().V,data().F);
}
// Initialize IGL viewer
init();
for(auto &core : this->core_list)
{
for(auto &data : this->data_list)
{
if(data.is_visible & core.id)
{
this->core(core.id).align_camera_center(data.V, data.F);
}
}
}
return EXIT_SUCCESS;
}
@@ -349,6 +354,7 @@ namespace glfw
const std::string usage(R"(igl::opengl::glfw::Viewer usage:
[drag] Rotate scene
A,a Toggle animation (tight draw loop)
D,d Toggle double sided lighting
F,f Toggle face based
I,i Toggle invert normals
L,l Toggle wireframe
@@ -441,11 +447,6 @@ namespace glfw
Eigen::Vector3d(255.0/255.0,228.0/255.0,58.0/255.0),
Eigen::Vector3d(255.0/255.0,235.0/255.0,80.0/255.0));
// Alec: why?
if (data().V_uv.rows() == 0)
{
data().grid_texture();
}
for(int i=0;i<core_list.size(); i++)
core_list[i].align_camera_center(data().V,data().F);
@@ -522,6 +523,12 @@ namespace glfw
core().is_animating = !core().is_animating;
return true;
}
case 'D':
case 'd':
{
data().double_sided = !data().double_sided;
return true;
}
case 'F':
case 'f':
{
+13 -13
View File
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "orient_outward.h"
#include "per_face_normals.h"
@@ -12,15 +12,15 @@
#include <iostream>
template <
typename DerivedV,
typename DerivedF,
typename DerivedC,
typename DerivedFF,
typename DerivedV,
typename DerivedF,
typename DerivedC,
typename DerivedFF,
typename DerivedI>
IGL_INLINE void igl::orient_outward(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::PlainObjectBase<DerivedC> & C,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedC> & C,
Eigen::PlainObjectBase<DerivedFF> & FF,
Eigen::PlainObjectBase<DerivedI> & I)
{
@@ -90,7 +90,7 @@ IGL_INLINE void igl::orient_outward(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::orient_outward<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template void igl::orient_outward<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template void igl::orient_outward<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template void igl::orient_outward<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#endif
+11 -11
View File
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_ORIENT_OUTWARD_H
#define IGL_ORIENT_OUTWARD_H
@@ -23,15 +23,15 @@ namespace igl
// FF(I,:) = fliplr(F(I,:)) (OK if &FF = &F)
// I max(C)+1 list of whether face has been flipped
template <
typename DerivedV,
typename DerivedF,
typename DerivedC,
typename DerivedFF,
typename DerivedV,
typename DerivedF,
typename DerivedC,
typename DerivedFF,
typename DerivedI>
IGL_INLINE void orient_outward(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::PlainObjectBase<DerivedC> & C,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedC> & C,
Eigen::PlainObjectBase<DerivedFF> & FF,
Eigen::PlainObjectBase<DerivedI> & I);
};
+2
View File
@@ -47,6 +47,8 @@ IGL_INLINE void igl::oriented_facets(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::oriented_facets<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1>, Eigen::Matrix<unsigned int, -1, 2, 0, -1, 2> >(Eigen::MatrixBase<Eigen::Matrix<unsigned int, -1, -1, 1, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, 2, 0, -1, 2> >&);
// generated by autoexplicit.sh
template void igl::oriented_facets<Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::oriented_facets<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::oriented_facets<Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 2, 0, -1, 2> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&);
+9 -1
View File
@@ -1,4 +1,4 @@
// This file is part of libigl, a simple c++ geometry processing library.
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com>
//
@@ -115,6 +115,14 @@ IGL_INLINE void igl::per_edge_normals(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::per_edge_normals<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, igl::PerEdgeNormalsWeightingType, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template void igl::per_edge_normals<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, igl::PerEdgeNormalsWeightingType, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template void igl::per_edge_normals<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::PerEdgeNormalsWeightingType, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template void igl::per_edge_normals<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, igl::PerEdgeNormalsWeightingType, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template void igl::per_edge_normals<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, igl::PerEdgeNormalsWeightingType, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template void igl::per_edge_normals<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, igl::PerEdgeNormalsWeightingType, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+6
View File
@@ -105,6 +105,12 @@ IGL_INLINE void igl::per_face_normals_stable(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::per_face_normals<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template void igl::per_face_normals<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template void igl::per_face_normals<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
// Nonsense template
namespace igl{template<> void per_face_normals<Eigen::Matrix<double, -1, 2, 0, -1, 2>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&){} }
// generated by autoexplicit.sh
+6
View File
@@ -122,6 +122,12 @@ IGL_INLINE void igl::per_vertex_normals(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::per_vertex_normals<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, igl::PerVertexNormalsWeightingType, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template void igl::per_vertex_normals<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, igl::PerVertexNormalsWeightingType, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template void igl::per_vertex_normals<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, igl::PerVertexNormalsWeightingType, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template void igl::per_vertex_normals<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, igl::PerVertexNormalsWeightingType, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
template void igl::per_vertex_normals<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, igl::PerVertexNormalsWeightingType, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&);
template void igl::per_vertex_normals<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, igl::PerVertexNormalsWeightingType, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&);
-3180
View File
File diff suppressed because it is too large Load Diff
+13 -10
View File
@@ -194,29 +194,32 @@ namespace igl
template <> IGL_INLINE void pseudonormal_test(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&){assert(false);};
template <> IGL_INLINE void pseudonormal_test(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&){assert(false);};
template <> IGL_INLINE void pseudonormal_test(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&, float&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&) {assert(false);};
template <> IGL_INLINE void pseudonormal_test(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&, float&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&){assert(false);};
template <> IGL_INLINE void pseudonormal_test(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&, float&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&){assert(false);};
template <> IGL_INLINE void pseudonormal_test(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&){assert(false);};
template <> IGL_INLINE void pseudonormal_test(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&){assert(false);};
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::pseudonormal_test<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, double, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
template void igl::pseudonormal_test<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, 1, 2, 1, 1, 2>, double, Eigen::Matrix<double, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&);
// NEW
template void igl::pseudonormal_test<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<float, 1, 3, 1, 1, 3>, Eigen::Matrix<float, 1, 3, 1, 1, 3>, float, Eigen::Matrix<float, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> >&, float&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> >&);
template void igl::pseudonormal_test<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<float, 1, 3, 1, 1, 3>, Eigen::Matrix<float, 1, 3, 1, 1, 3>, float, Eigen::Matrix<float, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> >&, float&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> >&);
template void igl::pseudonormal_test<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, 1, 2, 1, 1, 2>, Eigen::Matrix<float, 1, 2, 1, 1, 2>, float, Eigen::Matrix<float, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&, float&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&);
template void igl::pseudonormal_test<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<float, 1, 2, 1, 1, 2>, Eigen::Matrix<float, 1, 2, 1, 1, 2>, float, Eigen::Matrix<float, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&, float&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&);
template void igl::pseudonormal_test<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, 1, 2, 1, 1, 2>, double, Eigen::Matrix<double, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&);
// OLD
template void igl::pseudonormal_test<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, double, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
// generated by autoexplicit.sh
template void igl::pseudonormal_test<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<float, 1, 3, 1, 1, 3>, Eigen::Matrix<float, 1, 3, 1, 1, 3>, float, Eigen::Matrix<float, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> >&, float&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> >&);
// generated by autoexplicit.sh
// generated by autoexplicit.sh
// generated by autoexplicit.sh
// generated by autoexplicit.sh
template void igl::pseudonormal_test<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<float, 1, 3, 1, 1, 3>, Eigen::Matrix<float, 1, -1, 1, 1, -1>, float, Eigen::Matrix<float, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, -1, 1, 1, -1> >&, float&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> >&);
// generated by autoexplicit.sh
template void igl::pseudonormal_test<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, 1, 2, 1, 1, 2>, Eigen::Matrix<float, 1, -1, 1, 1, -1>, float, Eigen::Matrix<float, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, -1, 1, 1, -1> >&, float&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&);
template void igl::pseudonormal_test<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, 1, 2, 1, 1, 2>, double, Eigen::Matrix<double, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&);
// generated by autoexplicit.sh
template void igl::pseudonormal_test<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, -1, 1, 1, -1>, double, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
// generated by autoexplicit.sh
template void igl::pseudonormal_test<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 2, 0, -1, 2>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, 1, -1, 1, 1, -1>, double, Eigen::Matrix<double, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 2, 0, -1, 2> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, -1, 1, 1, -1> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 2, 1, 1, 2> >&);
// generated by autoexplicit.sh
template void igl::pseudonormal_test<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 1, -1, false>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, double, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 1, -1, false> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
//template void igl::pseudonormal_test<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, 1, 2, 1, 1, 2>, Eigen::Matrix<float, 1, 2, 1, 1, 2>, float, Eigen::Matrix<float, 1, 2, 1, 1, 2> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&, float&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 2, 1, 1, 2> >&);
template void igl::pseudonormal_test<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<float, 1, 3, 1, 1, 3>, Eigen::Matrix<float, 1, 3, 1, 1, 3>, float, Eigen::Matrix<float, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> >&, float&, Eigen::PlainObjectBase<Eigen::Matrix<float, 1, 3, 1, 1, 3> >&);
template void igl::pseudonormal_test<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, double, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
template void igl::pseudonormal_test<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, double, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&, double&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
+2 -1
View File
@@ -106,7 +106,8 @@ IGL_INLINE void igl::random_points_on_mesh(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::random_points_on_mesh<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<float, -1, 3, 1, -1, 3> >(int, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&);
template void igl::random_points_on_mesh<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, float, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(int, Eigen::MatrixBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::SparseMatrix<float, 0, int>&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::random_points_on_mesh<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(int, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template void igl::random_points_on_mesh<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(int, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::SparseMatrix<double, 0, int>&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::random_points_on_mesh<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(int, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::SparseMatrix<double, 0, int>&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
+2
View File
@@ -82,6 +82,8 @@ IGL_INLINE bool igl::ray_mesh_intersect(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template bool igl::ray_mesh_intersect<Eigen::Matrix<float, 3, 1, 0, 3, 1>, Eigen::Matrix<float, 3, 1, 0, 3, 1>, Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> > const&, std::vector<igl::Hit, std::allocator<igl::Hit> >&);
template bool igl::ray_mesh_intersect<Eigen::Matrix<float, 3, 1, 0, 3, 1>, Eigen::Matrix<float, 3, 1, 0, 3, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<igl::Hit, std::allocator<igl::Hit> >&);
template bool igl::ray_mesh_intersect<Eigen::Matrix<float, 3, 1, 0, 3, 1>, Eigen::Matrix<float, 3, 1, 0, 3, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::MatrixBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, igl::Hit&);
template bool igl::ray_mesh_intersect<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Block<Eigen::Matrix<int, -1, -1, 0, -1, -1> const, 1, -1, false> >(Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Block<Eigen::Matrix<int, -1, -1, 0, -1, -1> const, 1, -1, false> > const&, igl::Hit&);
+6 -2
View File
@@ -1,5 +1,5 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
@@ -30,8 +30,12 @@ IGL_INLINE bool igl::readCSV(
std::istringstream iss(line);
vector<Scalar> temp;
Scalar a;
while (iss >> a)
char ch;
while (iss >> a){
temp.push_back(a);
if(!(iss >> ch))
break;
}
if (temp.size() != 0) // skip empty lines
Mt.push_back(temp);
+8 -13
View File
@@ -488,19 +488,14 @@ IGL_INLINE bool igl::readMESH(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template bool igl::readMESH<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
// generated by autoexplicit.sh
template bool igl::readMESH<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
// generated by autoexplicit.sh
template bool igl::readMESH<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
// generated by autoexplicit.sh
template bool igl::readMESH<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >&);
// generated by autoexplicit.sh
template bool igl::readMESH<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
// generated by autoexplicit.sh
template bool igl::readMESH<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readMESH<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readMESH<double, int>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&);
template bool igl::readMESH<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readMESH<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
template bool igl::readMESH<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
template bool igl::readMESH<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readMESH<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
template bool igl::readMESH<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readMESH<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
template bool igl::readMESH<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >&);
template bool igl::readMESH<double, int>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&);
#endif
+2
View File
@@ -509,4 +509,6 @@ IGL_INLINE bool igl::readMSH(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template bool igl::readMSH<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
#endif
+7 -6
View File
@@ -240,7 +240,7 @@ IGL_INLINE bool igl::readOBJ(
else{
FMwasinit=true;
}
sscanf(l, "%s\n", &currentmaterialref);
sscanf(l, "%s\n", currentmaterialref);
}
else if(strlen(type) >= 1 && (type[0] == '#' ||
type[0] == 'g' ||
@@ -399,11 +399,12 @@ IGL_INLINE bool igl::readOBJ(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template bool igl::readOBJ<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readOBJ<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readOBJ<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readOBJ<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readOBJ<double, int>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&);
template bool igl::readOBJ<double, int>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::tuple<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int>, std::allocator<std::tuple<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int> > >&);
template bool igl::readOBJ<double, int>(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&);
template bool igl::readOBJ<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readOBJ<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readOBJ<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readOBJ<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readOBJ<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<float, -1, 2, 1, -1, 2>, Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 2, 1, -1, 2> >&, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >&);
#endif
+636 -174
View File
@@ -1,224 +1,686 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "readPLY.h"
#include "list_to_matrix.h"
#include "ply.h"
#include <string>
#include <set>
#include <fstream>
#include <iostream>
#include <Eigen/Core>
#include "tinyply.h"
namespace igl
{
template <typename T, typename Derived>
IGL_INLINE bool _tinyply_buffer_to_matrix(
tinyply::PlyData & D,
Eigen::PlainObjectBase<Derived> & M,
size_t rows,
size_t cols )
{
Eigen::Map< Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >
_map( reinterpret_cast<T *>( D.buffer.get()), rows, cols );
M = _map.template cast<typename Derived::Scalar>();
return true;
}
template <typename Derived>
IGL_INLINE bool tinyply_buffer_to_matrix(
tinyply::PlyData & D,
Eigen::PlainObjectBase<Derived> & M,
size_t rows,
size_t cols )
{
switch(D.t)
{
case tinyply::Type::INT8 :
return _tinyply_buffer_to_matrix<int8_t,Derived>(D, M,rows,cols);
case tinyply::Type::UINT8 :
return _tinyply_buffer_to_matrix<uint8_t,Derived>(D, M,rows,cols);
case tinyply::Type::INT16 :
return _tinyply_buffer_to_matrix<int16_t,Derived>(D, M,rows,cols);
case tinyply::Type::UINT16 :
return _tinyply_buffer_to_matrix<uint16_t,Derived>(D, M,rows,cols);
case tinyply::Type::INT32 :
return _tinyply_buffer_to_matrix<int32_t,Derived>(D, M,rows,cols);
case tinyply::Type::UINT32 :
return _tinyply_buffer_to_matrix<uint32_t,Derived>(D, M,rows,cols);
case tinyply::Type::FLOAT32 :
return _tinyply_buffer_to_matrix<float,Derived>(D, M,rows,cols);
case tinyply::Type::FLOAT64 :
return _tinyply_buffer_to_matrix<double,Derived>(D, M,rows,cols);
default:
return false;
}
}
template <typename T, typename Derived>
IGL_INLINE bool _tinyply_tristrips_to_trifaces(
tinyply::PlyData & D,
Eigen::PlainObjectBase<Derived> & M,
size_t el,
size_t el_len )
{
Eigen::Map< Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >
_map( reinterpret_cast<T *>( D.buffer.get()), el, el_len );
// to make it more interesting, triangles in triangle strip can be separated by negative index elements
// 1. count all triangles
size_t triangles=0;
// TODO: it's possible to optimize this , i suppose
for(size_t i=0; i<el; i++)
for(size_t j=0; j<(el_len-2); j++)
{
if(_map(i,j)>=0 && _map(i,j+1)>=0 && _map(i,j+2)>=0)
triangles++;
}
// 2. convert triangles to faces, skipping over the negative indeces, indicating separate strips
M.resize(triangles, 3);
size_t k=0;
for(size_t i=0; i<el; i++)
{
int flip=0;
for(size_t j=0; j<(el_len-2); j++)
{
if(_map(i,j)>=0 && _map(i,j+1)>=0 && _map(i,j+2)>=0)
{
// consequtive faces on the same strip have to be flip-flopped, to preserve orientation
M( k,0 ) = static_cast<typename Derived::Scalar>( _map(i, j ) );
M( k,1 ) = static_cast<typename Derived::Scalar>( _map(i, j+1+flip ) );
M( k,2 ) = static_cast<typename Derived::Scalar>( _map(i, j+1+(flip^1) ) );
k++;
flip ^= 1;
} else {
// reset flip on new strip start
flip = 0;
}
}
}
assert(k==triangles);
return true;
}
template <typename Derived>
IGL_INLINE bool tinyply_tristrips_to_faces(
tinyply::PlyData & D,
Eigen::PlainObjectBase<Derived> & M,
size_t el,
size_t el_len )
{
switch(D.t)
{
case tinyply::Type::INT8 :
return _tinyply_tristrips_to_trifaces<int8_t,Derived>(D, M,el,el_len);
case tinyply::Type::UINT8 :
return _tinyply_tristrips_to_trifaces<uint8_t,Derived>(D, M,el,el_len);
case tinyply::Type::INT16 :
return _tinyply_tristrips_to_trifaces<int16_t,Derived>(D, M,el,el_len);
case tinyply::Type::UINT16 :
return _tinyply_tristrips_to_trifaces<uint16_t,Derived>(D, M,el,el_len);
case tinyply::Type::INT32 :
return _tinyply_tristrips_to_trifaces<int32_t,Derived>(D, M,el,el_len);
case tinyply::Type::UINT32 :
return _tinyply_tristrips_to_trifaces<uint32_t,Derived>(D, M,el,el_len);
case tinyply::Type::FLOAT32 :
return _tinyply_tristrips_to_trifaces<float,Derived>(D, M,el,el_len);
case tinyply::Type::FLOAT64 :
return _tinyply_tristrips_to_trifaces<double,Derived>(D, M,el,el_len);
default:
return false;
}
}
inline void read_file_binary(FILE *fp, std::vector<uint8_t>& fileBufferBytes)
{
if (!ferror(fp))
{
fseek(fp,0,SEEK_END);
size_t sizeBytes = ftell(fp);
fseek(fp,0,SEEK_SET);
fileBufferBytes.resize(sizeBytes);
if(fread((char*)fileBufferBytes.data(), 1, sizeBytes,fp)==sizeBytes)
return;
}
throw std::runtime_error("error reading from file");
}
struct ply_memory_buffer : public std::streambuf
{
char * p_start {nullptr};
char * p_end {nullptr};
size_t size;
ply_memory_buffer(char const * first_elem, size_t size)
: p_start(const_cast<char*>(first_elem)), p_end(p_start + size), size(size)
{
setg(p_start, p_start, p_end);
}
pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which) override
{
if (dir == std::ios_base::cur) gbump(static_cast<int>(off));
else setg(p_start, (dir == std::ios_base::beg ? p_start : p_end) + off, p_end);
return gptr() - p_start;
}
pos_type seekpos(pos_type pos, std::ios_base::openmode which) override
{
return seekoff(pos, std::ios_base::beg, which);
}
};
struct ply_memory_stream : virtual ply_memory_buffer, public std::istream
{
ply_memory_stream(char const * first_elem, size_t size)
: ply_memory_buffer(first_elem, size), std::istream(static_cast<std::streambuf*>(this)) {}
};
template <
typename Vtype,
typename Ftype,
typename Ntype,
typename UVtype>
IGL_INLINE bool igl::readPLY(
const std::string filename,
std::vector<std::vector<Vtype> > & V,
std::vector<std::vector<Ftype> > & F,
std::vector<std::vector<Ntype> > & N,
std::vector<std::vector<UVtype> > & UV)
typename DerivedV,
typename DerivedF,
typename DerivedE,
typename DerivedN,
typename DerivedUV,
typename DerivedVD,
typename DerivedFD,
typename DerivedED
>
IGL_INLINE bool readPLY(
FILE *fp,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E,
Eigen::PlainObjectBase<DerivedN> & N,
Eigen::PlainObjectBase<DerivedUV> & UV,
Eigen::PlainObjectBase<DerivedVD> & VD,
std::vector<std::string> & Vheader,
Eigen::PlainObjectBase<DerivedFD> & FD,
std::vector<std::string> & Fheader,
Eigen::PlainObjectBase<DerivedED> & ED,
std::vector<std::string> & Eheader,
std::vector<std::string> & comments
)
{
using namespace std;
// Largely follows ply2iv.c
FILE * ply_file = fopen(filename.c_str(),"r");
if(ply_file == NULL)
// buffer the whole file in memory
// then read from memory buffer
try
{
return false;
std::vector<uint8_t> fileBufferBytes;
read_file_binary(fp,fileBufferBytes);
ply_memory_stream stream((char*)fileBufferBytes.data(), fileBufferBytes.size());
return readPLY(stream,V,F,E,N,UV,VD,Vheader,FD,Fheader,ED,Eheader,comments);
}
return readPLY(ply_file,V,F,N,UV);
catch(const std::exception& e)
{
std::cerr << "ReadPLY error: " << e.what() << std::endl;
}
return false;
}
template <
typename DerivedV,
typename DerivedF
>
IGL_INLINE bool readPLY(
FILE *fp,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F
)
{
Eigen::MatrixXd N,UV,VD,FD,ED;
Eigen::MatrixXi E;
std::vector<std::string> Vheader,Eheader,Fheader,comments;
return readPLY(fp,V,F,E,N,UV,VD,Vheader,FD,Fheader,ED,Eheader,comments);
}
template <
typename Vtype,
typename Ftype,
typename Ntype,
typename UVtype>
IGL_INLINE bool igl::readPLY(
FILE * ply_file,
std::vector<std::vector<Vtype> > & V,
std::vector<std::vector<Ftype> > & F,
std::vector<std::vector<Ntype> > & N,
std::vector<std::vector<UVtype> > & UV)
typename DerivedV,
typename DerivedF,
typename DerivedE
>
IGL_INLINE bool readPLY(
FILE *fp,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E
)
{
using namespace std;
typedef struct Vertex {
double x,y,z; /* position */
double nx,ny,nz; /* surface normal */
double s,t; /* texture coordinates */
void *other_props; /* other properties */
} Vertex;
Eigen::MatrixXd N,UV,VD,FD,ED;
std::vector<std::string> Vheader,Eheader,Fheader,comments;
return readPLY(fp,V,F,E,N,UV,VD,Vheader,FD,Fheader,ED,Eheader,comments);
}
typedef struct Face {
unsigned char nverts; /* number of vertex indices in list */
int *verts; /* vertex index list */
void *other_props; /* other properties */
} Face;
igl::ply::PlyProperty vert_props[] = { /* list of property information for a vertex */
{"x", PLY_DOUBLE, PLY_DOUBLE, offsetof(Vertex,x), 0, 0, 0, 0},
{"y", PLY_DOUBLE, PLY_DOUBLE, offsetof(Vertex,y), 0, 0, 0, 0},
{"z", PLY_DOUBLE, PLY_DOUBLE, offsetof(Vertex,z), 0, 0, 0, 0},
{"nx", PLY_DOUBLE, PLY_DOUBLE, offsetof(Vertex,nx), 0, 0, 0, 0},
{"ny", PLY_DOUBLE, PLY_DOUBLE, offsetof(Vertex,ny), 0, 0, 0, 0},
{"nz", PLY_DOUBLE, PLY_DOUBLE, offsetof(Vertex,nz), 0, 0, 0, 0},
{"s", PLY_DOUBLE, PLY_DOUBLE, offsetof(Vertex,s), 0, 0, 0, 0},
{"t", PLY_DOUBLE, PLY_DOUBLE, offsetof(Vertex,t), 0, 0, 0, 0},
};
template <
typename DerivedV,
typename DerivedF,
typename DerivedE,
typename DerivedN,
typename DerivedUV,
typename DerivedVD,
typename DerivedFD,
typename DerivedED
>
IGL_INLINE bool readPLY(
std::istream & ply_stream,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E,
Eigen::PlainObjectBase<DerivedN> & N,
Eigen::PlainObjectBase<DerivedUV> & UV,
igl::ply::PlyProperty face_props[] = { /* list of property information for a face */
{"vertex_indices", PLY_INT, PLY_INT, offsetof(Face,verts),
1, PLY_UCHAR, PLY_UCHAR, offsetof(Face,nverts)},
};
Eigen::PlainObjectBase<DerivedVD> & VD,
std::vector<std::string> & Vheader,
Eigen::PlainObjectBase<DerivedFD> & FD,
std::vector<std::string> & Fheader,
Eigen::PlainObjectBase<DerivedED> & ED,
std::vector<std::string> & Eheader,
std::vector<std::string> & comments
)
{
tinyply::PlyFile file;
file.parse_header(ply_stream);
int nelems;
char ** elem_names;
igl::ply::PlyFile * in_ply = igl::ply::ply_read(ply_file,&nelems,&elem_names);
if(in_ply==NULL)
std::set<std::string> vertex_std{ "x","y","z", "nx","ny","nz", "u","v", "texture_u", "texture_v", "s", "t"};
std::set<std::string> face_std { "vertex_index", "vertex_indices"};
std::set<std::string> edge_std { "vertex1", "vertex2"}; //non-standard edge indexes
// Tinyply treats parsed data as untyped byte buffers.
std::shared_ptr<tinyply::PlyData> vertices, normals, faces, texcoords, edges;
// Some ply files contain tristrips instead of faces
std::shared_ptr<tinyply::PlyData> tristrips;
std::shared_ptr<tinyply::PlyData> _vertex_data;
std::vector<std::string> _vertex_header;
std::shared_ptr<tinyply::PlyData> _face_data;
std::vector<std::string> _face_header;
std::shared_ptr<tinyply::PlyData> _edge_data;
std::vector<std::string> _edge_header;
for (auto c : file.get_comments())
comments.push_back(c);
for (auto e : file.get_elements())
{
return false;
if(e.name == "vertex" ) // found a vertex
{
for (auto p : e.properties)
{
if(vertex_std.find(p.name) == vertex_std.end())
{
_vertex_header.push_back(p.name);
}
}
}
else if(e.name == "face" ) // found face
{
for (auto p : e.properties)
{
if(face_std.find(p.name) == face_std.end())
{
_face_header.push_back(p.name);
}
}
}
else if(e.name == "edge" ) // found edge
{
for (auto p : e.properties)
{
if(edge_std.find(p.name) == edge_std.end())
{
_edge_header.push_back(p.name);
}
}
}
// skip the unknown entries
}
bool has_normals = false;
bool has_texture_coords = false;
igl::ply::PlyProperty **plist;
int nprops;
int elem_count;
plist = ply_get_element_description (in_ply,"vertex", &elem_count, &nprops);
int native_binary_type = igl::ply::get_native_binary_type2();
if (plist != NULL)
// The header information can be used to programmatically extract properties on elements
// known to exist in the header prior to reading the data. For brevity of this sample, properties
// like vertex position are hard-coded:
try {
vertices = file.request_properties_from_element("vertex", { "x", "y", "z" });
}
catch (const std::exception & ) { }
try {
normals = file.request_properties_from_element("vertex", { "nx", "ny", "nz" });
}
catch (const std::exception & ) { }
//Try texture coordinates with several names
try {
//texture_u texture_v are the names used by meshlab to store textures
texcoords = file.request_properties_from_element("vertex", { "texture_u", "texture_v" });
}
catch (const std::exception & ) { }
if (!texcoords)
{
/* set up for getting vertex elements */
ply_get_property (in_ply,"vertex",&vert_props[0]);
ply_get_property (in_ply,"vertex",&vert_props[1]);
ply_get_property (in_ply,"vertex",&vert_props[2]);
for (int j = 0; j < nprops; j++)
{
igl::ply::PlyProperty * prop = plist[j];
if (igl::ply::equal_strings ("nx", prop->name)
|| igl::ply::equal_strings ("ny", prop->name)
|| igl::ply::equal_strings ("nz", prop->name))
{
ply_get_property (in_ply,"vertex",&vert_props[3]);
ply_get_property (in_ply,"vertex",&vert_props[4]);
ply_get_property (in_ply,"vertex",&vert_props[5]);
has_normals = true;
try {
//u v are the naive names
texcoords = file.request_properties_from_element("vertex", { "u", "v" });
}
if (igl::ply::equal_strings ("s", prop->name) ||
igl::ply::equal_strings ("t", prop->name))
{
ply_get_property(in_ply,"vertex",&vert_props[6]);
ply_get_property(in_ply,"vertex",&vert_props[7]);
has_texture_coords = true;
catch (const std::exception & ) { }
}
if (!texcoords)
{
try {
//s t were the names used by blender and the previous libigl PLY reader.
texcoords = file.request_properties_from_element("vertex", { "s", "t" });
}
}
// Is this call necessary?
ply_get_other_properties(in_ply,"vertex",
offsetof(Vertex,other_props));
V.resize(elem_count,std::vector<Vtype>(3));
if(has_normals)
{
N.resize(elem_count,std::vector<Ntype>(3));
}else
{
N.resize(0);
}
if(has_texture_coords)
{
UV.resize(elem_count,std::vector<UVtype>(2));
}else
{
UV.resize(0);
}
for(int j = 0;j<elem_count;j++)
{
Vertex v;
ply_get_element_setup(in_ply,"vertex",3,vert_props);
ply_get_element(in_ply,(void*)&v, &native_binary_type);
V[j][0] = v.x;
V[j][1] = v.y;
V[j][2] = v.z;
if(has_normals)
{
N[j][0] = v.nx;
N[j][1] = v.ny;
N[j][2] = v.nz;
catch (const std::exception & ) { }
}
// Providing a list size hint (the last argument) is a 2x performance improvement. If you have
// arbitrary ply files, it is best to leave this 0.
try {
faces = file.request_properties_from_element( "face", { "vertex_indices" }, 0);
}
catch (const std::exception & ) { }
if (!faces)
{
try {
// alternative name of the elements
faces = file.request_properties_from_element( "face", { "vertex_index" },0);
}
if(has_texture_coords)
{
UV[j][0] = v.s;
UV[j][1] = v.t;
catch (const std::exception & ) { }
}
if (!faces)
{
try {
// try using tristrips
tristrips = file.request_properties_from_element( "tristrips", { "vertex_indices" }, 0);
}
catch (const std::exception & ) { }
if (!tristrips)
{
try {
// alternative name of the elements
tristrips = file.request_properties_from_element( "tristrips", { "vertex_index" }, 0);
}
catch (const std::exception & ) { }
}
}
try {
edges = file.request_properties_from_element("edge", { "vertex1", "vertex2" });
}
catch (const std::exception & ) { }
if(! _vertex_header.empty())
_vertex_data = file.request_properties_from_element( "vertex", _vertex_header);
if(! _face_header.empty())
_face_data = file.request_properties_from_element( "face", _face_header);
if(! _edge_header.empty())
_edge_data = file.request_properties_from_element( "edge", _edge_header);
// Parse the geometry data
file.read(ply_stream);
if (!vertices || !tinyply_buffer_to_matrix(*vertices,V,vertices->count,3) ) {
V.resize(0,0);
}
if (!normals || !tinyply_buffer_to_matrix(*normals,N,normals->count,3) ) {
N.resize(0,0);
}
if (!texcoords || !tinyply_buffer_to_matrix(*texcoords,UV,texcoords->count,2) ) {
UV.resize(0,0);
}
//HACK: Unfortunately, tinyply doesn't store list size as a separate variable
if (!faces || !tinyply_buffer_to_matrix(*faces, F, faces->count, faces->buffer.size_bytes()/(tinyply::PropertyTable[faces->t].stride*faces->count) )) {
if(tristrips) { // need to convert to faces
// code based on blender importer for ply
// converting triangle strips into triangles
// tinyply supports tristrips of the same length only
size_t el_count = tristrips->buffer.size_bytes()/(tinyply::PropertyTable[tristrips->t].stride*tristrips->count);
// all strips should have tristrips->count elements
if(!tinyply_tristrips_to_faces(*tristrips, F , tristrips->count, el_count))
F.resize(0,0);
} else {
F.resize(0,0);
}
}
plist = ply_get_element_description (in_ply,"face", &elem_count, &nprops);
if (plist != NULL)
{
F.resize(elem_count);
ply_get_property(in_ply,"face",&face_props[0]);
for (int j = 0; j < elem_count; j++)
{
Face f;
ply_get_element(in_ply, (void *) &f, &native_binary_type);
for(size_t c = 0;c<f.nverts;c++)
{
F[j].push_back(f.verts[c]);
}
}
if(!edges || !tinyply_buffer_to_matrix(*edges,E, edges->count,2)) {
E.resize(0,0);
}
/// convert vertex data:
Vheader=_vertex_header;
if(_vertex_header.empty())
{
VD.resize(0,0);
}
else
{
VD.resize(vertices->count,_vertex_header.size());
tinyply_buffer_to_matrix(*_vertex_data, VD, vertices->count, _vertex_header.size());
}
/// convert face data:
Fheader=_face_header;
if(_face_header.empty())
{
FD.resize(0,0);
}
else
{
FD.resize(faces->count, _face_header.size());
tinyply_buffer_to_matrix(*_face_data, FD, faces->count, 1);
}
/// convert edge data:
Eheader=_edge_header;
if(_edge_header.empty())
{
ED.resize(0,0);
}
else
{
ED.resize(_edge_data->count, _edge_header.size());
tinyply_buffer_to_matrix(*_edge_data, ED, _edge_data->count, _edge_header.size());
}
ply_close(in_ply);
return true;
}
template <
typename DerivedV,
typename DerivedF,
typename DerivedE,
typename DerivedN,
typename DerivedUV,
typename DerivedVD,
typename DerivedFD,
typename DerivedED
>
IGL_INLINE bool readPLY(
const std::string& ply_file,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E,
Eigen::PlainObjectBase<DerivedN> & N,
Eigen::PlainObjectBase<DerivedUV> & UV,
Eigen::PlainObjectBase<DerivedVD> & VD,
std::vector<std::string> & VDheader,
Eigen::PlainObjectBase<DerivedFD> & FD,
std::vector<std::string> & FDheader,
Eigen::PlainObjectBase<DerivedED> & ED,
std::vector<std::string> & EDheader,
std::vector<std::string> & comments
)
{
std::ifstream ply_stream(ply_file, std::ios::binary);
if (ply_stream.fail())
{
std::cerr << "ReadPLY: Error opening file " << ply_file << std::endl;
return false;
}
try
{
return readPLY(ply_stream, V, F, E, N, UV, VD, VDheader, FD,FDheader, ED, EDheader, comments );
} catch (const std::exception& e) {
std::cerr << "ReadPLY error: " << ply_file << e.what() << std::endl;
}
return false;
}
template <
typename DerivedV,
typename DerivedF,
typename DerivedE,
typename DerivedN,
typename DerivedUV,
typename DerivedD
>
IGL_INLINE bool readPLY(
const std::string & filename,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E,
Eigen::PlainObjectBase<DerivedN> & N,
Eigen::PlainObjectBase<DerivedUV> & UV,
Eigen::PlainObjectBase<DerivedD> & VD,
std::vector<std::string> & Vheader
)
{
Eigen::MatrixXd FD,ED;
std::vector<std::string> Fheader,Eheader;
std::vector<std::string> comments;
return readPLY(filename,V,F,E,N,UV,VD,Vheader,FD,Fheader,ED,Eheader,comments);
}
template <
typename DerivedV,
typename DerivedF,
typename DerivedE,
typename DerivedN,
typename DerivedUV
>
IGL_INLINE bool readPLY(
const std::string & filename,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E,
Eigen::PlainObjectBase<DerivedN> & N,
Eigen::PlainObjectBase<DerivedUV> & UV
)
{
Eigen::MatrixXd VD,FD,ED;
std::vector<std::string> Vheader,Fheader,Eheader;
std::vector<std::string> comments;
return readPLY(filename,V,F,E, N,UV,VD,Vheader,FD,Fheader,ED,Eheader,comments);
}
template <
typename DerivedV,
typename DerivedF,
typename DerivedN,
typename DerivedUV>
IGL_INLINE bool igl::readPLY(
const std::string filename,
typename DerivedUV
>
IGL_INLINE bool readPLY(
const std::string & filename,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedN> & N,
Eigen::PlainObjectBase<DerivedUV> & UV)
Eigen::PlainObjectBase<DerivedUV> & UV
)
{
std::vector<std::vector<typename DerivedV::Scalar> > vV;
std::vector<std::vector<typename DerivedF::Scalar> > vF;
std::vector<std::vector<typename DerivedN::Scalar> > vN;
std::vector<std::vector<typename DerivedUV::Scalar> > vUV;
if(!readPLY(filename,vV,vF,vN,vUV))
{
return false;
}
return
list_to_matrix(vV,V) &&
list_to_matrix(vF,F) &&
list_to_matrix(vN,N) &&
list_to_matrix(vUV,UV);
Eigen::MatrixXd VD,FD,ED;
Eigen::MatrixXi E;
std::vector<std::string> Vheader,Fheader,Eheader;
std::vector<std::string> comments;
return readPLY(filename,V,F,E, N,UV,VD,Vheader,FD,Fheader,ED,Eheader,comments);
}
template <
typename DerivedV,
typename DerivedF>
IGL_INLINE bool igl::readPLY(
const std::string filename,
typename DerivedF
>
IGL_INLINE bool readPLY(
const std::string & filename,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F)
Eigen::PlainObjectBase<DerivedF> & F
)
{
Eigen::MatrixXd N,UV;
return readPLY(filename,V,F,N,UV);
Eigen::MatrixXd VD,FD,ED;
Eigen::MatrixXi E;
std::vector<std::string> Vheader,Fheader,Eheader;
std::vector<std::string> comments;
return readPLY(filename,V,F,E,N,UV,VD,Vheader,FD,Fheader,ED,Eheader,comments);
}
template <
typename DerivedV,
typename DerivedF,
typename DerivedE
>
IGL_INLINE bool readPLY(
const std::string & filename,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E
)
{
Eigen::MatrixXd N,UV;
Eigen::MatrixXd VD,FD,ED;
std::vector<std::string> Vheader,Fheader,Eheader;
std::vector<std::string> comments;
return readPLY(filename,V,F,E,N,UV,VD,Vheader,FD,Fheader,ED,Eheader,comments);
}
} //igl namespace
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template bool igl::readPLY<double, int, double, double>(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&);
template bool igl::readPLY<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readPLY<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
template bool igl::readPLY<Eigen::Matrix<double, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
template bool igl::readPLY<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readPLY<Eigen::Matrix<double, -1, -1, 1, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 1, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readPLY<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readPLY<Eigen::Matrix<float, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
template bool igl::readPLY<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<unsigned int, -1, 3, 1, -1, 3> >&);
template bool igl::readPLY<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
template bool igl::readPLY<Eigen::Matrix<float, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(FILE*, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template bool igl::readPLY<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic>, Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic>, Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic>, Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Eigen::PlainObjectBase<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> > &, Eigen::PlainObjectBase<Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic> > &, Eigen::PlainObjectBase<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> > &, Eigen::PlainObjectBase<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> > &);
template bool igl::readPLY<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic>, Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, Eigen::PlainObjectBase<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> > &, Eigen::PlainObjectBase<Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic> > &);
template bool igl::readPLY<Eigen::Matrix<float, -1, 3, 1, -1, 3>, Eigen::Matrix<int, -1, 3, 1, -1, 3> >(std::string, Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 3, 1, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 1, -1, 3> >&);
template bool igl::readPLY<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&);
#endif
+193 -49
View File
@@ -1,77 +1,221 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2014 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_READPLY_H
#define IGL_READPLY_H
#include "igl_inline.h"
#include <igl/igl_inline.h>
#include <Eigen/Core>
#include <string>
#include <vector>
#include <cstdio>
#include "tinyply.h"
namespace igl
{
// Read a mesh from a .ply file.
template <
typename DerivedV,
typename DerivedF
>
IGL_INLINE bool readPLY(
FILE *fp,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F
);
// Read triangular mesh from ply file, filling in vertex positions, normals
// and texture coordinates, if available
// also read additional properties associated with vertex,faces and edges
// and file comments
//
// Templates:
// Derived from Eigen matrix parameters
// Inputs:
// filename path to .ply file
// ply_stream ply file input stream
// Outputs:
// V #V by 3 list of vertex positions
// F #F list of lists of triangle indices
// N #V by 3 list of vertex normals
// UV #V by 2 list of vertex texture coordinates
// Returns true iff success
// V (#V,3) matrix of vertex positions
// F (#F,3) list of face indices into vertex positions
// E (#E,2) list of edge indices into vertex positions
// N (#V,3) list of normals
// UV (#V,2) list of texture coordinates
// VD (#V,*) additional vertex data
// Vheader (#V) list of vertex data headers
// FD (#F,*) additional face data
// Fheader (#F) list of face data headers
// ED (#E,*) additional edge data
// Eheader (#E) list of edge data headers
// comments (*) file comments
// Returns true on success, false on errors
template <
typename Vtype,
typename Ftype,
typename Ntype,
typename UVtype>
IGL_INLINE bool readPLY(
const std::string filename,
std::vector<std::vector<Vtype> > & V,
std::vector<std::vector<Ftype> > & F,
std::vector<std::vector<Ntype> > & N,
std::vector<std::vector<UVtype> > & UV);
template <
typename Vtype,
typename Ftype,
typename Ntype,
typename UVtype>
typename DerivedV,
typename DerivedF,
typename DerivedE,
typename DerivedN,
typename DerivedUV,
typename DerivedVD,
typename DerivedFD,
typename DerivedED
>
bool readPLY(
std::istream & ply_stream,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedF> & E,
Eigen::PlainObjectBase<DerivedN> & N,
Eigen::PlainObjectBase<DerivedUV> & UV,
Eigen::PlainObjectBase<DerivedVD> & VD,
std::vector<std::string> & Vheader,
Eigen::PlainObjectBase<DerivedFD> & FD,
std::vector<std::string> & Fheader,
Eigen::PlainObjectBase<DerivedED> & ED,
std::vector<std::string> & Eheader,
std::vector<std::string> & comments
);
// Read triangular mesh from ply file, filling in vertex positions, normals
// and texture coordinates, if available
// also read additional properties associated with vertex,faces and edges
// and file comments
//
// Templates:
// Derived from Eigen matrix parameters
// Inputs:
// ply_file pointer to already opened .ply file
// ply_file ply file name
// Outputs:
// ply_file closed file
IGL_INLINE bool readPLY(
FILE * ply_file,
std::vector<std::vector<Vtype> > & V,
std::vector<std::vector<Ftype> > & F,
std::vector<std::vector<Ntype> > & N,
std::vector<std::vector<UVtype> > & UV);
template <
// V (#V,3) matrix of vertex positions
// F (#F,3) list of face indices into vertex positions
// E (#E,2) list of edge indices into vertex positions
// N (#V,3) list of normals
// UV (#V,2) list of texture coordinates
// VD (#V,*) additional vertex data
// Vheader (#V) list of vertex data headers
// FD (#F,*) additional face data
// Fheader (#F) list of face data headers
// ED (#E,*) additional edge data
// Eheader (#E) list of edge data headers
// comments (*) file comments
// Returns true on success, false on errors
template <
typename DerivedV,
typename DerivedF,
typename DerivedE,
typename DerivedN,
typename DerivedUV,
typename DerivedVD,
typename DerivedFD,
typename DerivedED
>
bool readPLY(
const std::string& ply_file,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E,
Eigen::PlainObjectBase<DerivedN> & N,
Eigen::PlainObjectBase<DerivedUV> & UV,
Eigen::PlainObjectBase<DerivedVD> & VD,
std::vector<std::string> & VDheader,
Eigen::PlainObjectBase<DerivedFD> & FD,
std::vector<std::string> & FDheader,
Eigen::PlainObjectBase<DerivedED> & ED,
std::vector<std::string> & EDheader,
std::vector<std::string> & comments
);
// Read triangular mesh from ply file, filling in vertex positions, normals
// and texture coordinates, if available
// also read additional properties associated with vertex,faces and edges
// and file comments
//
// Templates:
// Derived from Eigen matrix parameters
// Inputs:
// ply_file ply file name
// Outputs:
// V (#V,3) matrix of vertex positions
// F (#F,3) list of face indices into vertex positions
// N (#V,3) list of normals
// UV (#V,2) list of texture coordinates
// VD (#V,*) additional vertex data
// Vheader (#V) list of vertex data headers
// Returns true on success, false on errors
template <
typename DerivedV,
typename DerivedF,
typename DerivedN,
typename DerivedUV>
IGL_INLINE bool readPLY(
const std::string filename,
typename DerivedUV,
typename DerivedVD
>
bool readPLY(
const std::string & filename,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedN> & N,
Eigen::PlainObjectBase<DerivedUV> & UV);
Eigen::PlainObjectBase<DerivedUV> & UV,
Eigen::PlainObjectBase<DerivedVD> & VD,
std::vector<std::string> & Vheader
);
// Read triangular mesh from ply file, filling in vertex positions, normals
// and texture coordinates, if available
// also read additional properties associated with vertex,faces and edges
// and file comments
//
// Templates:
// Derived from Eigen matrix parameters
// Inputs:
// ply_file ply file name
// Outputs:
// V (#V,3) matrix of vertex positions
// F (#F,3) list of face indices into vertex positions
// E (#E,2) list of edge indices into vertex positions
// N (#V,3) list of normals
// UV (#V,2) list of texture coordinates
// VD (#V,*) additional vertex data
// Vheader (#V) list of vertex data headers
// Returns true on success, false on errors
template <
typename DerivedV,
typename DerivedF>
IGL_INLINE bool readPLY(
const std::string filename,
typename DerivedF,
typename DerivedE,
typename DerivedN,
typename DerivedUV
>
bool readPLY(
const std::string & filename,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F);
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E,
Eigen::PlainObjectBase<DerivedN> & N,
Eigen::PlainObjectBase<DerivedUV> & UV
);
template <
typename DerivedV,
typename DerivedF
>
bool readPLY(
const std::string & filename,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F
);
template <
typename DerivedV,
typename DerivedF,
typename DerivedE
>
bool readPLY(
const std::string & filename,
Eigen::PlainObjectBase<DerivedV> & V,
Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E
);
}
#ifndef IGL_STATIC_LIBRARY
# include "readPLY.cpp"
#endif
#endif

Some files were not shown because too many files have changed in this diff Show More