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
This commit is contained in:
Alec Jacobson
2020-04-08 17:57:08 -04:00
committed by GitHub
562 changed files with 14592 additions and 15915 deletions
-39
View File
@@ -1,39 +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
PYTHON: 37
- CONFIG: Release
BOOST_ROOT: C:/Libraries/boost_1_65_1
PYTHON: 37
install:
- cinstall: python
build:
parallel: true
build_script:
- cd c:\projects\libigl
# Tutorials and tests
- set PATH=C:\Python%PYTHON%-x64;C:\Python%PYTHON%-x64\Scripts;%PATH%
- 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
+141
View File
@@ -0,0 +1,141 @@
name: Build
on:
push: {}
pull_request: {}
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: 1
- 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: 1
- uses: seanmiddleditch/gha-setup-ninja@master
# https://github.com/actions/cache/issues/101
- name: Set env
run: echo "::set-env name=appdata::$($env:LOCALAPPDATA)"
- 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
+169
View File
@@ -0,0 +1,169 @@
name: Daily
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 }}, ${{ 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
env:
LIBIGL_NUM_THREADS: 1 # See https://github.com/libigl/libigl/pull/996
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 1
- 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_WITH_CGAL=ON \
-DLIBIGL_WITH_COMISO=ON
- name: Build
run: cd build; make -j2
- 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: [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: 1
- uses: seanmiddleditch/gha-setup-ninja@master
# 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
- name: Tests
run: cd build; ctest --verbose
-78
View File
@@ -1,78 +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
- libpython3-dev
- python3-setuptools
- xorg-dev
homebrew:
packages:
- ccache
matrix:
include:
- os: linux
compiler: gcc # 4.8.4 by default on Trusty
env:
- MATRIX_EVAL="export CONFIG=Release PYTHON=python3"
- os: linux
compiler: gcc-7
env:
- MATRIX_EVAL="export CC=gcc-7 CXX=g++-7 CONFIG=Release PYTHON=python3"
- 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 PYTHON=python3 CMAKE_EXTRA='-DLIBIGL_USE_STATIC_LIBRARY=OFF'"
- os: linux
compiler: gcc-7
env:
- MATRIX_EVAL="export CC=gcc-7 CXX=g++-7 CONFIG=Release PYTHON=python3 CMAKE_EXTRA='-DLIBIGL_EIGEN_VERSION=3.3.7'"
- os: osx
compiler: clang
env:
- MATRIX_EVAL="export CONFIG=Debug PYTHON=python3 LIBIGL_NUM_THREADS=1"
- os: osx # same config like above but with -DLIBIGL_USE_STATIC_LIBRARY=OFF to test static and header-only builds
compiler: clang
env:
- MATRIX_EVAL="export CONFIG=Debug PYTHON=python3 LIBIGL_NUM_THREADS=1 CMAKE_EXTRA='-DLIBIGL_USE_STATIC_LIBRARY=OFF'"
- os: osx
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
- pushd python/tutorial
- ${PYTHON} 101_FileIO.py
- popd
- rm -rf build
- ccache --show-stats
+19 -5
View File
@@ -1,4 +1,14 @@
cmake_minimum_required(VERSION 3.1)
# Toggles the use of the hunter package manager
option(HUNTER_ENABLED "Enable Hunter package manager support" OFF)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.171.tar.gz"
SHA1 "5d68bcca78eee347239ca5f4d34f4b6c12683154"
)
project(libigl)
# Detects whether this is a top-level project
@@ -9,10 +19,9 @@ else()
set(LIBIGL_TOPLEVEL_PROJECT OFF)
endif()
# Build tests, tutorials and python bindings
# Build tests and tutorials
option(LIBIGL_BUILD_TESTS "Build libigl unit test" ${LIBIGL_TOPLEVEL_PROJECT})
option(LIBIGL_BUILD_TUTORIALS "Build libigl tutorial" ${LIBIGL_TOPLEVEL_PROJECT})
option(LIBIGL_BUILD_PYTHON "Build libigl python bindings" ${LIBIGL_TOPLEVEL_PROJECT})
option(LIBIGL_EXPORT_TARGETS "Export libigl CMake targets" ${LIBIGL_TOPLEVEL_PROJECT})
# USE_STATIC_LIBRARY speeds up the generation of multiple binaries,
@@ -32,9 +41,13 @@ option(LIBIGL_WITH_TETGEN "Use Tetgen" ON)
option(LIBIGL_WITH_TRIANGLE "Use Triangle" ON)
option(LIBIGL_WITH_PREDICATES "Use exact predicates" ON)
option(LIBIGL_WITH_XML "Use XML" ON)
option(LIBIGL_WITH_PYTHON "Use Python" ${LIBIGL_BUILD_PYTHON})
option(LIBIGL_WITH_PYTHON "Use Python" OFF)
### End
if(${LIBIGL_WITH_PYTHON})
message(FATAL_ERROR "Python binding are in the process of being redone. Please use the master branch or refer to https://github.com/geometryprocessing/libigl-python-bindings for the developement version or https://anaconda.org/conda-forge/igl for the stable version.")
endif()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
@@ -55,6 +68,7 @@ if(LIBIGL_BUILD_TESTS)
add_subdirectory(tests)
endif()
if(LIBIGL_WITH_PYTHON)
add_subdirectory(python)
if(LIBIGL_TOPLEVEL_PROJECT)
# Set folders for Visual Studio/Xcode
igl_set_folders()
endif()
+5 -5
View File
@@ -1,8 +1,8 @@
# 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/workflows/Daily/badge.svg)
[![](https://anaconda.org/conda-forge/igl/badges/installer/conda.svg)](https://conda.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/).**
+540
View File
@@ -0,0 +1,540 @@
# Copyright (c) 2013-2018, Ruslan Baratov
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# This is a gate file to Hunter package manager.
# Include this file using `include` command and add package you need, example:
#
# cmake_minimum_required(VERSION 3.2)
#
# include("cmake/HunterGate.cmake")
# HunterGate(
# URL "https://github.com/path/to/hunter/archive.tar.gz"
# SHA1 "798501e983f14b28b10cda16afa4de69eee1da1d"
# )
#
# project(MyProject)
#
# hunter_add_package(Foo)
# hunter_add_package(Boo COMPONENTS Bar Baz)
#
# Projects:
# * https://github.com/hunter-packages/gate/
# * https://github.com/ruslo/hunter
option(HUNTER_ENABLED "Enable Hunter package manager support" ON)
if(HUNTER_ENABLED)
if(CMAKE_VERSION VERSION_LESS "3.2")
message(
FATAL_ERROR
"At least CMake version 3.2 required for Hunter dependency management."
" Update CMake or set HUNTER_ENABLED to OFF."
)
endif()
endif()
include(CMakeParseArguments) # cmake_parse_arguments
option(HUNTER_STATUS_PRINT "Print working status" ON)
option(HUNTER_STATUS_DEBUG "Print a lot info" OFF)
option(HUNTER_TLS_VERIFY "Enable/disable TLS certificate checking on downloads" ON)
set(HUNTER_WIKI "https://github.com/ruslo/hunter/wiki")
function(hunter_gate_status_print)
if(HUNTER_STATUS_PRINT OR HUNTER_STATUS_DEBUG)
foreach(print_message ${ARGV})
message(STATUS "[hunter] ${print_message}")
endforeach()
endif()
endfunction()
function(hunter_gate_status_debug)
if(HUNTER_STATUS_DEBUG)
foreach(print_message ${ARGV})
string(TIMESTAMP timestamp)
message(STATUS "[hunter *** DEBUG *** ${timestamp}] ${print_message}")
endforeach()
endif()
endfunction()
function(hunter_gate_wiki wiki_page)
message("------------------------------ WIKI -------------------------------")
message(" ${HUNTER_WIKI}/${wiki_page}")
message("-------------------------------------------------------------------")
message("")
message(FATAL_ERROR "")
endfunction()
function(hunter_gate_internal_error)
message("")
foreach(print_message ${ARGV})
message("[hunter ** INTERNAL **] ${print_message}")
endforeach()
message("[hunter ** INTERNAL **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
message("")
hunter_gate_wiki("error.internal")
endfunction()
function(hunter_gate_fatal_error)
cmake_parse_arguments(hunter "" "WIKI" "" "${ARGV}")
string(COMPARE EQUAL "${hunter_WIKI}" "" have_no_wiki)
if(have_no_wiki)
hunter_gate_internal_error("Expected wiki")
endif()
message("")
foreach(x ${hunter_UNPARSED_ARGUMENTS})
message("[hunter ** FATAL ERROR **] ${x}")
endforeach()
message("[hunter ** FATAL ERROR **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
message("")
hunter_gate_wiki("${hunter_WIKI}")
endfunction()
function(hunter_gate_user_error)
hunter_gate_fatal_error(${ARGV} WIKI "error.incorrect.input.data")
endfunction()
function(hunter_gate_self root version sha1 result)
string(COMPARE EQUAL "${root}" "" is_bad)
if(is_bad)
hunter_gate_internal_error("root is empty")
endif()
string(COMPARE EQUAL "${version}" "" is_bad)
if(is_bad)
hunter_gate_internal_error("version is empty")
endif()
string(COMPARE EQUAL "${sha1}" "" is_bad)
if(is_bad)
hunter_gate_internal_error("sha1 is empty")
endif()
string(SUBSTRING "${sha1}" 0 7 archive_id)
if(EXISTS "${root}/cmake/Hunter")
set(hunter_self "${root}")
else()
set(
hunter_self
"${root}/_Base/Download/Hunter/${version}/${archive_id}/Unpacked"
)
endif()
set("${result}" "${hunter_self}" PARENT_SCOPE)
endfunction()
# Set HUNTER_GATE_ROOT cmake variable to suitable value.
function(hunter_gate_detect_root)
# Check CMake variable
string(COMPARE NOTEQUAL "${HUNTER_ROOT}" "" not_empty)
if(not_empty)
set(HUNTER_GATE_ROOT "${HUNTER_ROOT}" PARENT_SCOPE)
hunter_gate_status_debug("HUNTER_ROOT detected by cmake variable")
return()
endif()
# Check environment variable
string(COMPARE NOTEQUAL "$ENV{HUNTER_ROOT}" "" not_empty)
if(not_empty)
set(HUNTER_GATE_ROOT "$ENV{HUNTER_ROOT}" PARENT_SCOPE)
hunter_gate_status_debug("HUNTER_ROOT detected by environment variable")
return()
endif()
# Check HOME environment variable
string(COMPARE NOTEQUAL "$ENV{HOME}" "" result)
if(result)
set(HUNTER_GATE_ROOT "$ENV{HOME}/.hunter" PARENT_SCOPE)
hunter_gate_status_debug("HUNTER_ROOT set using HOME environment variable")
return()
endif()
# Check SYSTEMDRIVE and USERPROFILE environment variable (windows only)
if(WIN32)
string(COMPARE NOTEQUAL "$ENV{SYSTEMDRIVE}" "" result)
if(result)
set(HUNTER_GATE_ROOT "$ENV{SYSTEMDRIVE}/.hunter" PARENT_SCOPE)
hunter_gate_status_debug(
"HUNTER_ROOT set using SYSTEMDRIVE environment variable"
)
return()
endif()
string(COMPARE NOTEQUAL "$ENV{USERPROFILE}" "" result)
if(result)
set(HUNTER_GATE_ROOT "$ENV{USERPROFILE}/.hunter" PARENT_SCOPE)
hunter_gate_status_debug(
"HUNTER_ROOT set using USERPROFILE environment variable"
)
return()
endif()
endif()
hunter_gate_fatal_error(
"Can't detect HUNTER_ROOT"
WIKI "error.detect.hunter.root"
)
endfunction()
function(hunter_gate_download dir)
string(
COMPARE
NOTEQUAL
"$ENV{HUNTER_DISABLE_AUTOINSTALL}"
""
disable_autoinstall
)
if(disable_autoinstall AND NOT HUNTER_RUN_INSTALL)
hunter_gate_fatal_error(
"Hunter not found in '${dir}'"
"Set HUNTER_RUN_INSTALL=ON to auto-install it from '${HUNTER_GATE_URL}'"
"Settings:"
" HUNTER_ROOT: ${HUNTER_GATE_ROOT}"
" HUNTER_SHA1: ${HUNTER_GATE_SHA1}"
WIKI "error.run.install"
)
endif()
string(COMPARE EQUAL "${dir}" "" is_bad)
if(is_bad)
hunter_gate_internal_error("Empty 'dir' argument")
endif()
string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" is_bad)
if(is_bad)
hunter_gate_internal_error("HUNTER_GATE_SHA1 empty")
endif()
string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" is_bad)
if(is_bad)
hunter_gate_internal_error("HUNTER_GATE_URL empty")
endif()
set(done_location "${dir}/DONE")
set(sha1_location "${dir}/SHA1")
set(build_dir "${dir}/Build")
set(cmakelists "${dir}/CMakeLists.txt")
hunter_gate_status_debug("Locking directory: ${dir}")
file(LOCK "${dir}" DIRECTORY GUARD FUNCTION)
hunter_gate_status_debug("Lock done")
if(EXISTS "${done_location}")
# while waiting for lock other instance can do all the job
hunter_gate_status_debug("File '${done_location}' found, skip install")
return()
endif()
file(REMOVE_RECURSE "${build_dir}")
file(REMOVE_RECURSE "${cmakelists}")
file(MAKE_DIRECTORY "${build_dir}") # check directory permissions
# Disabling languages speeds up a little bit, reduces noise in the output
# and avoids path too long windows error
file(
WRITE
"${cmakelists}"
"cmake_minimum_required(VERSION 3.2)\n"
"project(HunterDownload LANGUAGES NONE)\n"
"include(ExternalProject)\n"
"ExternalProject_Add(\n"
" Hunter\n"
" URL\n"
" \"${HUNTER_GATE_URL}\"\n"
" URL_HASH\n"
" SHA1=${HUNTER_GATE_SHA1}\n"
" DOWNLOAD_DIR\n"
" \"${dir}\"\n"
" TLS_VERIFY\n"
" ${HUNTER_TLS_VERIFY}\n"
" SOURCE_DIR\n"
" \"${dir}/Unpacked\"\n"
" CONFIGURE_COMMAND\n"
" \"\"\n"
" BUILD_COMMAND\n"
" \"\"\n"
" INSTALL_COMMAND\n"
" \"\"\n"
")\n"
)
if(HUNTER_STATUS_DEBUG)
set(logging_params "")
else()
set(logging_params OUTPUT_QUIET)
endif()
hunter_gate_status_debug("Run generate")
# Need to add toolchain file too.
# Otherwise on Visual Studio + MDD this will fail with error:
# "Could not find an appropriate version of the Windows 10 SDK installed on this machine"
if(EXISTS "${CMAKE_TOOLCHAIN_FILE}")
get_filename_component(absolute_CMAKE_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE)
set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=${absolute_CMAKE_TOOLCHAIN_FILE}")
else()
# 'toolchain_arg' can't be empty
set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=")
endif()
string(COMPARE EQUAL "${CMAKE_MAKE_PROGRAM}" "" no_make)
if(no_make)
set(make_arg "")
else()
# Test case: remove Ninja from PATH but set it via CMAKE_MAKE_PROGRAM
set(make_arg "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}")
endif()
execute_process(
COMMAND
"${CMAKE_COMMAND}"
"-H${dir}"
"-B${build_dir}"
"-G${CMAKE_GENERATOR}"
"${toolchain_arg}"
${make_arg}
WORKING_DIRECTORY "${dir}"
RESULT_VARIABLE download_result
${logging_params}
)
if(NOT download_result EQUAL 0)
hunter_gate_internal_error(
"Configure project failed."
"To reproduce the error run: ${CMAKE_COMMAND} -H${dir} -B${build_dir} -G${CMAKE_GENERATOR} ${toolchain_arg} ${make_arg}"
"In directory ${dir}"
)
endif()
hunter_gate_status_print(
"Initializing Hunter workspace (${HUNTER_GATE_SHA1})"
" ${HUNTER_GATE_URL}"
" -> ${dir}"
)
execute_process(
COMMAND "${CMAKE_COMMAND}" --build "${build_dir}"
WORKING_DIRECTORY "${dir}"
RESULT_VARIABLE download_result
${logging_params}
)
if(NOT download_result EQUAL 0)
hunter_gate_internal_error("Build project failed")
endif()
file(REMOVE_RECURSE "${build_dir}")
file(REMOVE_RECURSE "${cmakelists}")
file(WRITE "${sha1_location}" "${HUNTER_GATE_SHA1}")
file(WRITE "${done_location}" "DONE")
hunter_gate_status_debug("Finished")
endfunction()
# Must be a macro so master file 'cmake/Hunter' can
# apply all variables easily just by 'include' command
# (otherwise PARENT_SCOPE magic needed)
macro(HunterGate)
if(HUNTER_GATE_DONE)
# variable HUNTER_GATE_DONE set explicitly for external project
# (see `hunter_download`)
set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES)
endif()
# First HunterGate command will init Hunter, others will be ignored
get_property(_hunter_gate_done GLOBAL PROPERTY HUNTER_GATE_DONE SET)
if(NOT HUNTER_ENABLED)
# Empty function to avoid error "unknown function"
function(hunter_add_package)
endfunction()
set(
_hunter_gate_disabled_mode_dir
"${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/disabled-mode"
)
if(EXISTS "${_hunter_gate_disabled_mode_dir}")
hunter_gate_status_debug(
"Adding \"disabled-mode\" modules: ${_hunter_gate_disabled_mode_dir}"
)
list(APPEND CMAKE_PREFIX_PATH "${_hunter_gate_disabled_mode_dir}")
endif()
elseif(_hunter_gate_done)
hunter_gate_status_debug("Secondary HunterGate (use old settings)")
hunter_gate_self(
"${HUNTER_CACHED_ROOT}"
"${HUNTER_VERSION}"
"${HUNTER_SHA1}"
_hunter_self
)
include("${_hunter_self}/cmake/Hunter")
else()
set(HUNTER_GATE_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}")
string(COMPARE NOTEQUAL "${PROJECT_NAME}" "" _have_project_name)
if(_have_project_name)
hunter_gate_fatal_error(
"Please set HunterGate *before* 'project' command. "
"Detected project: ${PROJECT_NAME}"
WIKI "error.huntergate.before.project"
)
endif()
cmake_parse_arguments(
HUNTER_GATE "LOCAL" "URL;SHA1;GLOBAL;FILEPATH" "" ${ARGV}
)
string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" _empty_sha1)
string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" _empty_url)
string(
COMPARE
NOTEQUAL
"${HUNTER_GATE_UNPARSED_ARGUMENTS}"
""
_have_unparsed
)
string(COMPARE NOTEQUAL "${HUNTER_GATE_GLOBAL}" "" _have_global)
string(COMPARE NOTEQUAL "${HUNTER_GATE_FILEPATH}" "" _have_filepath)
if(_have_unparsed)
hunter_gate_user_error(
"HunterGate unparsed arguments: ${HUNTER_GATE_UNPARSED_ARGUMENTS}"
)
endif()
if(_empty_sha1)
hunter_gate_user_error("SHA1 suboption of HunterGate is mandatory")
endif()
if(_empty_url)
hunter_gate_user_error("URL suboption of HunterGate is mandatory")
endif()
if(_have_global)
if(HUNTER_GATE_LOCAL)
hunter_gate_user_error("Unexpected LOCAL (already has GLOBAL)")
endif()
if(_have_filepath)
hunter_gate_user_error("Unexpected FILEPATH (already has GLOBAL)")
endif()
endif()
if(HUNTER_GATE_LOCAL)
if(_have_global)
hunter_gate_user_error("Unexpected GLOBAL (already has LOCAL)")
endif()
if(_have_filepath)
hunter_gate_user_error("Unexpected FILEPATH (already has LOCAL)")
endif()
endif()
if(_have_filepath)
if(_have_global)
hunter_gate_user_error("Unexpected GLOBAL (already has FILEPATH)")
endif()
if(HUNTER_GATE_LOCAL)
hunter_gate_user_error("Unexpected LOCAL (already has FILEPATH)")
endif()
endif()
hunter_gate_detect_root() # set HUNTER_GATE_ROOT
# Beautify path, fix probable problems with windows path slashes
get_filename_component(
HUNTER_GATE_ROOT "${HUNTER_GATE_ROOT}" ABSOLUTE
)
hunter_gate_status_debug("HUNTER_ROOT: ${HUNTER_GATE_ROOT}")
if(NOT HUNTER_ALLOW_SPACES_IN_PATH)
string(FIND "${HUNTER_GATE_ROOT}" " " _contain_spaces)
if(NOT _contain_spaces EQUAL -1)
hunter_gate_fatal_error(
"HUNTER_ROOT (${HUNTER_GATE_ROOT}) contains spaces."
"Set HUNTER_ALLOW_SPACES_IN_PATH=ON to skip this error"
"(Use at your own risk!)"
WIKI "error.spaces.in.hunter.root"
)
endif()
endif()
string(
REGEX
MATCH
"[0-9]+\\.[0-9]+\\.[0-9]+[-_a-z0-9]*"
HUNTER_GATE_VERSION
"${HUNTER_GATE_URL}"
)
string(COMPARE EQUAL "${HUNTER_GATE_VERSION}" "" _is_empty)
if(_is_empty)
set(HUNTER_GATE_VERSION "unknown")
endif()
hunter_gate_self(
"${HUNTER_GATE_ROOT}"
"${HUNTER_GATE_VERSION}"
"${HUNTER_GATE_SHA1}"
_hunter_self
)
set(_master_location "${_hunter_self}/cmake/Hunter")
if(EXISTS "${HUNTER_GATE_ROOT}/cmake/Hunter")
# Hunter downloaded manually (e.g. by 'git clone')
set(_unused "xxxxxxxxxx")
set(HUNTER_GATE_SHA1 "${_unused}")
set(HUNTER_GATE_VERSION "${_unused}")
else()
get_filename_component(_archive_id_location "${_hunter_self}/.." ABSOLUTE)
set(_done_location "${_archive_id_location}/DONE")
set(_sha1_location "${_archive_id_location}/SHA1")
# Check Hunter already downloaded by HunterGate
if(NOT EXISTS "${_done_location}")
hunter_gate_download("${_archive_id_location}")
endif()
if(NOT EXISTS "${_done_location}")
hunter_gate_internal_error("hunter_gate_download failed")
endif()
if(NOT EXISTS "${_sha1_location}")
hunter_gate_internal_error("${_sha1_location} not found")
endif()
file(READ "${_sha1_location}" _sha1_value)
string(COMPARE EQUAL "${_sha1_value}" "${HUNTER_GATE_SHA1}" _is_equal)
if(NOT _is_equal)
hunter_gate_internal_error(
"Short SHA1 collision:"
" ${_sha1_value} (from ${_sha1_location})"
" ${HUNTER_GATE_SHA1} (HunterGate)"
)
endif()
if(NOT EXISTS "${_master_location}")
hunter_gate_user_error(
"Master file not found:"
" ${_master_location}"
"try to update Hunter/HunterGate"
)
endif()
endif()
include("${_master_location}")
set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES)
endif()
endmacro()
+4 -4
View File
@@ -64,7 +64,7 @@ function(igl_download_cork)
endfunction()
## Eigen
set(LIBIGL_EIGEN_VERSION 3.2.10 CACHE STRING "Default version of Eigen used by libigl.")
set(LIBIGL_EIGEN_VERSION 3.3.7 CACHE STRING "Default version of Eigen used by libigl.")
function(igl_download_eigen)
igl_download_project(eigen
GIT_REPOSITORY https://github.com/eigenteam/eigen-git-mirror.git
@@ -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()
@@ -164,7 +164,7 @@ endfunction()
function(igl_download_predicates)
igl_download_project(predicates
GIT_REPOSITORY https://github.com/libigl/libigl-predicates.git
GIT_TAG 4c57c1d3f31646b010d1d58bfbe201e75c2b2ad8
GIT_TAG 5a1d2194ec114bff51d5a33230586cafb83adc86
)
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 adc66cabf712a0bd68ac182b4e7f8b5ba009c3dd
GIT_TAG 5994ecdab65aebc6c218c4c6f35e7822acf6fe99
)
endfunction()
+116
View File
@@ -0,0 +1,116 @@
# Sort projects inside the solution
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
function(igl_folder_targets FOLDER_NAME)
foreach(target IN ITEMS ${ARGN})
if(TARGET ${target})
get_target_property(TYPE ${target} TYPE)
if(NOT (TYPE STREQUAL "INTERFACE_LIBRARY"))
set_target_properties(${target} PROPERTIES FOLDER "${FOLDER_NAME}")
endif()
endif()
endforeach()
endfunction()
function(igl_set_folders)
igl_folder_targets("ThirdParty/Embree"
algorithms
embree
lexers
math
simd
sys
tasking
)
igl_folder_targets("ThirdParty"
CoMISo
glad
glfw
imgui
predicates
tetgen
tinyxml2
triangle
)
igl_folder_targets("Libigl"
igl
igl_comiso
igl_embree
igl_opengl
igl_opengl_glfw
igl_opengl_glfw_imgui
igl_png
igl_predicates
igl_stb_image
igl_tetgen
igl_triangle
igl_xml
)
igl_folder_targets("Unit Tests"
libigl_tests
)
igl_folder_targets("Tutorials"
101_FileIO_bin
102_DrawMesh_bin
103_Events_bin
104_Colors_bin
105_Overlays_bin
106_ViewerMenu_bin
107_MultipleMeshes_bin
108_MultipleViews_bin
201_Normals_bin
202_GaussianCurvature_bin
203_CurvatureDirections_bin
204_Gradient_bin
205_Laplacian_bin
206_GeodesicDistance_bin
301_Slice_bin
302_Sort_bin
303_LaplaceEquation_bin
304_LinearEqualityConstraints_bin
305_QuadraticProgramming_bin
306_EigenDecomposition_bin
401_BiharmonicDeformation_bin
402_PolyharmonicDeformation_bin
403_BoundedBiharmonicWeights_bin
404_DualQuaternionSkinning_bin
405_AsRigidAsPossible_bin
406_FastAutomaticSkinningTransformations_bin
407_BiharmonicCoordinates_bin
501_HarmonicParam_bin
502_LSCMParam_bin
503_ARAPParam_bin
504_NRosyDesign_bin
505_MIQ_bin
506_FrameField_bin
507_Planarization_bin
601_Serialization_bin
604_Triangle_bin
605_Tetgen_bin
606_AmbientOcclusion_bin
607_ScreenCapture_bin
701_Statistics_bin
702_WindingNumber_bin
703_Decimation_bin
704_SignedDistance_bin
705_MarchingCubes_bin
706_FacetOrientation_bin
707_SweptVolume_bin
708_Picking_bin
709_SLIM_bin
710_SCAF_bin
711_Subdivision_bin
712_DataSmoothing_bin
713_ShapeUp_bin
714_MarchingTets_bin
715_MeshImplicitFunction_bin
716_HeatGeodesics_bin
718_IterativeClosestPoint_bin
)
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()
+8
View File
@@ -0,0 +1,8 @@
# This is a conda environment that can be used to compile libigl with CGAL on Windows
# Only boost is required to be installed on the system, CGAL is automatically downloaded
# by CMake and is built with libigl.
name: libigl-cgal
channels:
- conda-forge
dependencies:
- boost-cpp=1.65.0
+87 -46
View File
@@ -34,10 +34,13 @@ option(LIBIGL_WITH_TETGEN "Use Tetgen" OFF)
option(LIBIGL_WITH_TRIANGLE "Use Triangle" OFF)
option(LIBIGL_WITH_PREDICATES "Use exact predicates" OFF)
option(LIBIGL_WITH_XML "Use XML" OFF)
option(LIBIGL_WITH_PYTHON "Use Python" OFF)
option(LIBIGL_WITHOUT_COPYLEFT "Disable Copyleft libraries" OFF)
option(LIBIGL_EXPORT_TARGETS "Export libigl CMake targets" OFF)
if(LIBIGL_BUILD_PYTHON)
message(FATAL_ERROR "Python bindings have been removed in this version. Please use an older version of libigl, or wait for the new bindings to be released.")
endif()
################################################################################
### Configuration
@@ -56,6 +59,9 @@ endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
include(LibiglDownloadExternal)
# Provides igl_set_folders() to set folders for Visual Studio/Xcode
include(LibiglFolders)
################################################################################
### IGL Common
################################################################################
@@ -82,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)
@@ -90,22 +96,28 @@ if(BUILD_SHARED_LIBS)
set_target_properties(igl_common PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
endif()
if(UNIX)
if(UNIX AND NOT HUNTER_ENABLED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()
if(HUNTER_ENABLED)
hunter_add_package(Eigen)
find_package(Eigen3 CONFIG REQUIRED)
endif()
# Eigen
if(TARGET Eigen3::Eigen)
# If an imported target already exists, use it
target_link_libraries(igl_common INTERFACE Eigen3::Eigen)
else()
if(NOT TARGET Eigen3::Eigen)
igl_download_eigen()
target_include_directories(igl_common SYSTEM INTERFACE
add_library(igl_eigen INTERFACE)
target_include_directories(igl_eigen SYSTEM INTERFACE
$<BUILD_INTERFACE:${LIBIGL_EXTERNAL}/eigen>
$<INSTALL_INTERFACE:include>
)
set_property(TARGET igl_eigen PROPERTY EXPORT_NAME Eigen3::Eigen)
add_library(Eigen3::Eigen ALIAS igl_eigen)
endif()
target_link_libraries(igl_common INTERFACE Eigen3::Eigen)
# C++11 Thread library
find_package(Threads REQUIRED)
@@ -140,17 +152,32 @@ function(compile_igl_module module_dir)
endif()
if(LIBIGL_USE_STATIC_LIBRARY)
file(GLOB SOURCES_IGL_${module_name}
"${LIBIGL_SOURCE_DIR}/igl/${module_dir}/*.cpp")
"${LIBIGL_SOURCE_DIR}/igl/${module_dir}/*.cpp"
"${LIBIGL_SOURCE_DIR}/igl/${module_dir}/*.h*"
)
if(NOT LIBIGL_WITHOUT_COPYLEFT)
file(GLOB COPYLEFT_SOURCES_IGL_${module_name}
"${LIBIGL_SOURCE_DIR}/igl/copyleft/${module_dir}/*.cpp")
"${LIBIGL_SOURCE_DIR}/igl/copyleft/${module_dir}/*.cpp"
"${LIBIGL_SOURCE_DIR}/igl/copyleft/${module_dir}/*.h*"
)
list(APPEND SOURCES_IGL_${module_name} ${COPYLEFT_SOURCES_IGL_${module_name}})
endif()
add_library(${module_libname} STATIC ${SOURCES_IGL_${module_name}} ${ARGN})
if(MSVC)
target_compile_options(${module_libname} PRIVATE /w) # disable all warnings (not ideal but...)
else()
#target_compile_options(${module_libname} PRIVATE -w) # disable all warnings (not ideal but...)
# Silencing some compile warnings
target_compile_options(${module_libname} PRIVATE
# Type conversion warnings. These can be fixed with some effort and possibly more verbose code.
/wd4267 # conversion from 'size_t' to 'type', possible loss of data
/wd4244 # conversion from 'type1' to 'type2', possible loss of data
/wd4018 # signed/unsigned mismatch
/wd4305 # truncation from 'double' to 'float'
# This one is from template instantiations generated by autoexplicit.sh:
/wd4667 # no function template defined that matches forced instantiation ()
# This one is easy to fix, just need to switch to safe version of C functions
/wd4996 # this function or variable may be unsafe
# This one is when using bools in adjacency matrices
/wd4804 #'+=': unsafe use of type 'bool' in operation
)
endif()
else()
add_library(${module_libname} INTERFACE)
@@ -175,14 +202,16 @@ endfunction()
if(LIBIGL_USE_STATIC_LIBRARY)
file(GLOB SOURCES_IGL
"${LIBIGL_SOURCE_DIR}/igl/*.cpp"
"${LIBIGL_SOURCE_DIR}/igl/copyleft/*.cpp")
"${LIBIGL_SOURCE_DIR}/igl/*.h*"
"${LIBIGL_SOURCE_DIR}/igl/copyleft/*.cpp"
"${LIBIGL_SOURCE_DIR}/igl/copyleft/*.h*"
)
endif()
compile_igl_module("core" ${SOURCES_IGL})
################################################################################
### Download the python part ###
if(LIBIGL_WITH_PYTHON)
igl_download_pybind11()
endif()
################################################################################
@@ -195,14 +224,12 @@ 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()
if(LIBIGL_WITH_PYTHON)
option(CGAL_Boost_USE_STATIC_LIBS "Use static Boost libs with CGAL" OFF)
else()
option(CGAL_Boost_USE_STATIC_LIBS "Use static Boost libs with CGAL" ON)
endif()
option(CGAL_Boost_USE_STATIC_LIBS "Use static Boost libs with CGAL" ON)
find_package(CGAL CONFIG COMPONENTS Core PATHS ${CGAL_DIR} NO_DEFAULT_PATH)
endif()
@@ -211,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()
@@ -271,21 +298,20 @@ 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()
add_subdirectory("${EMBREE_DIR}" "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()
compile_igl_module("embree")
@@ -346,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)
@@ -460,6 +491,7 @@ function(install_dir_files dir_name)
file(GLOB public_headers
${CMAKE_CURRENT_SOURCE_DIR}/include/igl${subpath}/*.h
${CMAKE_CURRENT_SOURCE_DIR}/include/igl${subpath}/*.hpp
)
set(files_to_install ${public_headers})
@@ -483,21 +515,30 @@ endfunction()
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
if(TARGET igl_eigen)
set(IGL_EIGEN igl_eigen)
else()
set(IGL_EIGEN)
message(WARNING "Trying to export igl targets while using an imported target for Eigen.")
endif()
# Install and export core library
install(
TARGETS
igl
igl_common
EXPORT igl-export
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
TARGETS
igl
igl_common
${IGL_EIGEN}
EXPORT igl-export
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
export(
TARGETS
igl
igl_common
${IGL_EIGEN}
FILE libigl-export.cmake
)
+7
View File
@@ -1076,6 +1076,13 @@ template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::squared_di
template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::squared_distance<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, -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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>::squared_distance<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, 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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::squared_distance<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, 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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>::init<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&);
template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::init<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&);
template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 2>::squared_distance<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, 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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
template void igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::squared_distance<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, 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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&) const;
template std::vector<int, std::allocator<int> > igl::AABB<Eigen::Matrix<double, -1, -1, 0, -1, -1>, 3>::find<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 1, -1, false> >(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::Block<Eigen::Matrix<double, -1, -1, 0, -1, -1> const, 1, -1, false> > const&, bool) const;
#ifdef WIN32
template void igl::AABB<class Eigen::Matrix<double,-1,-1,0,-1,-1>,2>::squared_distance<class Eigen::Matrix<int,-1,-1,0,-1,-1>,class Eigen::Matrix<double,-1,-1,0,-1,-1>,class Eigen::Matrix<double,-1,1,0,-1,1>,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix<double,-1,3,0,-1,3> >(class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &,class Eigen::MatrixBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > const &,class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,3,0,-1,3> > &)const;
template void igl::AABB<class Eigen::Matrix<double,-1,-1,0,-1,-1>,3>::squared_distance<class Eigen::Matrix<int,-1,-1,0,-1,-1>,class Eigen::Matrix<double,-1,-1,0,-1,-1>,class Eigen::Matrix<double,-1,1,0,-1,1>,class Eigen::Matrix<__int64,-1,1,0,-1,1>,class Eigen::Matrix<double,-1,3,0,-1,3> >(class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &,class Eigen::MatrixBase<class Eigen::Matrix<int,-1,-1,0,-1,-1> > const &,class Eigen::MatrixBase<class Eigen::Matrix<double,-1,-1,0,-1,-1> > const &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<__int64,-1,1,0,-1,1> > &,class Eigen::PlainObjectBase<class Eigen::Matrix<double,-1,3,0,-1,3> > &)const;
+2 -2
View File
@@ -13,8 +13,8 @@ namespace igl
// Define a standard value for double epsilon
const double DOUBLE_EPS = 1.0e-14;
const double DOUBLE_EPS_SQ = 1.0e-28;
const float FLOAT_EPS = 1.0e-7;
const float FLOAT_EPS_SQ = 1.0e-14;
const float FLOAT_EPS = 1.0e-7f;
const float FLOAT_EPS_SQ = 1.0e-14f;
// Function returning EPS for corresponding type
template <typename S_type> IGL_INLINE S_type EPS();
template <typename S_type> IGL_INLINE S_type EPS_SQ();
File diff suppressed because it is too large Load Diff
+10 -6
View File
@@ -10,9 +10,9 @@
template <typename DerivedF, typename DerivedFF, typename DerivedFFi>
IGL_INLINE igl::HalfEdgeIterator<DerivedF,DerivedFF,DerivedFFi>::HalfEdgeIterator(
const Eigen::PlainObjectBase<DerivedF>& _F,
const Eigen::PlainObjectBase<DerivedFF>& _FF,
const Eigen::PlainObjectBase<DerivedFFi>& _FFi,
const Eigen::MatrixBase<DerivedF>& _F,
const Eigen::MatrixBase<DerivedFF>& _FF,
const Eigen::MatrixBase<DerivedFFi>& _FFi,
int _fi,
int _ei,
bool _reverse
@@ -138,8 +138,8 @@ IGL_INLINE bool igl::HalfEdgeIterator<DerivedF,DerivedFF,DerivedFFi>::operator==
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3> ,Eigen::Matrix<int, -1, 3, 0, -1, 3> ,Eigen::Matrix<int, -1, 3, 0, -1, 3> >::HalfEdgeIterator(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, int, int, bool);
template igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >::HalfEdgeIterator(Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, int, int, bool);
template igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3> ,Eigen::Matrix<int, -1, 3, 0, -1, 3> ,Eigen::Matrix<int, -1, 3, 0, -1, 3> >::HalfEdgeIterator(Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, int, int, bool);
template igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >::HalfEdgeIterator(Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, int, int, bool);
template bool igl::HalfEdgeIterator<Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1> >::NextFE();
template int igl::HalfEdgeIterator<Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1> >::Ei();
template int igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3> ,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1> >::Ei();
@@ -147,12 +147,16 @@ template int igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3> ,Eigen:
template int igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3> ,Eigen::Matrix<int, -1, 3, 0, -1, 3> ,Eigen::Matrix<int, -1, 3, 0, -1, 3> >::Fi();
template bool igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3> ,Eigen::Matrix<int, -1, 3, 0, -1, 3> ,Eigen::Matrix<int, -1, 3, 0, -1, 3> >::NextFE();
template int igl::HalfEdgeIterator<Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1> >::Vi();
template igl::HalfEdgeIterator<Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1> >::HalfEdgeIterator(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> > const&, int, int, bool);
template igl::HalfEdgeIterator<Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1> >::HalfEdgeIterator(Eigen::MatrixBase<Eigen::Matrix<int, -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&, int, int, bool);
template int igl::HalfEdgeIterator<Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1> >::Fi();
template void igl::HalfEdgeIterator<Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1> >::flipE();
template void igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >::flipE();
template void igl::HalfEdgeIterator<Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1> >::flipF();
template void igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >::flipF();
template void igl::HalfEdgeIterator<Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1> >::flipV();
template bool igl::HalfEdgeIterator<Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1> >::operator==(igl::HalfEdgeIterator<Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1>,Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template int igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >::Fi();
template bool igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >::NextFE();
template bool igl::HalfEdgeIterator<Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >::isBorder();
template bool igl::HalfEdgeIterator<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >::isBorder();
#endif
+6 -6
View File
@@ -49,9 +49,9 @@ namespace igl
public:
// Init the HalfEdgeIterator by specifying Face,Edge Index and Orientation
IGL_INLINE HalfEdgeIterator(
const Eigen::PlainObjectBase<DerivedF>& _F,
const Eigen::PlainObjectBase<DerivedFF>& _FF,
const Eigen::PlainObjectBase<DerivedFFi>& _FFi,
const Eigen::MatrixBase<DerivedF>& _F,
const Eigen::MatrixBase<DerivedFF>& _FF,
const Eigen::MatrixBase<DerivedFFi>& _FFi,
int _fi,
int _ei,
bool _reverse = false
@@ -100,9 +100,9 @@ namespace igl
bool reverse;
// All the same type? This is likely to break.
const Eigen::PlainObjectBase<DerivedF> & F;
const Eigen::PlainObjectBase<DerivedFF> & FF;
const Eigen::PlainObjectBase<DerivedFFi> & FFi;
const Eigen::MatrixBase<DerivedF> & F;
const Eigen::MatrixBase<DerivedFF> & FF;
const Eigen::MatrixBase<DerivedFFi> & FFi;
};
}
+7 -6
View File
@@ -15,12 +15,13 @@ namespace igl
enum MappingEnergyType
{
ARAP,
LOG_ARAP,
SYMMETRIC_DIRICHLET,
CONFORMAL,
EXP_CONFORMAL,
EXP_SYMMETRIC_DIRICHLET
ARAP = 0,
LOG_ARAP = 1,
SYMMETRIC_DIRICHLET = 2,
CONFORMAL = 3,
EXP_CONFORMAL = 4,
EXP_SYMMETRIC_DIRICHLET = 5,
NUM_SLIM_ENERGY_TYPES = 6
};
}
#endif
+1 -1
View File
@@ -223,7 +223,7 @@ IGL_INLINE igl::SolverStatus igl::active_set(
}
//cout<<matlab_format((known_i.array()+1).eval(),"known_i")<<endl;
// PREPARE EQUALITY CONSTRAINTS
VectorXi as_ieq_list(as_ieq_count,1);
Eigen::Matrix<typename DerivedY::Scalar, Eigen::Dynamic, 1> as_ieq_list(as_ieq_count,1);
// Gather active constraints and resp. rhss
DerivedBeq Beq_i;
Beq_i.resize(Beq.rows()+as_ieq_count,1);
+1 -1
View File
@@ -18,7 +18,7 @@ namespace igl
struct active_set_params;
// Known Bugs: rows of [Aeq;Aieq] **must** be linearly independent. Should be
// using QR decomposition otherwise:
// http://www.okstate.edu/sas/v8/sashtml/ormp/chap5/sect32.htm
// https://v8doc.sas.com/sashtml/ormp/chap5/sect32.htm
//
// ACTIVE_SET Minimize quadratic energy
//
+2 -1
View File
@@ -8,6 +8,7 @@
#ifndef IGL_ALL_EDGES_H
#define IGL_ALL_EDGES_H
#include "igl_inline.h"
#include "deprecated.h"
#include <Eigen/Dense>
namespace igl
{
@@ -26,7 +27,7 @@ namespace igl
// show up once for each direction and non-manifold edges may appear more than
// once for each direction).
template <typename DerivedF, typename DerivedE>
IGL_INLINE void all_edges(
IGL_DEPRECATED IGL_INLINE void all_edges(
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedE> & E);
}
+14 -14
View File
@@ -25,8 +25,8 @@ IGL_INLINE void igl::ambient_occlusion(
const Eigen::Vector3f&,
const Eigen::Vector3f&)
> & shoot_ray,
const Eigen::PlainObjectBase<DerivedP> & P,
const Eigen::PlainObjectBase<DerivedN> & N,
const Eigen::MatrixBase<DerivedP> & P,
const Eigen::MatrixBase<DerivedN> & N,
const int num_samples,
Eigen::PlainObjectBase<DerivedS> & S)
{
@@ -69,10 +69,10 @@ template <
typename DerivedS >
IGL_INLINE void igl::ambient_occlusion(
const igl::AABB<DerivedV,DIM> & aabb,
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::PlainObjectBase<DerivedP> & P,
const Eigen::PlainObjectBase<DerivedN> & N,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedP> & P,
const Eigen::MatrixBase<DerivedN> & N,
const int num_samples,
Eigen::PlainObjectBase<DerivedS> & S)
{
@@ -100,10 +100,10 @@ template <
typename DerivedN,
typename DerivedS >
IGL_INLINE void igl::ambient_occlusion(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::PlainObjectBase<DerivedP> & P,
const Eigen::PlainObjectBase<DerivedN> & N,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedP> & P,
const Eigen::MatrixBase<DerivedN> & N,
const int num_samples,
Eigen::PlainObjectBase<DerivedS> & S)
{
@@ -128,10 +128,10 @@ IGL_INLINE void igl::ambient_occlusion(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::ambient_occlusion<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::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
template void igl::ambient_occlusion<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::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> 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> >&);
// generated by autoexplicit.sh
template void igl::ambient_occlusion<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
template void igl::ambient_occlusion<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
// generated by autoexplicit.sh
template void igl::ambient_occlusion<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
template void igl::ambient_occlusion<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::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template void igl::ambient_occlusion<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, 1, 0, -1, 1> >(std::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&);
template void igl::ambient_occlusion<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::function<bool (Eigen::Matrix<float, 3, 1, 0, 3, 1> const&, Eigen::Matrix<float, 3, 1, 0, 3, 1> const&)> 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> >&);
#endif
+10 -10
View File
@@ -34,8 +34,8 @@ namespace igl
const Eigen::Vector3f&,
const Eigen::Vector3f&)
> & shoot_ray,
const Eigen::PlainObjectBase<DerivedP> & P,
const Eigen::PlainObjectBase<DerivedN> & N,
const Eigen::MatrixBase<DerivedP> & P,
const Eigen::MatrixBase<DerivedN> & N,
const int num_samples,
Eigen::PlainObjectBase<DerivedS> & S);
// Inputs:
@@ -49,10 +49,10 @@ namespace igl
typename DerivedS >
IGL_INLINE void ambient_occlusion(
const igl::AABB<DerivedV,DIM> & aabb,
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::PlainObjectBase<DerivedP> & P,
const Eigen::PlainObjectBase<DerivedN> & N,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedP> & P,
const Eigen::MatrixBase<DerivedN> & N,
const int num_samples,
Eigen::PlainObjectBase<DerivedS> & S);
// Inputs:
@@ -65,10 +65,10 @@ namespace igl
typename DerivedN,
typename DerivedS >
IGL_INLINE void ambient_occlusion(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::PlainObjectBase<DerivedP> & P,
const Eigen::PlainObjectBase<DerivedN> & N,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedP> & P,
const Eigen::MatrixBase<DerivedN> & N,
const int num_samples,
Eigen::PlainObjectBase<DerivedS> & S);
+15 -9
View File
@@ -10,13 +10,13 @@
#include "cotmatrix_entries.h"
#include <Eigen/Dense>
template <typename MatV, typename MatF, typename Scalar>
template <typename MatV, typename MatF, typename MatK>
IGL_INLINE void igl::arap_linear_block(
const MatV & V,
const MatF & F,
const int d,
const igl::ARAPEnergyType energy,
Eigen::SparseMatrix<Scalar> & Kd)
MatK & Kd)
{
switch(energy)
{
@@ -36,13 +36,15 @@ IGL_INLINE void igl::arap_linear_block(
}
template <typename MatV, typename MatF, typename Scalar>
template <typename MatV, typename MatF, typename MatK>
IGL_INLINE void igl::arap_linear_block_spokes(
const MatV & V,
const MatF & F,
const int d,
Eigen::SparseMatrix<Scalar> & Kd)
MatK & Kd)
{
typedef typename MatK::Scalar Scalar;
using namespace std;
using namespace Eigen;
// simplex size (3: triangles, 4: tetrahedra)
@@ -101,13 +103,15 @@ IGL_INLINE void igl::arap_linear_block_spokes(
Kd.makeCompressed();
}
template <typename MatV, typename MatF, typename Scalar>
template <typename MatV, typename MatF, typename MatK>
IGL_INLINE void igl::arap_linear_block_spokes_and_rims(
const MatV & V,
const MatF & F,
const int d,
Eigen::SparseMatrix<Scalar> & Kd)
MatK & Kd)
{
typedef typename MatK::Scalar Scalar;
using namespace std;
using namespace Eigen;
// simplex size (3: triangles, 4: tetrahedra)
@@ -183,13 +187,14 @@ IGL_INLINE void igl::arap_linear_block_spokes_and_rims(
Kd.makeCompressed();
}
template <typename MatV, typename MatF, typename Scalar>
template <typename MatV, typename MatF, typename MatK>
IGL_INLINE void igl::arap_linear_block_elements(
const MatV & V,
const MatF & F,
const int d,
Eigen::SparseMatrix<Scalar> & Kd)
MatK & Kd)
{
typedef typename MatK::Scalar Scalar;
using namespace std;
using namespace Eigen;
// simplex size (3: triangles, 4: tetrahedra)
@@ -249,5 +254,6 @@ IGL_INLINE void igl::arap_linear_block_elements(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template IGL_INLINE void igl::arap_linear_block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, double>(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, int, igl::ARAPEnergyType, Eigen::SparseMatrix<double, 0, int>&);
template void igl::arap_linear_block<Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >, Eigen::SparseMatrix<double, 0, int> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, int, igl::ARAPEnergyType, Eigen::SparseMatrix<double, 0, int>&);
template void igl::arap_linear_block<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::SparseMatrix<double, 0, int> >(Eigen::Matrix<double, -1, -1, 0, -1, -1> const&, Eigen::Matrix<int, -1, -1, 0, -1, -1> const&, int, igl::ARAPEnergyType, Eigen::SparseMatrix<double, 0, int>&);
#endif
+8 -8
View File
@@ -43,32 +43,32 @@ namespace igl
// Kd #V by #V/#F block of the linear constructor matrix corresponding to
// coordinate d
//
template <typename MatV, typename MatF, typename Scalar>
template <typename MatV, typename MatF, typename MatK>
IGL_INLINE void arap_linear_block(
const MatV & V,
const MatF & F,
const int d,
const igl::ARAPEnergyType energy,
Eigen::SparseMatrix<Scalar> & Kd);
MatK & Kd);
// Helper functions for each energy type
template <typename MatV, typename MatF, typename Scalar>
template <typename MatV, typename MatF, typename MatK>
IGL_INLINE void arap_linear_block_spokes(
const MatV & V,
const MatF & F,
const int d,
Eigen::SparseMatrix<Scalar> & Kd);
template <typename MatV, typename MatF, typename Scalar>
MatK & Kd);
template <typename MatV, typename MatF, typename MatK>
IGL_INLINE void arap_linear_block_spokes_and_rims(
const MatV & V,
const MatF & F,
const int d,
Eigen::SparseMatrix<Scalar> & Kd);
template <typename MatV, typename MatF, typename Scalar>
MatK & Kd);
template <typename MatV, typename MatF, typename MatK>
IGL_INLINE void arap_linear_block_elements(
const MatV & V,
const MatF & F,
const int d,
Eigen::SparseMatrix<Scalar> & Kd);
MatK & Kd);
}
#ifndef IGL_STATIC_LIBRARY
+18 -12
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 "arap_rhs.h"
#include "arap_linear_block.h"
@@ -12,12 +12,13 @@
#include "cat.h"
#include <iostream>
template<typename DerivedV, typename DerivedF, typename DerivedK>
IGL_INLINE void igl::arap_rhs(
const Eigen::MatrixXd & V,
const Eigen::MatrixXi & F,
const int dim,
const igl::ARAPEnergyType energy,
Eigen::SparseMatrix<double>& K)
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const int dim,
const igl::ARAPEnergyType energy,
Eigen::SparseCompressedBase<DerivedK>& K)
{
using namespace std;
using namespace Eigen;
@@ -48,7 +49,7 @@ IGL_INLINE void igl::arap_rhs(
return;
}
SparseMatrix<double> KX,KY,KZ;
DerivedK KX,KY,KZ;
arap_linear_block(V,F,0,energy,KX);
arap_linear_block(V,F,1,energy,KY);
if(Vdim == 2)
@@ -62,7 +63,7 @@ IGL_INLINE void igl::arap_rhs(
K = cat(2,cat(2,repdiag(KX,dim),repdiag(KY,dim)),repdiag(KZ,dim));
}else if(dim ==2)
{
SparseMatrix<double> ZZ(KX.rows()*2,KX.cols());
DerivedK ZZ(KX.rows()*2,KX.cols());
K = cat(2,cat(2,
cat(2,repdiag(KX,dim),ZZ),
cat(2,repdiag(KY,dim),ZZ)),
@@ -84,6 +85,11 @@ IGL_INLINE void igl::arap_rhs(
Vdim);
return;
}
}
#ifdef IGL_STATIC_LIBRARY
template void igl::arap_rhs(const Eigen::MatrixBase<Eigen::MatrixXd> & V, const Eigen::MatrixBase<Eigen::MatrixXi> & F,const int dim, const igl::ARAPEnergyType energy,Eigen::SparseCompressedBase<Eigen::SparseMatrix<double>>& K);
#endif
+10 -9
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_ARAP_RHS_H
#define IGL_ARAP_RHS_H
@@ -25,16 +25,17 @@ namespace igl
// energy igl::ARAPEnergyType enum value defining which energy is being
// used. See igl::ARAPEnergyType.h for valid options and explanations.
// Outputs:
// K #V*dim by #(F|V)*dim*dim matrix such that:
// K #V*dim by #(F|V)*dim*dim matrix such that:
// b = K * reshape(permute(R,[3 1 2]),size(V|F,1)*size(V,2)*size(V,2),1);
//
//
// See also: arap_linear_block
template<typename DerivedV, typename DerivedF, typename DerivedK>
IGL_INLINE void arap_rhs(
const Eigen::MatrixXd & V,
const Eigen::MatrixXi & F,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const int dim,
const igl::ARAPEnergyType energy,
Eigen::SparseMatrix<double>& K);
Eigen::SparseCompressedBase<DerivedK>& K);
}
#ifndef IGL_STATIC_LIBRARY
#include "arap_rhs.cpp"
+2 -2
View File
@@ -7,11 +7,11 @@
// obtain one at http://mozilla.org/MPL/2.0/.
#include "average_onto_vertices.h"
template<typename DerivedV,typename DerivedF,typename DerivedS>
template<typename DerivedV,typename DerivedF,typename DerivedS,typename DerivedSV >
IGL_INLINE void igl::average_onto_vertices(const Eigen::MatrixBase<DerivedV> &V,
const Eigen::MatrixBase<DerivedF> &F,
const Eigen::MatrixBase<DerivedS> &S,
Eigen::MatrixBase<DerivedS> &SV)
Eigen::PlainObjectBase<DerivedSV> &SV)
{
SV = DerivedS::Zero(V.rows(),S.cols());
Eigen::Matrix<typename DerivedF::Scalar,Eigen::Dynamic,1> COUNT(V.rows());
+9 -9
View File
@@ -1,31 +1,31 @@
// 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_AVERAGE_ONTO_VERTICES_H
#define IGL_AVERAGE_ONTO_VERTICES_H
#include "igl_inline.h"
#include <Eigen/Dense>
namespace igl
namespace igl
{
// average_onto_vertices
// average_onto_vertices
// Move a scalar field defined on faces to vertices by averaging
//
// Input:
// V,F: mesh
// S: scalar field defined on faces, Fx1
//
//
// Output:
// SV: scalar field defined on vertices
template<typename DerivedV,typename DerivedF,typename DerivedS>
template<typename DerivedV,typename DerivedF,typename DerivedS,typename DerivedSV>
IGL_INLINE void average_onto_vertices(const Eigen::MatrixBase<DerivedV> &V,
const Eigen::MatrixBase<DerivedF> &F,
const Eigen::MatrixBase<DerivedS> &S,
Eigen::MatrixBase<DerivedS> &SV);
Eigen::PlainObjectBase<DerivedSV> &SV);
}
#ifndef IGL_STATIC_LIBRARY
+2
View File
@@ -56,4 +56,6 @@ template void igl::barycenter<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Mat
template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 2, 0, -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::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&);
template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, 2, 3, 0, 2, 3>, Eigen::Matrix<double, 2, 3, 0, 2, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<double, 2, 3, 0, 2, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 3, 0, 2, 3> >&);
template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, 2, 3, 0, 2, 3>, Eigen::Matrix<double, 2, 3, 0, 2, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, 2, 3, 0, 2, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 3, 0, 2, 3> >&);
template void igl::barycenter<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, 2, 0, -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::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> >&);
template void igl::barycenter<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::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, 0, -1, 3> >&);
#endif
+2 -2
View File
@@ -59,7 +59,7 @@ template <
typename DType,
typename PType>
IGL_INLINE void igl::bfs(
const Eigen::SparseMatrix<AType> & A,
const Eigen::SparseCompressedBase<AType> & A,
const size_t s,
std::vector<DType> & D,
std::vector<PType> & P)
@@ -83,7 +83,7 @@ IGL_INLINE void igl::bfs(
D.push_back(f);
P[f] = p;
seen[f] = true;
for(typename Eigen::SparseMatrix<AType>::InnerIterator it (A,f); it; ++it)
for(typename AType::InnerIterator it (A,f); it; ++it)
{
if(it.value()) Q.push({it.index(),f});
}
+1 -1
View File
@@ -42,7 +42,7 @@ namespace igl
typename DType,
typename PType>
IGL_INLINE void bfs(
const Eigen::SparseMatrix<AType> & A,
const Eigen::SparseCompressedBase<AType> & A,
const size_t s,
std::vector<DType> & D,
std::vector<PType> & P);
+7 -7
View File
@@ -12,13 +12,13 @@
template <typename DerivedF, typename DerivedFF, typename DerivedC>
IGL_INLINE void igl::bfs_orient(
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedFF> & FF,
Eigen::PlainObjectBase<DerivedC> & C)
{
using namespace Eigen;
using namespace std;
SparseMatrix<int> A;
SparseMatrix<typename DerivedF::Scalar> A;
orientable_patches(F,C,A);
// number of faces
@@ -30,7 +30,7 @@ IGL_INLINE void igl::bfs_orient(
// Edge sets
const int ES[3][2] = {{1,2},{2,0},{0,1}};
if(&FF != &F)
if(((void*)&FF) != ((void*)&F))
{
FF = F;
}
@@ -38,7 +38,7 @@ IGL_INLINE void igl::bfs_orient(
#pragma omp parallel for
for(int c = 0;c<num_cc;c++)
{
queue<int> Q;
queue<typename DerivedF::Scalar> Q;
// find first member of patch c
for(int f = 0;f<FF.rows();f++)
{
@@ -51,7 +51,7 @@ IGL_INLINE void igl::bfs_orient(
assert(!Q.empty());
while(!Q.empty())
{
const int f = Q.front();
const typename DerivedF::Scalar f = Q.front();
Q.pop();
if(seen(f) > 0)
{
@@ -59,7 +59,7 @@ IGL_INLINE void igl::bfs_orient(
}
seen(f)++;
// loop over neighbors of f
for(typename SparseMatrix<int>::InnerIterator it (A,f); it; ++it)
for(typename SparseMatrix<typename DerivedF::Scalar>::InnerIterator it (A,f); it; ++it)
{
// might be some lingering zeros, and skip self-adjacency
if(it.value() != 0 && it.row() != f)
@@ -96,5 +96,5 @@ IGL_INLINE void igl::bfs_orient(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::bfs_orient<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<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::bfs_orient<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<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
+2 -2
View File
@@ -25,10 +25,10 @@ namespace igl
//
template <typename DerivedF, typename DerivedFF, typename DerivedC>
IGL_INLINE void bfs_orient(
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedFF> & FF,
Eigen::PlainObjectBase<DerivedC> & C);
};
}
#ifndef IGL_STATIC_LIBRARY
# include "bfs_orient.cpp"
#endif
+31 -27
View File
@@ -22,8 +22,8 @@ template <
typename SType,
typename DerivedW>
IGL_INLINE bool igl::biharmonic_coordinates(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedT> & T,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedT> & T,
const std::vector<std::vector<SType> > & S,
Eigen::PlainObjectBase<DerivedW> & W)
{
@@ -36,32 +36,36 @@ template <
typename SType,
typename DerivedW>
IGL_INLINE bool igl::biharmonic_coordinates(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedT> & T,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedT> & T,
const std::vector<std::vector<SType> > & S,
const int k,
Eigen::PlainObjectBase<DerivedW> & W)
{
using namespace Eigen;
using namespace std;
typedef typename DerivedV::Scalar Scalar;
typedef typename DerivedT::Scalar Integer;
// This is not the most efficient way to build A, but follows "Linear
// Subspace Design for Real-Time Shape Deformation" [Wang et al. 2015].
SparseMatrix<double> A;
SparseMatrix<Scalar> A;
{
DiagonalMatrix<double,Dynamic> Minv;
SparseMatrix<double> L,K;
DiagonalMatrix<Scalar, Dynamic> Minv;
SparseMatrix<Scalar> L, K;
Array<bool,Dynamic,Dynamic> C;
{
Array<bool,Dynamic,1> I;
on_boundary(T,I,C);
}
#ifdef false
#ifdef false
// Version described in paper is "wrong"
// http://www.cs.toronto.edu/~jacobson/images/error-in-linear-subspace-design-for-real-time-shape-deformation-2017-wang-et-al.pdf
SparseMatrix<double> N,Z,M;
SparseMatrix<Scalar> N, Z, M;
normal_derivative(V,T,N);
{
std::vector<Triplet<double> >ZIJV;
std::vector<Triplet<Scalar>> ZIJV;
for(int t =0;t<T.rows();t++)
{
for(int f =0;f<T.cols();f++)
@@ -84,37 +88,37 @@ IGL_INLINE bool igl::biharmonic_coordinates(
K = N+L;
massmatrix(V,T,MASSMATRIX_TYPE_DEFAULT,M);
// normalize
M /= ((VectorXd)M.diagonal()).array().abs().maxCoeff();
M /= ((Matrix<Scalar, Dynamic, 1>)M.diagonal()).array().abs().maxCoeff();
Minv =
((VectorXd)M.diagonal().array().inverse()).asDiagonal();
((Matrix<Scalar, Dynamic, 1>)M.diagonal().array().inverse()).asDiagonal();
#else
Eigen::SparseMatrix<double> M;
Eigen::MatrixXi E;
Eigen::VectorXi EMAP;
Eigen::SparseMatrix<Scalar> M;
Eigen::Matrix<Integer, Dynamic, Dynamic> E;
Eigen::Matrix<Integer, Dynamic, 1> EMAP;
crouzeix_raviart_massmatrix(V,T,M,E,EMAP);
crouzeix_raviart_cotmatrix(V,T,E,EMAP,L);
// Ad #E by #V facet-vertex incidence matrix
Eigen::SparseMatrix<double> Ad(E.rows(),V.rows());
Eigen::SparseMatrix<Scalar> Ad(E.rows(),V.rows());
{
std::vector<Eigen::Triplet<double> > AIJV(E.size());
std::vector<Eigen::Triplet<Scalar>> AIJV(E.size());
for(int e = 0;e<E.rows();e++)
{
for(int c = 0;c<E.cols();c++)
{
AIJV[e+c*E.rows()] = Eigen::Triplet<double>(e,E(e,c),1);
AIJV[e + c * E.rows()] = Eigen::Triplet<Scalar>(e, E(e, c), 1);
}
}
Ad.setFromTriplets(AIJV.begin(),AIJV.end());
}
// Degrees
Eigen::VectorXd De;
Eigen::Matrix<Scalar, Dynamic, 1> De;
sum(Ad,2,De);
Eigen::DiagonalMatrix<double,Eigen::Dynamic> De_diag =
Eigen::DiagonalMatrix<Scalar,Eigen::Dynamic> De_diag =
De.array().inverse().matrix().asDiagonal();
K = L*(De_diag*Ad);
// normalize
M /= ((VectorXd)M.diagonal()).array().abs().maxCoeff();
Minv = ((VectorXd)M.diagonal().array().inverse()).asDiagonal();
M /= ((Matrix<Scalar, Dynamic, 1>)M.diagonal()).array().abs().maxCoeff();
Minv = ((Matrix<Scalar, Dynamic, 1>)M.diagonal().array().inverse()).asDiagonal();
// kill boundary edges
for(int f = 0;f<T.rows();f++)
{
@@ -159,9 +163,9 @@ IGL_INLINE bool igl::biharmonic_coordinates(
}
const size_t dim = T.cols()-1;
// Might as well be dense... I think...
MatrixXd J = MatrixXd::Zero(mp+mr,mp+r*(dim+1));
VectorXi b(mp+mr);
MatrixXd H(mp+r*(dim+1),dim);
Matrix<Scalar, Dynamic, Dynamic> J = Matrix<Scalar, Dynamic, Dynamic>::Zero(mp+mr,mp+r*(dim+1));
Matrix<Integer, Dynamic, 1> b(mp+mr);
Matrix<Scalar, Dynamic, Dynamic> H(mp+r*(dim+1),dim);
{
int v = 0;
int c = 0;
@@ -194,10 +198,10 @@ IGL_INLINE bool igl::biharmonic_coordinates(
// minimize ½ W' A W'
// subject to W(b,:) = J
return min_quad_with_fixed(
A,VectorXd::Zero(A.rows()).eval(),b,J,SparseMatrix<double>(),VectorXd(),true,W);
A,Matrix<Scalar, Dynamic, 1>::Zero(A.rows()).eval(),b,J,SparseMatrix<Scalar>(),Matrix<Scalar, Dynamic, 1>(),true,W);
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template bool igl::biharmonic_coordinates<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, int, Eigen::Matrix<double, -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<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template bool igl::biharmonic_coordinates<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -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<int, -1, -1, 0, -1, -1> > const&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, int, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
#endif
+4 -4
View File
@@ -66,8 +66,8 @@ namespace igl
typename SType,
typename DerivedW>
IGL_INLINE bool biharmonic_coordinates(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedT> & T,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedT> & T,
const std::vector<std::vector<SType> > & S,
Eigen::PlainObjectBase<DerivedW> & W);
// k 2-->biharmonic, 3-->triharmonic
@@ -77,8 +77,8 @@ namespace igl
typename SType,
typename DerivedW>
IGL_INLINE bool biharmonic_coordinates(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedT> & T,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedT> & T,
const std::vector<std::vector<SType> > & S,
const int k,
Eigen::PlainObjectBase<DerivedW> & W);
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2017 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 "bijective_composite_harmonic_mapping.h"
@@ -51,11 +51,11 @@ IGL_INLINE bool igl::bijective_composite_harmonic_mapping(
assert(F.cols() == 3 && "F should contain triangles");
int tries = 0;
int nsteps = min_steps;
Derivedbc bc0;
Eigen::Matrix<typename Derivedbc::Scalar, Eigen::Dynamic, Eigen::Dynamic> bc0;
slice(V,b,1,bc0);
// It's difficult to check for flips "robustly" in the sense that the input
// mesh might not have positive/consistent sign to begin with.
// mesh might not have positive/consistent sign to begin with.
while(nsteps<=max_steps)
{
@@ -71,7 +71,7 @@ IGL_INLINE bool igl::bijective_composite_harmonic_mapping(
// of the boundary conditions. Something like "Homotopic Morphing of
// Planar Curves" [Dym et al. 2015] but also handling multiple connected
// components.
Derivedbc bct = bc0 + t*(bc - bc0);
Eigen::Matrix<typename Derivedbc::Scalar, Eigen::Dynamic, Eigen::Dynamic> bct = bc0 + t * (bc - bc0);
// Compute dsicrete harmonic map using metric of previous step
for(int iter = 0;iter<num_inner_iters;iter++)
{
@@ -82,7 +82,7 @@ IGL_INLINE bool igl::bijective_composite_harmonic_mapping(
//mw.save_index(b,"b");
//mw.save(bct,"bct");
//mw.write("numerical.mat");
harmonic(DerivedU(U),F,b,bct,1,U);
harmonic(Eigen::Matrix<typename DerivedU::Scalar, Eigen::Dynamic, Eigen::Dynamic>(U), F, b, bct, 1, U);
igl::slice(U,b,1,bct);
nans = (U.array() != U.array()).count();
if(test_for_flips)
+2 -2
View File
@@ -9,7 +9,7 @@
template <typename DerivedBE, typename DerivedP>
IGL_INLINE void igl::bone_parents(
const Eigen::PlainObjectBase<DerivedBE>& BE,
const Eigen::MatrixBase<DerivedBE>& BE,
Eigen::PlainObjectBase<DerivedP>& P)
{
P.resize(BE.rows(),1);
@@ -28,5 +28,5 @@ IGL_INLINE void igl::bone_parents(
}
#ifdef IGL_STATIC_LIBRARY
template void igl::bone_parents<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 void igl::bone_parents<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> >&);
#endif
+1 -1
View File
@@ -20,7 +20,7 @@ namespace igl
//
template <typename DerivedBE, typename DerivedP>
IGL_INLINE void bone_parents(
const Eigen::PlainObjectBase<DerivedBE>& BE,
const Eigen::MatrixBase<DerivedBE>& BE,
Eigen::PlainObjectBase<DerivedP>& P);
}
+3 -3
View File
@@ -24,12 +24,12 @@ IGL_INLINE void igl::boundary_loop(
return;
VectorXd Vdummy(F.maxCoeff()+1,1);
DerivedF TT,TTi;
Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, Eigen::Dynamic> TT,TTi;
vector<std::vector<int> > VF, VFi;
triangle_triangle_adjacency(F,TT,TTi);
vertex_triangle_adjacency(Vdummy,F,VF,VFi);
vector<bool> unvisited = is_border_vertex(Vdummy,F);
vector<bool> unvisited = is_border_vertex(F);
set<int> unseen;
for (size_t i = 0; i < unvisited.size(); ++i)
{
@@ -142,7 +142,7 @@ IGL_INLINE void igl::boundary_loop(
vector<int> Lvec;
boundary_loop(F,Lvec);
L.resize(Lvec.size());
L.resize(Lvec.size(), 1);
for (size_t i = 0; i < Lvec.size(); ++i)
L(i) = Lvec[i];
}
+3 -1
View File
@@ -30,7 +30,7 @@ IGL_INLINE void igl::bounding_box(
const auto & minV = V.colwise().minCoeff().array()-pad;
const auto & maxV = V.colwise().maxCoeff().array()+pad;
// 2^n vertices
BV.resize((1<<dim),dim);
BV.resize((1ull<<dim),dim);
// Recursive lambda to generate all 2^n combinations
const std::function<void(const int,const int,int*,int)> combos =
@@ -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> >&);
+1 -2
View File
@@ -15,8 +15,7 @@ namespace igl
// box
//
// Inputs:
// V #V by 3 list of vertex positions
// F #F by 3 list of triangle indices into V
// V #V by 3 list of vertex/point positions
// Returns length of bounding box diagonal
IGL_INLINE double bounding_box_diagonal( const Eigen::MatrixXd & V);
}
+4
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&);
@@ -333,4 +335,6 @@ template void igl::cat<Eigen::Matrix<int, 1, 3, 1, 1, 3>, Eigen::Matrix<int, -1,
template void igl::cat<Eigen::Matrix<int, 3, 1, 0, 3, 1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(int, std::vector<Eigen::Matrix<int, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<int, 3, 1, 0, 3, 1> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::cat<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(int, std::vector<Eigen::Matrix<double, 1, 3, 1, 1, 3>, std::allocator<Eigen::Matrix<double, 1, 3, 1, 1, 3> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template void igl::cat<Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(int, std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template void igl::cat<Eigen::Matrix<int, 1, -1, 1, 1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(int, std::vector<Eigen::Matrix<int, 1, -1, 1, 1, -1>, std::allocator<Eigen::Matrix<int, 1, -1, 1, 1, -1> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::cat<Eigen::Matrix<double, 1, 2, 1, 1, 2>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(int, std::vector<Eigen::Matrix<double, 1, 2, 1, 1, 2>, std::allocator<Eigen::Matrix<double, 1, 2, 1, 1, 2> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
#endif
+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> >&);
+6 -2
View File
@@ -13,8 +13,8 @@ template <
typename DerivedF,
typename DerivedR>
IGL_INLINE void igl::circumradius(
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;
@@ -24,3 +24,7 @@ IGL_INLINE void igl::circumradius(
// use formula: R=abc/(4*area) to compute the circum radius
R = l.col(0).array() * l.col(1).array() * l.col(2).array() / (2.0*A.array());
}
#ifdef IGL_STATIC_LIBRARY
template void igl::circumradius<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::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> >&);
#endif
+3 -3
View File
@@ -17,15 +17,15 @@ namespace igl
// V #V by dim list of mesh vertex positions
// F #F by 3 list of triangle indices into V
// Outputs:
// R #F list of circumradii
// R #F list of circumradius
//
template <
typename DerivedV,
typename DerivedF,
typename DerivedR>
IGL_INLINE void circumradius(
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
+20 -19
View File
@@ -17,7 +17,7 @@ IGL_INLINE void igl::colon(
const H hi,
Eigen::Matrix<T,Eigen::Dynamic,1> & I)
{
const int size = ((hi-low)/step)+1;
const H size = ((hi-low)/step)+1;
I = igl::LinSpaced<Eigen::Matrix<T,Eigen::Dynamic,1> >(size,low,low+step*(size-1));
}
@@ -43,26 +43,27 @@ IGL_INLINE Eigen::Matrix<T,Eigen::Dynamic,1> igl::colon(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template Eigen::Matrix<int,-1,1,0,-1,1> igl::colon<int,int,int>(int, int);
template Eigen::Matrix<int,-1,1,0,-1,1> igl::colon<int,int,long>(int,long);
template Eigen::Matrix<int,-1,1,0,-1,1> igl::colon<int,int,long long int>(int,long long int);
template Eigen::Matrix<int, -1, 1, 0, -1, 1> igl::colon<int, int, int>(int, int);
template Eigen::Matrix<int, -1, 1, 0, -1, 1> igl::colon<int, int, long>(int, long);
template Eigen::Matrix<int, -1, 1, 0, -1, 1> igl::colon<int, int, long long int>(int, long long int);
template Eigen::Matrix<double, -1, 1, 0, -1, 1> igl::colon<double, double, double>(double, double);
template void igl::colon<int, long, double>(int, long, Eigen::Matrix<double, -1, 1, 0, -1, 1> &);
// generated by autoexplicit.sh
template void igl::colon<int, long, int, int>(int, long, int, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
template void igl::colon<int, int, long, int>(int, int, long, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
template void igl::colon<int, long, int>(int, long, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
template void igl::colon<int, int, int>(int, int, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
template void igl::colon<int,long long int,int>(int,long long int,Eigen::Matrix<int,-1,1,0,-1,1> &);
template void igl::colon<int, int, int, int>(int, int, int, Eigen::Matrix<int, -1, 1, 0, -1, 1>&);
template void igl::colon<int, long, long>(int, long, Eigen::Matrix<long, -1, 1, 0, -1, 1>&);
template void igl::colon<int, double, double, double>(int, double, double, Eigen::Matrix<double, -1, 1, 0, -1, 1>&);
template void igl::colon<double, double, double>(double, double, Eigen::Matrix<double, -1, 1, 0, -1, 1>&);
template void igl::colon<double, double, double, double>(double, double, double, Eigen::Matrix<double, -1, 1, 0, -1, 1>&);
template void igl::colon<int, int, long>(int, int, Eigen::Matrix<long, -1, 1, 0, -1, 1>&);
template void igl::colon<int, long, double>(int, long, Eigen::Matrix<double, -1, 1, 0, -1, 1>&);
template void igl::colon<int, long, int, int>(int, long, int, Eigen::Matrix<int, -1, 1, 0, -1, 1> &);
template void igl::colon<int, int, long, int>(int, int, long, Eigen::Matrix<int, -1, 1, 0, -1, 1> &);
template void igl::colon<int, long, int>(int, long, Eigen::Matrix<int, -1, 1, 0, -1, 1> &);
template void igl::colon<int, int, int>(int, int, Eigen::Matrix<int, -1, 1, 0, -1, 1> &);
template void igl::colon<int, long long int, int>(int, long long int, Eigen::Matrix<int, -1, 1, 0, -1, 1> &);
template void igl::colon<int, int, int, int>(int, int, int, Eigen::Matrix<int, -1, 1, 0, -1, 1> &);
template void igl::colon<int, long, long>(int, long, Eigen::Matrix<long, -1, 1, 0, -1, 1> &);
template void igl::colon<int, double, double, double>(int, double, double, Eigen::Matrix<double, -1, 1, 0, -1, 1> &);
template void igl::colon<double, double, double>(double, double, Eigen::Matrix<double, -1, 1, 0, -1, 1> &);
template void igl::colon<double, double, double, double>(double, double, double, Eigen::Matrix<double, -1, 1, 0, -1, 1> &);
template void igl::colon<int, int, long>(int, int, Eigen::Matrix<long, -1, 1, 0, -1, 1> &);
template void igl::colon<int, int, double>(int, int, Eigen::Matrix<double, -1, 1, 0, -1, 1> &);
#ifdef WIN32
template void igl::colon<int, long long,long>(int, long long, class Eigen::Matrix<long,-1,1,0,-1,1> &);
template void igl::colon<int, __int64, double>(int, __int64, class Eigen::Matrix<double, -1, 1, 0, -1, 1> &);
template void igl::colon<int, long long, long>(int, long long, class Eigen::Matrix<long, -1, 1, 0, -1, 1> &);
template void igl::colon<int, __int64, __int64>(int, __int64, class Eigen::Matrix<__int64, -1, 1, 0, -1, 1> &);
template void igl::colon<int,__int64,double>(int,__int64,class Eigen::Matrix<double,-1,1,0,-1,1> &);
#endif
#endif
#endif
+267 -4
View File
@@ -6,7 +6,6 @@
// 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 "colormap.h"
#include "jet.h"
#include <algorithm>
// One of the new matplotlib colormaps by Nathaniel J.Smith, Stefan van der Walt, and (in the case of viridis) Eric Firing.
@@ -14,6 +13,266 @@
namespace igl
{
static double turbo_cm[256][3] = {
{0.18995,0.07176,0.23217},
{0.19483,0.08339,0.26149},
{0.19956,0.09498,0.29024},
{0.20415,0.10652,0.31844},
{0.20860,0.11802,0.34607},
{0.21291,0.12947,0.37314},
{0.21708,0.14087,0.39964},
{0.22111,0.15223,0.42558},
{0.22500,0.16354,0.45096},
{0.22875,0.17481,0.47578},
{0.23236,0.18603,0.50004},
{0.23582,0.19720,0.52373},
{0.23915,0.20833,0.54686},
{0.24234,0.21941,0.56942},
{0.24539,0.23044,0.59142},
{0.24830,0.24143,0.61286},
{0.25107,0.25237,0.63374},
{0.25369,0.26327,0.65406},
{0.25618,0.27412,0.67381},
{0.25853,0.28492,0.69300},
{0.26074,0.29568,0.71162},
{0.26280,0.30639,0.72968},
{0.26473,0.31706,0.74718},
{0.26652,0.32768,0.76412},
{0.26816,0.33825,0.78050},
{0.26967,0.34878,0.79631},
{0.27103,0.35926,0.81156},
{0.27226,0.36970,0.82624},
{0.27334,0.38008,0.84037},
{0.27429,0.39043,0.85393},
{0.27509,0.40072,0.86692},
{0.27576,0.41097,0.87936},
{0.27628,0.42118,0.89123},
{0.27667,0.43134,0.90254},
{0.27691,0.44145,0.91328},
{0.27701,0.45152,0.92347},
{0.27698,0.46153,0.93309},
{0.27680,0.47151,0.94214},
{0.27648,0.48144,0.95064},
{0.27603,0.49132,0.95857},
{0.27543,0.50115,0.96594},
{0.27469,0.51094,0.97275},
{0.27381,0.52069,0.97899},
{0.27273,0.53040,0.98461},
{0.27106,0.54015,0.98930},
{0.26878,0.54995,0.99303},
{0.26592,0.55979,0.99583},
{0.26252,0.56967,0.99773},
{0.25862,0.57958,0.99876},
{0.25425,0.58950,0.99896},
{0.24946,0.59943,0.99835},
{0.24427,0.60937,0.99697},
{0.23874,0.61931,0.99485},
{0.23288,0.62923,0.99202},
{0.22676,0.63913,0.98851},
{0.22039,0.64901,0.98436},
{0.21382,0.65886,0.97959},
{0.20708,0.66866,0.97423},
{0.20021,0.67842,0.96833},
{0.19326,0.68812,0.96190},
{0.18625,0.69775,0.95498},
{0.17923,0.70732,0.94761},
{0.17223,0.71680,0.93981},
{0.16529,0.72620,0.93161},
{0.15844,0.73551,0.92305},
{0.15173,0.74472,0.91416},
{0.14519,0.75381,0.90496},
{0.13886,0.76279,0.89550},
{0.13278,0.77165,0.88580},
{0.12698,0.78037,0.87590},
{0.12151,0.78896,0.86581},
{0.11639,0.79740,0.85559},
{0.11167,0.80569,0.84525},
{0.10738,0.81381,0.83484},
{0.10357,0.82177,0.82437},
{0.10026,0.82955,0.81389},
{0.09750,0.83714,0.80342},
{0.09532,0.84455,0.79299},
{0.09377,0.85175,0.78264},
{0.09287,0.85875,0.77240},
{0.09267,0.86554,0.76230},
{0.09320,0.87211,0.75237},
{0.09451,0.87844,0.74265},
{0.09662,0.88454,0.73316},
{0.09958,0.89040,0.72393},
{0.10342,0.89600,0.71500},
{0.10815,0.90142,0.70599},
{0.11374,0.90673,0.69651},
{0.12014,0.91193,0.68660},
{0.12733,0.91701,0.67627},
{0.13526,0.92197,0.66556},
{0.14391,0.92680,0.65448},
{0.15323,0.93151,0.64308},
{0.16319,0.93609,0.63137},
{0.17377,0.94053,0.61938},
{0.18491,0.94484,0.60713},
{0.19659,0.94901,0.59466},
{0.20877,0.95304,0.58199},
{0.22142,0.95692,0.56914},
{0.23449,0.96065,0.55614},
{0.24797,0.96423,0.54303},
{0.26180,0.96765,0.52981},
{0.27597,0.97092,0.51653},
{0.29042,0.97403,0.50321},
{0.30513,0.97697,0.48987},
{0.32006,0.97974,0.47654},
{0.33517,0.98234,0.46325},
{0.35043,0.98477,0.45002},
{0.36581,0.98702,0.43688},
{0.38127,0.98909,0.42386},
{0.39678,0.99098,0.41098},
{0.41229,0.99268,0.39826},
{0.42778,0.99419,0.38575},
{0.44321,0.99551,0.37345},
{0.45854,0.99663,0.36140},
{0.47375,0.99755,0.34963},
{0.48879,0.99828,0.33816},
{0.50362,0.99879,0.32701},
{0.51822,0.99910,0.31622},
{0.53255,0.99919,0.30581},
{0.54658,0.99907,0.29581},
{0.56026,0.99873,0.28623},
{0.57357,0.99817,0.27712},
{0.58646,0.99739,0.26849},
{0.59891,0.99638,0.26038},
{0.61088,0.99514,0.25280},
{0.62233,0.99366,0.24579},
{0.63323,0.99195,0.23937},
{0.64362,0.98999,0.23356},
{0.65394,0.98775,0.22835},
{0.66428,0.98524,0.22370},
{0.67462,0.98246,0.21960},
{0.68494,0.97941,0.21602},
{0.69525,0.97610,0.21294},
{0.70553,0.97255,0.21032},
{0.71577,0.96875,0.20815},
{0.72596,0.96470,0.20640},
{0.73610,0.96043,0.20504},
{0.74617,0.95593,0.20406},
{0.75617,0.95121,0.20343},
{0.76608,0.94627,0.20311},
{0.77591,0.94113,0.20310},
{0.78563,0.93579,0.20336},
{0.79524,0.93025,0.20386},
{0.80473,0.92452,0.20459},
{0.81410,0.91861,0.20552},
{0.82333,0.91253,0.20663},
{0.83241,0.90627,0.20788},
{0.84133,0.89986,0.20926},
{0.85010,0.89328,0.21074},
{0.85868,0.88655,0.21230},
{0.86709,0.87968,0.21391},
{0.87530,0.87267,0.21555},
{0.88331,0.86553,0.21719},
{0.89112,0.85826,0.21880},
{0.89870,0.85087,0.22038},
{0.90605,0.84337,0.22188},
{0.91317,0.83576,0.22328},
{0.92004,0.82806,0.22456},
{0.92666,0.82025,0.22570},
{0.93301,0.81236,0.22667},
{0.93909,0.80439,0.22744},
{0.94489,0.79634,0.22800},
{0.95039,0.78823,0.22831},
{0.95560,0.78005,0.22836},
{0.96049,0.77181,0.22811},
{0.96507,0.76352,0.22754},
{0.96931,0.75519,0.22663},
{0.97323,0.74682,0.22536},
{0.97679,0.73842,0.22369},
{0.98000,0.73000,0.22161},
{0.98289,0.72140,0.21918},
{0.98549,0.71250,0.21650},
{0.98781,0.70330,0.21358},
{0.98986,0.69382,0.21043},
{0.99163,0.68408,0.20706},
{0.99314,0.67408,0.20348},
{0.99438,0.66386,0.19971},
{0.99535,0.65341,0.19577},
{0.99607,0.64277,0.19165},
{0.99654,0.63193,0.18738},
{0.99675,0.62093,0.18297},
{0.99672,0.60977,0.17842},
{0.99644,0.59846,0.17376},
{0.99593,0.58703,0.16899},
{0.99517,0.57549,0.16412},
{0.99419,0.56386,0.15918},
{0.99297,0.55214,0.15417},
{0.99153,0.54036,0.14910},
{0.98987,0.52854,0.14398},
{0.98799,0.51667,0.13883},
{0.98590,0.50479,0.13367},
{0.98360,0.49291,0.12849},
{0.98108,0.48104,0.12332},
{0.97837,0.46920,0.11817},
{0.97545,0.45740,0.11305},
{0.97234,0.44565,0.10797},
{0.96904,0.43399,0.10294},
{0.96555,0.42241,0.09798},
{0.96187,0.41093,0.09310},
{0.95801,0.39958,0.08831},
{0.95398,0.38836,0.08362},
{0.94977,0.37729,0.07905},
{0.94538,0.36638,0.07461},
{0.94084,0.35566,0.07031},
{0.93612,0.34513,0.06616},
{0.93125,0.33482,0.06218},
{0.92623,0.32473,0.05837},
{0.92105,0.31489,0.05475},
{0.91572,0.30530,0.05134},
{0.91024,0.29599,0.04814},
{0.90463,0.28696,0.04516},
{0.89888,0.27824,0.04243},
{0.89298,0.26981,0.03993},
{0.88691,0.26152,0.03753},
{0.88066,0.25334,0.03521},
{0.87422,0.24526,0.03297},
{0.86760,0.23730,0.03082},
{0.86079,0.22945,0.02875},
{0.85380,0.22170,0.02677},
{0.84662,0.21407,0.02487},
{0.83926,0.20654,0.02305},
{0.83172,0.19912,0.02131},
{0.82399,0.19182,0.01966},
{0.81608,0.18462,0.01809},
{0.80799,0.17753,0.01660},
{0.79971,0.17055,0.01520},
{0.79125,0.16368,0.01387},
{0.78260,0.15693,0.01264},
{0.77377,0.15028,0.01148},
{0.76476,0.14374,0.01041},
{0.75556,0.13731,0.00942},
{0.74617,0.13098,0.00851},
{0.73661,0.12477,0.00769},
{0.72686,0.11867,0.00695},
{0.71692,0.11268,0.00629},
{0.70680,0.10680,0.00571},
{0.69650,0.10102,0.00522},
{0.68602,0.09536,0.00481},
{0.67535,0.08980,0.00449},
{0.66449,0.08436,0.00424},
{0.65345,0.07902,0.00408},
{0.64223,0.07380,0.00401},
{0.63082,0.06868,0.00401},
{0.61923,0.06367,0.00410},
{0.60746,0.05878,0.00427},
{0.59550,0.05399,0.00453},
{0.58336,0.04931,0.00486},
{0.57103,0.04474,0.00529},
{0.55852,0.04028,0.00579},
{0.54583,0.03593,0.00638},
{0.53295,0.03169,0.00705},
{0.51989,0.02756,0.00780},
{0.50664,0.02354,0.00863},
{0.49321,0.01963,0.00955},
{0.47960,0.01583,0.01055}
};
static double inferno_cm[256][3] = {
{ 0.001462, 0.000466, 0.013866 },
{ 0.002267, 0.001270, 0.018570 },
@@ -1320,13 +1579,16 @@ template <typename T>
IGL_INLINE void igl::colormap(
const ColorMapType cm, const T x_in, T & r, T & g, T & b)
{
switch (cm)
switch (cm)
{
case COLOR_MAP_TYPE_INFERNO:
colormap(inferno_cm, x_in, r, g, b);
break;
case COLOR_MAP_TYPE_JET:
jet(x_in, r, g, b);
// jet is bad so we use turbo instead
// https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html
case COLOR_MAP_TYPE_TURBO:
colormap(turbo_cm, x_in, r, g, b);
break;
case COLOR_MAP_TYPE_MAGMA:
colormap(magma_cm, x_in, r, g, b);
@@ -1340,7 +1602,7 @@ IGL_INLINE void igl::colormap(
case COLOR_MAP_TYPE_VIRIDIS:
colormap(viridis_cm, x_in, r, g, b);
break;
default:
default:
throw std::invalid_argument("igl::colormap(): Selected colormap is unsupported!");
break;
}
@@ -1431,4 +1693,5 @@ template void igl::colormap<Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matri
template void igl::colormap<Eigen::Array<int, -1, 1, 0, -1, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(igl::ColorMapType, Eigen::MatrixBase<Eigen::Array<int, -1, 1, 0, -1, 1> > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template void igl::colormap<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(igl::ColorMapType, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, bool, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
template void igl::colormap<float>(igl::ColorMapType, float, float&, float&, float&);
#endif
+6 -5
View File
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2017 Joe Graus <jgraus@gmu.edu>, 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_COLORMAP_H
@@ -22,7 +22,8 @@ namespace igl {
COLOR_MAP_TYPE_PARULA = 3,
COLOR_MAP_TYPE_PLASMA = 4,
COLOR_MAP_TYPE_VIRIDIS = 5,
NUM_COLOR_MAP_TYPES = 6
COLOR_MAP_TYPE_TURBO = 6,
NUM_COLOR_MAP_TYPES = 7
};
// Comput [r,g,b] values of the selected colormap for
// a given factor f between 0 and 1
+14 -14
View File
@@ -23,10 +23,10 @@ namespace igl {
{
public:
const Eigen::PlainObjectBase<DerivedV> &V;
const Eigen::PlainObjectBase<DerivedF> &F;
const Eigen::PlainObjectBase<DerivedV> &PD1;
const Eigen::PlainObjectBase<DerivedV> &PD2;
const Eigen::MatrixBase<DerivedV> &V;
const Eigen::MatrixBase<DerivedF> &F;
const Eigen::MatrixBase<DerivedV> &PD1;
const Eigen::MatrixBase<DerivedV> &PD2;
DerivedV N;
private:
@@ -61,10 +61,10 @@ namespace igl {
public:
inline Comb(const Eigen::PlainObjectBase<DerivedV> &_V,
const Eigen::PlainObjectBase<DerivedF> &_F,
const Eigen::PlainObjectBase<DerivedV> &_PD1,
const Eigen::PlainObjectBase<DerivedV> &_PD2
inline Comb(const Eigen::MatrixBase<DerivedV> &_V,
const Eigen::MatrixBase<DerivedF> &_F,
const Eigen::MatrixBase<DerivedV> &_PD1,
const Eigen::MatrixBase<DerivedV> &_PD2
):
V(_V),
F(_F),
@@ -137,10 +137,10 @@ namespace igl {
};
}
template <typename DerivedV, typename DerivedF>
IGL_INLINE void igl::comb_cross_field(const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedV> &PD1,
const Eigen::PlainObjectBase<DerivedV> &PD2,
IGL_INLINE void igl::comb_cross_field(const Eigen::MatrixBase<DerivedV> &V,
const Eigen::MatrixBase<DerivedF> &F,
const Eigen::MatrixBase<DerivedV> &PD1,
const Eigen::MatrixBase<DerivedV> &PD2,
Eigen::PlainObjectBase<DerivedV> &PD1out,
Eigen::PlainObjectBase<DerivedV> &PD2out)
{
@@ -150,6 +150,6 @@ IGL_INLINE void igl::comb_cross_field(const Eigen::PlainObjectBase<DerivedV> &V,
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::comb_cross_field<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
template void igl::comb_cross_field<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&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<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::comb_cross_field<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -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::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
template void igl::comb_cross_field<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&, 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> >&);
#endif
+4 -4
View File
@@ -27,10 +27,10 @@ namespace igl
template <typename DerivedV, typename DerivedF>
IGL_INLINE void comb_cross_field(const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedV> &PD1in,
const Eigen::PlainObjectBase<DerivedV> &PD2in,
IGL_INLINE void comb_cross_field(const Eigen::MatrixBase<DerivedV> &V,
const Eigen::MatrixBase<DerivedF> &F,
const Eigen::MatrixBase<DerivedV> &PD1in,
const Eigen::MatrixBase<DerivedV> &PD2in,
Eigen::PlainObjectBase<DerivedV> &PD1out,
Eigen::PlainObjectBase<DerivedV> &PD2out);
}
+8 -8
View File
@@ -16,12 +16,12 @@
#include "PI.h"
template <typename DerivedV, typename DerivedF, typename DerivedP>
IGL_INLINE void igl::comb_frame_field(const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedP> &PD1,
const Eigen::PlainObjectBase<DerivedP> &PD2,
const Eigen::PlainObjectBase<DerivedP> &BIS1_combed,
const Eigen::PlainObjectBase<DerivedP> &BIS2_combed,
IGL_INLINE void igl::comb_frame_field(const Eigen::MatrixBase<DerivedV> &V,
const Eigen::MatrixBase<DerivedF> &F,
const Eigen::MatrixBase<DerivedP> &PD1,
const Eigen::MatrixBase<DerivedP> &PD2,
const Eigen::MatrixBase<DerivedP> &BIS1_combed,
const Eigen::MatrixBase<DerivedP> &BIS2_combed,
Eigen::PlainObjectBase<DerivedP> &PD1_combed,
Eigen::PlainObjectBase<DerivedP> &PD2_combed)
{
@@ -73,6 +73,6 @@ IGL_INLINE void igl::comb_frame_field(const Eigen::PlainObjectBase<DerivedV> &V,
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::comb_frame_field<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
template void igl::comb_frame_field<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::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> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<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::comb_frame_field<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -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<double, -1, 3, 0, -1, 3> > const&, 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<double, -1, 3, 0, -1, 3> >&);
template void igl::comb_frame_field<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::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<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> >&);
#endif
+6 -6
View File
@@ -31,12 +31,12 @@ namespace igl
template <typename DerivedV, typename DerivedF, typename DerivedP>
IGL_INLINE void comb_frame_field(const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedP> &PD1,
const Eigen::PlainObjectBase<DerivedP> &PD2,
const Eigen::PlainObjectBase<DerivedP> &BIS1_combed,
const Eigen::PlainObjectBase<DerivedP> &BIS2_combed,
IGL_INLINE void comb_frame_field(const Eigen::MatrixBase<DerivedV> &V,
const Eigen::MatrixBase<DerivedF> &F,
const Eigen::MatrixBase<DerivedP> &PD1,
const Eigen::MatrixBase<DerivedP> &PD2,
const Eigen::MatrixBase<DerivedP> &BIS1_combed,
const Eigen::MatrixBase<DerivedP> &BIS2_combed,
Eigen::PlainObjectBase<DerivedP> &PD1_combed,
Eigen::PlainObjectBase<DerivedP> &PD2_combed);
}
+9 -9
View File
@@ -22,9 +22,9 @@ class CombLine
{
public:
const Eigen::PlainObjectBase<DerivedV> &V;
const Eigen::PlainObjectBase<DerivedF> &F;
const Eigen::PlainObjectBase<DerivedV> &PD1;
const Eigen::MatrixBase<DerivedV> &V;
const Eigen::MatrixBase<DerivedF> &F;
const Eigen::MatrixBase<DerivedV> &PD1;
DerivedV N;
private:
@@ -57,9 +57,9 @@ private:
public:
inline CombLine(const Eigen::PlainObjectBase<DerivedV> &_V,
const Eigen::PlainObjectBase<DerivedF> &_F,
const Eigen::PlainObjectBase<DerivedV> &_PD1):
inline CombLine(const Eigen::MatrixBase<DerivedV> &_V,
const Eigen::MatrixBase<DerivedF> &_F,
const Eigen::MatrixBase<DerivedV> &_PD1):
V(_V),
F(_F),
PD1(_PD1)
@@ -118,9 +118,9 @@ public:
}
template <typename DerivedV, typename DerivedF>
IGL_INLINE void igl::comb_line_field(const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedV> &PD1,
IGL_INLINE void igl::comb_line_field(const Eigen::MatrixBase<DerivedV> &V,
const Eigen::MatrixBase<DerivedF> &F,
const Eigen::MatrixBase<DerivedV> &PD1,
Eigen::PlainObjectBase<DerivedV> &PD1out)
{
igl::CombLine<DerivedV, DerivedF> cmb(V, F, PD1);
+3 -6
View File
@@ -19,17 +19,14 @@ namespace igl
// V #V by 3 eigen Matrix of mesh vertex 3D positions
// F #F by 4 eigen Matrix of face (quad) indices
// PD1in #F by 3 eigen Matrix of the first per face cross field vector
// PD2in #F by 3 eigen Matrix of the second per face cross field vector
// Output:
// PD1out #F by 3 eigen Matrix of the first combed cross field vector
// PD2out #F by 3 eigen Matrix of the second combed cross field vector
//
template <typename DerivedV, typename DerivedF>
IGL_INLINE void comb_line_field(const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedV> &PD1in,
IGL_INLINE void comb_line_field(const Eigen::MatrixBase<DerivedV> &V,
const Eigen::MatrixBase<DerivedF> &F,
const Eigen::MatrixBase<DerivedV> &PD1in,
Eigen::PlainObjectBase<DerivedV> &PD1out);
}
#ifndef IGL_STATIC_LIBRARY
+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
+13 -13
View File
@@ -17,12 +17,12 @@
template <typename DerivedV, typename DerivedF>
IGL_INLINE void igl::compute_frame_field_bisectors(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedV>& B1,
const Eigen::PlainObjectBase<DerivedV>& B2,
const Eigen::PlainObjectBase<DerivedV>& PD1,
const Eigen::PlainObjectBase<DerivedV>& PD2,
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedV>& B1,
const Eigen::MatrixBase<DerivedV>& B2,
const Eigen::MatrixBase<DerivedV>& PD1,
const Eigen::MatrixBase<DerivedV>& PD2,
Eigen::PlainObjectBase<DerivedV>& BIS1,
Eigen::PlainObjectBase<DerivedV>& BIS2)
{
@@ -64,10 +64,10 @@ IGL_INLINE void igl::compute_frame_field_bisectors(
template <typename DerivedV, typename DerivedF>
IGL_INLINE void igl::compute_frame_field_bisectors(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedV>& PD1,
const Eigen::PlainObjectBase<DerivedV>& PD2,
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedV>& PD1,
const Eigen::MatrixBase<DerivedV>& PD2,
Eigen::PlainObjectBase<DerivedV>& BIS1,
Eigen::PlainObjectBase<DerivedV>& BIS2)
{
@@ -80,7 +80,7 @@ IGL_INLINE void igl::compute_frame_field_bisectors(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::compute_frame_field_bisectors<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
template void igl::compute_frame_field_bisectors<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&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<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::compute_frame_field_bisectors<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&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<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::compute_frame_field_bisectors<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -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::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
template void igl::compute_frame_field_bisectors<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&, 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::compute_frame_field_bisectors<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&, 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&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
#endif
+10 -10
View File
@@ -26,22 +26,22 @@ namespace igl
//
template <typename DerivedV, typename DerivedF>
IGL_INLINE void compute_frame_field_bisectors(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedV>& B1,
const Eigen::PlainObjectBase<DerivedV>& B2,
const Eigen::PlainObjectBase<DerivedV>& PD1,
const Eigen::PlainObjectBase<DerivedV>& PD2,
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedV>& B1,
const Eigen::MatrixBase<DerivedV>& B2,
const Eigen::MatrixBase<DerivedV>& PD1,
const Eigen::MatrixBase<DerivedV>& PD2,
Eigen::PlainObjectBase<DerivedV>& BIS1,
Eigen::PlainObjectBase<DerivedV>& BIS2);
// Wrapper without given basis vectors.
template <typename DerivedV, typename DerivedF>
IGL_INLINE void compute_frame_field_bisectors(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedV>& PD1,
const Eigen::PlainObjectBase<DerivedV>& PD2,
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedV>& PD1,
const Eigen::MatrixBase<DerivedV>& PD2,
Eigen::PlainObjectBase<DerivedV>& BIS1,
Eigen::PlainObjectBase<DerivedV>& BIS2);
}
+5 -5
View File
@@ -10,14 +10,14 @@
template <typename DerivedF, typename DerivedFO>
IGL_INLINE void igl::connect_boundary_to_infinity(
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedFO> & FO)
{
return connect_boundary_to_infinity(F,F.maxCoeff(),FO);
}
template <typename DerivedF, typename DerivedFO>
IGL_INLINE void igl::connect_boundary_to_infinity(
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedF> & F,
const typename DerivedF::Scalar inf_index,
Eigen::PlainObjectBase<DerivedFO> & FO)
{
@@ -37,8 +37,8 @@ template <
typename DerivedVO,
typename DerivedFO>
IGL_INLINE void igl::connect_boundary_to_infinity(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedVO> & VO,
Eigen::PlainObjectBase<DerivedFO> & FO)
{
@@ -51,5 +51,5 @@ IGL_INLINE void igl::connect_boundary_to_infinity(
}
#ifdef IGL_STATIC_LIBRARY
template void igl::connect_boundary_to_infinity<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::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> >&);
template void igl::connect_boundary_to_infinity<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::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> >&);
#endif
+4 -4
View File
@@ -22,13 +22,13 @@ namespace igl
// edge-manifold).
template <typename DerivedF, typename DerivedFO>
IGL_INLINE void connect_boundary_to_infinity(
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedFO> & FO);
// Inputs:
// inf_index index of point at infinity (usually V.rows() or F.maxCoeff())
template <typename DerivedF, typename DerivedFO>
IGL_INLINE void connect_boundary_to_infinity(
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedF> & F,
const typename DerivedF::Scalar inf_index,
Eigen::PlainObjectBase<DerivedFO> & FO);
// Inputs:
@@ -45,8 +45,8 @@ namespace igl
typename DerivedVO,
typename DerivedFO>
IGL_INLINE void connect_boundary_to_infinity(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedVO> & VO,
Eigen::PlainObjectBase<DerivedFO> & FO);
}
+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> >&);
@@ -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> > >&);
+1 -1
View File
@@ -21,7 +21,7 @@ namespace igl
// pa,pb,pc 2D points.
// Output:
// 1 if pa,pb,pc are counterclockwise oriented.
// 0 if pa,pb,pc are counterclockwise oriented.
// 0 if pa,pb,pc are collinear.
// -1 if pa,pb,pc are clockwise oriented.
template <typename Scalar>
IGL_INLINE short orient2D(
@@ -179,3 +179,8 @@ namespace igl {
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::copyleft::cgal::point_areas<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> >&);
#endif
+2
View File
@@ -38,6 +38,8 @@ namespace igl
// N #P by 3 list of point normals
// Outputs:
// A #P list of estimated areas
//
// See also: igl::knn
template <typename DerivedP, typename DerivedI, typename DerivedN,
typename DerivedA>
IGL_INLINE void point_areas(
@@ -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
+31 -23
View File
@@ -482,7 +482,7 @@ void igl::copyleft::comiso::NRosyField::computek()
// Map the two triangles in a new space where the common edge is the x axis and the N0 the z axis
Eigen::MatrixXd P(3,3);
Eigen::VectorXd o = V.row(F(fid0,fid0_vc));
Eigen::VectorXd tmp = -N0.cross(common_edge);
Eigen::VectorXd tmp = N0.cross(common_edge);
P << common_edge, tmp, N0;
P.transposeInPlace();
@@ -494,9 +494,9 @@ void igl::copyleft::comiso::NRosyField::computek()
V0 = (P*V0.transpose()).transpose();
assert(V0(0,2) < 10e-10);
assert(V0(1,2) < 10e-10);
assert(V0(2,2) < 10e-10);
assert(V0(0,2) < 1e-10);
assert(V0(1,2) < 1e-10);
assert(V0(2,2) < 1e-10);
Eigen::MatrixXd V1(3,3);
V1.row(0) = V.row(F(fid1,0)).transpose() -o;
@@ -504,22 +504,22 @@ void igl::copyleft::comiso::NRosyField::computek()
V1.row(2) = V.row(F(fid1,2)).transpose() -o;
V1 = (P*V1.transpose()).transpose();
assert(V1(fid1_vc,2) < 10e-10);
assert(V1((fid1_vc+1)%3,2) < 10e-10);
assert(V1(fid1_vc,2) < 1e-10);
assert(V1((fid1_vc+1)%3,2) < 1e-10);
// compute rotation R such that R * N1 = N0
// i.e. map both triangles to the same plane
double alpha = -std::atan2(V1((fid1_vc + 2) % 3, 2), V1((fid1_vc + 2) % 3, 1));
double alpha = -std::atan2(-V1((fid1_vc + 2) % 3, 2), -V1((fid1_vc + 2) % 3, 1));
Eigen::MatrixXd R(3,3);
R << 1, 0, 0,
0, std::cos(alpha), -std::sin(alpha) ,
0, std::cos(alpha), -std::sin(alpha),
0, std::sin(alpha), std::cos(alpha);
V1 = (R*V1.transpose()).transpose();
assert(V1(0,2) < 10e-10);
assert(V1(1,2) < 10e-10);
assert(V1(2,2) < 10e-10);
assert(V1(0,2) < 1e-10);
assert(V1(1,2) < 1e-10);
assert(V1(2,2) < 1e-10);
// measure the angle between the reference frames
// k_ij is the angle between the triangle on the left and the one on the right
@@ -528,17 +528,25 @@ void igl::copyleft::comiso::NRosyField::computek()
ref0.normalize();
ref1.normalize();
double ktemp = std::atan2(ref1(1), ref1(0)) - std::atan2(ref0(1), ref0(0));
double ktemp = - std::atan2(ref1(1), ref1(0)) + std::atan2(ref0(1), ref0(0));
// make sure kappa is in corret range
auto pos_fmod = [](double x, double y){
return (0 == y) ? x : x - y * floor(x/y);
};
ktemp = pos_fmod(ktemp, 2*igl::PI);
if (ktemp > igl::PI)
ktemp -= 2*igl::PI;
// just to be sure, rotate ref0 using angle ktemp...
Eigen::MatrixXd R2(2,2);
R2 << std::cos(ktemp), -std::sin(ktemp), std::sin(ktemp), std::cos(ktemp);
R2 << std::cos(-ktemp), -std::sin(-ktemp), std::sin(-ktemp), std::cos(-ktemp);
tmp = R2*ref0.head<2>();
assert(tmp(0) - ref1(0) < 10^10);
assert(tmp(1) - ref1(1) < 10^10);
assert(tmp(0) - ref1(0) < 1e-10);
assert(tmp(1) - ref1(1) < 1e-10);
k[eid] = ktemp;
}
@@ -637,7 +645,7 @@ Eigen::Vector3d igl::copyleft::comiso::NRosyField::convertLocalto3D(unsigned fid
Eigen::VectorXd igl::copyleft::comiso::NRosyField::angleDefect()
{
Eigen::VectorXd A = Eigen::VectorXd::Constant(V.rows(),-2*igl::PI);
Eigen::VectorXd A = Eigen::VectorXd::Constant(V.rows(), 2*igl::PI);
for (unsigned int i = 0; i < F.rows(); ++i)
{
@@ -650,7 +658,7 @@ Eigen::VectorXd igl::copyleft::comiso::NRosyField::angleDefect()
t /= (a.norm() * b.norm());
else
throw std::runtime_error("igl::copyleft::comiso::NRosyField::angleDefect: Division by zero!");
A(F(i, j)) += std::acos(std::max(std::min(t, 1.), -1.));
A(F(i, j)) -= std::acos(std::max(std::min(t, 1.), -1.));
}
}
@@ -668,8 +676,8 @@ void igl::copyleft::comiso::NRosyField::findCones(int N)
{
if (!isBorderEdge[i])
{
singularityIndex(EV(i, 0)) -= k(i);
singularityIndex(EV(i, 1)) += k(i);
singularityIndex(EV(i, 0)) += k(i);
singularityIndex(EV(i, 1)) -= k(i);
}
}
@@ -687,8 +695,8 @@ void igl::copyleft::comiso::NRosyField::findCones(int N)
{
if (!isBorderEdge[i])
{
singularityIndex(EV(i, 0)) -= double(p(i)) / double(N);
singularityIndex(EV(i, 1)) += double(p(i)) / double(N);
singularityIndex(EV(i, 0)) += double(p(i)) / double(N);
singularityIndex(EV(i, 1)) -= double(p(i)) / double(N);
}
}
+2 -2
View File
@@ -139,7 +139,7 @@ IGL_INLINE bool igl::copyleft::quadprog(
#ifdef TRACE_SOLVER
std::cerr << "Add constraint " << iq << '/';
#endif
int i, j, k;
int j, k;
double cc, ss, h, t1, t2, xny;
/* we have to find the Givens rotation which will reduce the element
@@ -284,7 +284,7 @@ IGL_INLINE bool igl::copyleft::quadprog(
}
};
int i, j, k, l; /* indices */
int i, k, l; /* indices */
int ip, me, mi;
int n=g0.size(); int p=ce0.size(); int m=ci0.size();
MatrixXd R(G.rows(),G.cols()), J(G.rows(),G.cols());
@@ -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 "tetgenio_to_tetmesh.h"
@@ -18,11 +18,11 @@ IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
std::vector<std::vector<REAL > > & V,
std::vector<std::vector<int> > & T,
std::vector<std::vector<int > > & F,
std::vector<std::vector<REAL > >& R,
std::vector<std::vector<REAL > >& R,
std::vector<std::vector<int > >& N,
std::vector<std::vector<int > >& PT,
std::vector<std::vector<int > >& FT,
size_t & nR )
size_t & nR )
{
using namespace std;
// process points
@@ -63,11 +63,11 @@ IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
max_index = (max_index < index ? index : max_index);
}
}
assert(min_index >= 0);
assert(max_index >= 0);
assert(max_index < (int)V.size());
cout<<out.numberoftrifaces<<endl;
// When would this not be 4?
@@ -96,30 +96,30 @@ IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
// extract region marks
nR = hashUniqueRegions.size();
// extract neighbor list
N.resize(out.numberoftetrahedra, vector<int>(4));
// extract neighbor list
N.resize(out.numberoftetrahedra, vector<int>(4));
for (size_t i = 0; i < out.numberoftetrahedra; i++)
{
for (size_t j = 0; j < 4; j++)
N[i][j] = out.neighborlist[i * 4 + j];
}
// extract point 2 tetrahedron list
}
// extract point 2 tetrahedron list
PT.resize(out.numberofpoints, vector<int>(1));
for (size_t i = 0; i < out.numberofpoints; i++)
{
PT[i][0] = out.point2tetlist[i];
}
PT[i][0] = out.point2tetlist[i];
}
//extract face to tetrahedron list
FT.resize(out.numberoftrifaces, vector<int>(2));
FT.resize(out.numberoftrifaces, vector<int>(2));
int triface;
for (size_t i = 0; i < out.numberoftrifaces; i++)
{
for (size_t j = 0; j < 2; j++)
{
FT[i][j] = out.face2tetlist[0];
FT[i][j] = out.face2tetlist[0];
}
}
@@ -129,7 +129,7 @@ IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
const tetgenio & out,
std::vector<std::vector<REAL > > & V,
std::vector<std::vector<REAL > > & V,
std::vector<std::vector<int> > & T,
std::vector<std::vector<int> > & F)
{
@@ -182,7 +182,7 @@ IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
// loop over tetrahedra
for(int i = 0; i < out.numberoftrifaces; i++)
{
if(out.trifacemarkerlist[i]>=0)
if (out.trifacemarkerlist && out.trifacemarkerlist[i] >= 0)
{
vector<int> face(3);
for(int j = 0; j<3; j++)
@@ -198,7 +198,7 @@ IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
IGL_INLINE bool igl::copyleft::tetgen::tetgenio_to_tetmesh(
const tetgenio & out,
std::vector<std::vector<REAL > > & V,
std::vector<std::vector<REAL > > & V,
std::vector<std::vector<int> > & T)
{
std::vector<std::vector<int> > F;
+13 -13
View File
@@ -78,10 +78,10 @@ template <
typename DerivedTF,
typename DerivedTR>
IGL_INLINE int igl::copyleft::tetgen::tetrahedralize(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedH>& H,
const Eigen::PlainObjectBase<DerivedR>& R,
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedH>& H,
const Eigen::MatrixBase<DerivedR>& R,
const std::string switches,
Eigen::PlainObjectBase<DerivedTV>& TV,
Eigen::PlainObjectBase<DerivedTT>& TT,
@@ -191,8 +191,8 @@ template <
typename DerivedTT,
typename DerivedTF>
IGL_INLINE int igl::copyleft::tetgen::tetrahedralize(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const std::string switches,
Eigen::PlainObjectBase<DerivedTV>& TV,
Eigen::PlainObjectBase<DerivedTT>& TT,
@@ -235,10 +235,10 @@ template <
typename DerivedTF,
typename DerivedTM>
IGL_INLINE int igl::copyleft::tetgen::tetrahedralize(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedVM>& VM,
const Eigen::PlainObjectBase<DerivedFM>& FM,
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedVM>& VM,
const Eigen::MatrixBase<DerivedFM>& FM,
const std::string switches,
Eigen::PlainObjectBase<DerivedTV>& TV,
Eigen::PlainObjectBase<DerivedTT>& TT,
@@ -339,7 +339,7 @@ IGL_INLINE int igl::copyleft::tetgen::tetrahedralize(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template int igl::copyleft::tetgen::tetrahedralize<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&, 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 int igl::copyleft::tetgen::tetrahedralize<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<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> >(const 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> > &,const 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> > &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > &);
template int igl::copyleft::tetgen::tetrahedralize<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<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::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> > const&, 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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template int igl::copyleft::tetgen::tetrahedralize<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::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, 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 int igl::copyleft::tetgen::tetrahedralize<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<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> >(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<int, -1, 1, 0, -1, 1> > &,const Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > &,const 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> > &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > &);
template int igl::copyleft::tetgen::tetrahedralize<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<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::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, 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> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
#endif
+10 -10
View File
@@ -61,8 +61,8 @@ namespace igl
typename DerivedTT,
typename DerivedTF>
IGL_INLINE int tetrahedralize(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const std::string switches,
Eigen::PlainObjectBase<DerivedTV>& TV,
Eigen::PlainObjectBase<DerivedTT>& TT,
@@ -114,10 +114,10 @@ namespace igl
typename DerivedTF,
typename DerivedTM>
IGL_INLINE int tetrahedralize(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedVM>& VM,
const Eigen::PlainObjectBase<DerivedFM>& FM,
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedVM>& VM,
const Eigen::MatrixBase<DerivedFM>& FM,
const std::string switches,
Eigen::PlainObjectBase<DerivedTV>& TV,
Eigen::PlainObjectBase<DerivedTT>& TT,
@@ -185,10 +185,10 @@ namespace igl
typename DerivedTF,
typename DerivedTR>
IGL_INLINE int tetrahedralize(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::PlainObjectBase<DerivedH>& H,
const Eigen::PlainObjectBase<DerivedR>& R,
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedH>& H,
const Eigen::MatrixBase<DerivedR>& R,
const std::string switches,
Eigen::PlainObjectBase<DerivedTV>& TV,
Eigen::PlainObjectBase<DerivedTT>& TT,
+26 -24
View File
@@ -1,45 +1,47 @@
// 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 "cross.h"
// http://www.antisphere.com/Wiki/tools:anttweakbar
IGL_INLINE void igl::cross(
const double *a,
const double *b,
double *out)
const double *a,
const double *b,
double *out)
{
out[0] = a[1]*b[2]-a[2]*b[1];
out[1] = a[2]*b[0]-a[0]*b[2];
out[2] = a[0]*b[1]-a[1]*b[0];
out[0] = a[1] * b[2] - a[2] * b[1];
out[1] = a[2] * b[0] - a[0] * b[2];
out[2] = a[0] * b[1] - a[1] * b[0];
}
template <
typename DerivedA,
typename DerivedB,
typename DerivedC>
typename DerivedA,
typename DerivedB,
typename DerivedC>
IGL_INLINE void igl::cross(
const Eigen::PlainObjectBase<DerivedA> & A,
const Eigen::PlainObjectBase<DerivedB> & B,
Eigen::PlainObjectBase<DerivedC> & C)
const Eigen::PlainObjectBase<DerivedA> &A,
const Eigen::PlainObjectBase<DerivedB> &B,
Eigen::PlainObjectBase<DerivedC> &C)
{
assert(A.cols() == 3 && "#cols should be 3");
assert(B.cols() == 3 && "#cols should be 3");
assert(A.rows() == B.rows() && "#rows in A and B should be equal");
C.resize(A.rows(),3);
for(int d = 0;d<3;d++)
C.resize(A.rows(), 3);
for (int d = 0; d < 3; d++)
{
C.col(d) =
A.col((d+1)%3).array() * B.col((d+2)%3).array() -
A.col((d+2)%3).array() * B.col((d+1)%3).array();
C.col(d) =
A.col((d + 1) % 3).array() * B.col((d + 2) % 3).array() -
A.col((d + 2) % 3).array() * B.col((d + 1) % 3).array();
}
}
#ifdef IGL_STATIC_LIBRARY
template void igl::cross<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::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template void igl::cross<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::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
#endif
template void igl::cross<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::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> &);
template void igl::cross<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::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> &);
template void igl::cross<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::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1>> &);
template void igl::cross<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, 3, 0, -1, 3>>(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1>> const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3>> &);
#endif
+16 -16
View File
@@ -25,10 +25,10 @@ namespace igl {
{
public:
const Eigen::PlainObjectBase<DerivedV> &V;
const Eigen::PlainObjectBase<DerivedF> &F;
const Eigen::PlainObjectBase<DerivedV> &PD1;
const Eigen::PlainObjectBase<DerivedV> &PD2;
const Eigen::MatrixBase<DerivedV> &V;
const Eigen::MatrixBase<DerivedF> &F;
const Eigen::MatrixBase<DerivedV> &PD1;
const Eigen::MatrixBase<DerivedV> &PD2;
DerivedV N;
@@ -69,17 +69,17 @@ namespace igl {
public:
inline MismatchCalculator(const Eigen::PlainObjectBase<DerivedV> &_V,
const Eigen::PlainObjectBase<DerivedF> &_F,
const Eigen::PlainObjectBase<DerivedV> &_PD1,
const Eigen::PlainObjectBase<DerivedV> &_PD2):
inline MismatchCalculator(const Eigen::MatrixBase<DerivedV> &_V,
const Eigen::MatrixBase<DerivedF> &_F,
const Eigen::MatrixBase<DerivedV> &_PD1,
const Eigen::MatrixBase<DerivedV> &_PD2):
V(_V),
F(_F),
PD1(_PD1),
PD2(_PD2)
{
igl::per_face_normals(V,F,N);
V_border = igl::is_border_vertex(V,F);
V_border = igl::is_border_vertex(F);
igl::vertex_triangle_adjacency(V,F,VF,VFi);
igl::triangle_triangle_adjacency(F,TT,TTi);
}
@@ -102,10 +102,10 @@ public:
};
}
template <typename DerivedV, typename DerivedF, typename DerivedM>
IGL_INLINE void igl::cross_field_mismatch(const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedV> &PD1,
const Eigen::PlainObjectBase<DerivedV> &PD2,
IGL_INLINE void igl::cross_field_mismatch(const Eigen::MatrixBase<DerivedV> &V,
const Eigen::MatrixBase<DerivedF> &F,
const Eigen::MatrixBase<DerivedV> &PD1,
const Eigen::MatrixBase<DerivedV> &PD2,
const bool isCombed,
Eigen::PlainObjectBase<DerivedM> &mismatch)
{
@@ -125,8 +125,8 @@ IGL_INLINE void igl::cross_field_mismatch(const Eigen::PlainObjectBase<DerivedV>
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::cross_field_mismatch<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const &, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const &, const bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > &);
template void igl::cross_field_mismatch<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 &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, const bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > &);
template void igl::cross_field_mismatch<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(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> > const &, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, const bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > &);
template void igl::cross_field_mismatch<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const &, Eigen::MatrixBase<Eigen::Matrix<int, -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 &, const bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > &);
template void igl::cross_field_mismatch<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 &, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, Eigen::MatrixBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const &, const bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > &);
template void igl::cross_field_mismatch<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 0, -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 &, const bool, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > &);
#endif
+4 -4
View File
@@ -29,10 +29,10 @@ namespace igl
//
template <typename DerivedV, typename DerivedF, typename DerivedM>
IGL_INLINE void cross_field_mismatch(const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedV> &PD1,
const Eigen::PlainObjectBase<DerivedV> &PD2,
IGL_INLINE void cross_field_mismatch(const Eigen::MatrixBase<DerivedV> &V,
const Eigen::MatrixBase<DerivedF> &F,
const Eigen::MatrixBase<DerivedV> &PD1,
const Eigen::MatrixBase<DerivedV> &PD2,
const bool isCombed,
Eigen::PlainObjectBase<DerivedM> &mismatch);
}
+11 -11
View File
@@ -1,9 +1,9 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
//
// Copyright (C) 2017 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 "crouzeix_raviart_cotmatrix.h"
#include "unique_simplices.h"
@@ -13,14 +13,14 @@
template <typename DerivedV, typename DerivedF, typename LT, typename DerivedE, typename DerivedEMAP>
void igl::crouzeix_raviart_cotmatrix(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::SparseMatrix<LT> & L,
Eigen::PlainObjectBase<DerivedE> & E,
Eigen::PlainObjectBase<DerivedEMAP> & EMAP)
{
// All occurrences of directed "facets"
Eigen::MatrixXi allE;
Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, Eigen::Dynamic> allE;
oriented_facets(F,allE);
Eigen::VectorXi _1;
unique_simplices(allE,E,_1,EMAP);
@@ -29,8 +29,8 @@ void igl::crouzeix_raviart_cotmatrix(
template <typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedEMAP, typename LT>
void igl::crouzeix_raviart_cotmatrix(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<DerivedE> & E,
const Eigen::MatrixBase<DerivedEMAP> & EMAP,
Eigen::SparseMatrix<LT> & L)
@@ -84,8 +84,8 @@ void igl::crouzeix_raviart_cotmatrix(
for(int c = 0;c<k;c++)
{
LIJV.emplace_back(
EMAP(F2E(f,LI(c))),
EMAP(F2E(f,LJ(c))),
EMAP(F2E(f,LI(c)), 0),
EMAP(F2E(f,LJ(c)), 0),
(c<(k/2)?-1.:1.) * factor *C(f,LV(c)));
}
}
+4 -4
View File
@@ -18,16 +18,16 @@
template <typename MT, typename DerivedV, typename DerivedF, typename DerivedE, typename DerivedEMAP>
void igl::crouzeix_raviart_massmatrix(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::SparseMatrix<MT> & M,
Eigen::PlainObjectBase<DerivedE> & E,
Eigen::PlainObjectBase<DerivedEMAP> & EMAP)
{
// All occurrences of directed "facets"
Eigen::MatrixXi allE;
Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, Eigen::Dynamic> allE;
oriented_facets(F,allE);
Eigen::VectorXi _1;
Eigen::Matrix<typename DerivedF::Scalar, Eigen::Dynamic, 1> _1;
unique_simplices(allE,E,_1,EMAP);
return crouzeix_raviart_massmatrix(V,F,E,EMAP,M);
}
@@ -69,7 +69,7 @@ void igl::crouzeix_raviart_massmatrix(
{
for(int c = 0;c<ss;c++)
{
MIJV[f+m*c] = Triplet<MT>(EMAP(f+m*c),EMAP(f+m*c),TA(f)/(double)(ss));
MIJV[f+m*c] = Triplet<MT>(EMAP(f+m*c, 0),EMAP(f+m*c, 0),TA(f)/(double)(ss));
}
}
M.resize(E.rows(),E.rows());
+2
View File
@@ -60,6 +60,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> >&);
// generated by autoexplicit.sh
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> >&);
+136 -317
View File
@@ -1,330 +1,149 @@
// 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
//
// Copyright (C) 2019 Hanxiao Shen <hanxiao@cims.nyu.edu>
//
// 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 <igl/cut_mesh.h>
#include <igl/vertex_triangle_adjacency.h>
#include <igl/triangle_triangle_adjacency.h>
#include <igl/is_border_vertex.h>
#include <igl/HalfEdgeIterator.h>
#include <set>
#include <igl/is_border_vertex.h>
// This file violates many of the libigl style guidelines.
namespace igl {
template <typename DerivedV, typename DerivedF, typename VFType, typename DerivedTT, typename DerivedC>
class MeshCutterMini
{
public:
// Input
//mesh
const Eigen::PlainObjectBase<DerivedV> &V;
const Eigen::PlainObjectBase<DerivedF> &F;
// TT is the same type as TTi? This is likely to break at some point
const Eigen::PlainObjectBase<DerivedTT> &TT;
const Eigen::PlainObjectBase<DerivedTT> &TTi;
const std::vector<std::vector<VFType> >& VF;
const std::vector<std::vector<VFType> >& VFi;
const std::vector<bool> &V_border; // bool
//edges to cut
const Eigen::PlainObjectBase<DerivedC> &Handle_Seams; // 3 bool
// total number of scalar variables
int num_scalar_variables;
// per face indexes of vertex in the solver
DerivedF HandleS_Index;
// per vertex variable indexes
std::vector<std::vector<int> > HandleV_Integer;
IGL_INLINE MeshCutterMini(
const Eigen::PlainObjectBase<DerivedV> &_V,
const Eigen::PlainObjectBase<DerivedF> &_F,
const Eigen::PlainObjectBase<DerivedTT> &_TT,
const Eigen::PlainObjectBase<DerivedTT> &_TTi,
const std::vector<std::vector<VFType> > &_VF,
const std::vector<std::vector<VFType> > &_VFi,
const std::vector<bool> &_V_border,
const Eigen::PlainObjectBase<DerivedC> &_Handle_Seams);
// vertex to variable mapping
// initialize the mapping for a given sampled mesh
IGL_INLINE void InitMappingSeam();
private:
IGL_INLINE void FirstPos(const int v, int &f, int &edge);
IGL_INLINE int AddNewIndex(const int v0);
IGL_INLINE bool IsSeam(const int f0, const int f1);
// find initial position of the pos to
// assing face to vert inxex correctly
IGL_INLINE void FindInitialPos(const int vert, int &edge, int &face);
// initialize the mapping given an initial pos
// whih must be initialized with FindInitialPos
IGL_INLINE void MapIndexes(const int vert, const int edge_init, const int f_init);
// initialize the mapping for a given vertex
IGL_INLINE void InitMappingSeam(const int vert);
};
}
template <typename DerivedV, typename DerivedF, typename VFType, typename DerivedTT, typename DerivedC>
IGL_INLINE igl::MeshCutterMini<DerivedV, DerivedF, VFType, DerivedTT, DerivedC>::
MeshCutterMini(
const Eigen::PlainObjectBase<DerivedV> &_V,
const Eigen::PlainObjectBase<DerivedF> &_F,
const Eigen::PlainObjectBase<DerivedTT> &_TT,
const Eigen::PlainObjectBase<DerivedTT> &_TTi,
const std::vector<std::vector<VFType> > &_VF,
const std::vector<std::vector<VFType> > &_VFi,
const std::vector<bool> &_V_border,
const Eigen::PlainObjectBase<DerivedC> &_Handle_Seams):
V(_V),
F(_F),
TT(_TT),
TTi(_TTi),
VF(_VF),
VFi(_VFi),
V_border(_V_border),
Handle_Seams(_Handle_Seams)
{
num_scalar_variables=0;
HandleS_Index.setConstant(F.rows(),3,-1);
HandleV_Integer.resize(V.rows());
}
template <typename DerivedV, typename DerivedF, typename VFType, typename DerivedTT, typename DerivedC>
IGL_INLINE void igl::MeshCutterMini<DerivedV, DerivedF, VFType, DerivedTT, DerivedC>::
FirstPos(const int v, int &f, int &edge)
{
f = VF[v][0]; // f=v->cVFp();
edge = VFi[v][0]; // edge=v->cVFi();
}
template <typename DerivedV, typename DerivedF, typename VFType, typename DerivedTT, typename DerivedC>
IGL_INLINE int igl::MeshCutterMini<DerivedV, DerivedF, VFType, DerivedTT, DerivedC>::
AddNewIndex(const int v0)
{
num_scalar_variables++;
HandleV_Integer[v0].push_back(num_scalar_variables);
return num_scalar_variables;
}
template <typename DerivedV, typename DerivedF, typename VFType, typename DerivedTT, typename DerivedC>
IGL_INLINE bool igl::MeshCutterMini<DerivedV, DerivedF, VFType, DerivedTT, DerivedC>::
IsSeam(const int f0, const int f1)
{
for (int i=0;i<3;i++)
{
int f_clos = TT(f0,i);
if (f_clos == -1)
continue; ///border
if (f_clos == f1)
return(Handle_Seams(f0,i));
}
assert(0);
return false;
}
///find initial position of the pos to
// assing face to vert inxex correctly
template <typename DerivedV, typename DerivedF, typename VFType, typename DerivedTT, typename DerivedC>
IGL_INLINE void igl::MeshCutterMini<DerivedV, DerivedF, VFType, DerivedTT, DerivedC>::
FindInitialPos(const int vert,
int &edge,
int &face)
{
int f_init;
int edge_init;
FirstPos(vert,f_init,edge_init); // todo manually the function
igl::HalfEdgeIterator<DerivedF,DerivedTT,DerivedTT> VFI(F,TT,TTi,f_init,edge_init);
bool vertexB = V_border[vert];
bool possible_split=false;
bool complete_turn=false;
do
{
int curr_f = VFI.Fi();
int curr_edge=VFI.Ei();
VFI.NextFE();
int next_f=VFI.Fi();
///test if I've just crossed a border
bool on_border=(TT(curr_f,curr_edge)==-1);
//bool mismatch=false;
bool seam=false;
///or if I've just crossed a seam
///if I'm on a border I MUST start from the one next t othe border
if (!vertexB)
//seam=curr_f->IsSeam(next_f);
seam=IsSeam(curr_f,next_f);
// if (vertexB)
// assert(!Handle_Singular(vert));
// ;
//assert(!vert->IsSingular());
possible_split=((on_border)||(seam));
complete_turn = next_f == f_init;
} while ((!possible_split)&&(!complete_turn));
face=VFI.Fi();
edge=VFI.Ei();
}
///initialize the mapping given an initial pos
///whih must be initialized with FindInitialPos
template <typename DerivedV, typename DerivedF, typename VFType, typename DerivedTT, typename DerivedC>
IGL_INLINE void igl::MeshCutterMini<DerivedV, DerivedF, VFType, DerivedTT, DerivedC>::
MapIndexes(const int vert,
const int edge_init,
const int f_init)
{
///check that is not on border..
///in such case maybe it's non manyfold
///insert an initial index
int curr_index=AddNewIndex(vert);
///and initialize the jumping pos
igl::HalfEdgeIterator<DerivedF,DerivedTT,DerivedTT> VFI(F,TT,TTi,f_init,edge_init);
bool complete_turn=false;
do
{
int curr_f = VFI.Fi();
int curr_edge = VFI.Ei();
///assing the current index
HandleS_Index(curr_f,curr_edge) = curr_index;
VFI.NextFE();
int next_f = VFI.Fi();
///test if I've finiseh with the face exploration
complete_turn = (next_f==f_init);
///or if I've just crossed a mismatch
if (!complete_turn)
{
bool seam=false;
//seam=curr_f->IsSeam(next_f);
seam=IsSeam(curr_f,next_f);
if (seam)
{
///then add a new index
curr_index=AddNewIndex(vert);
}
}
} while (!complete_turn);
}
///initialize the mapping for a given vertex
template <typename DerivedV, typename DerivedF, typename VFType, typename DerivedTT, typename DerivedC>
IGL_INLINE void igl::MeshCutterMini<DerivedV, DerivedF, VFType, DerivedTT, DerivedC>::
InitMappingSeam(const int vert)
{
///first rotate until find the first pos after a mismatch
///or a border or return to the first position...
int f_init = VF[vert][0];
int indexE = VFi[vert][0];
igl::HalfEdgeIterator<DerivedF,DerivedTT,DerivedTT> VFI(F,TT,TTi,f_init,indexE);
int edge_init;
int face_init;
FindInitialPos(vert,edge_init,face_init);
MapIndexes(vert,edge_init,face_init);
}
///vertex to variable mapping
///initialize the mapping for a given sampled mesh
template <typename DerivedV, typename DerivedF, typename VFType, typename DerivedTT, typename DerivedC>
IGL_INLINE void igl::MeshCutterMini<DerivedV, DerivedF, VFType, DerivedTT, DerivedC>::
InitMappingSeam()
{
num_scalar_variables=-1;
for (unsigned int i=0;i<V.rows();i++)
InitMappingSeam(i);
for (unsigned int j=0;j<V.rows();j++)
assert(HandleV_Integer[j].size()>0);
}
template <typename DerivedV, typename DerivedF, typename VFType, typename DerivedTT, typename DerivedC>
IGL_INLINE void igl::cut_mesh(
const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const std::vector<std::vector<VFType> >& VF,
const std::vector<std::vector<VFType> >& VFi,
const Eigen::PlainObjectBase<DerivedTT>& TT,
const Eigen::PlainObjectBase<DerivedTT>& TTi,
const std::vector<bool> &V_border,
const Eigen::PlainObjectBase<DerivedC> &cuts,
Eigen::PlainObjectBase<DerivedV> &Vcut,
Eigen::PlainObjectBase<DerivedF> &Fcut)
{
//finding the cuts is done, now we need to actually generate a cut mesh
igl::MeshCutterMini<DerivedV, DerivedF, VFType, DerivedTT, DerivedC> mc(V, F, TT, TTi, VF, VFi, V_border, cuts);
mc.InitMappingSeam();
Fcut = mc.HandleS_Index;
//we have the faces, we need the vertices;
int newNumV = Fcut.maxCoeff()+1;
Vcut.setZero(newNumV,3);
for (int vi=0; vi<V.rows(); ++vi)
for (int i=0; i<mc.HandleV_Integer[vi].size();++i)
Vcut.row(mc.HandleV_Integer[vi][i]) = V.row(vi);
//ugly hack to fix some problematic cases (border vertex that is also on the boundary of the hole
for (int fi =0; fi<Fcut.rows(); ++fi)
for (int k=0; k<3; ++k)
if (Fcut(fi,k)==-1)
{
//we need to add a vertex
Fcut(fi,k) = newNumV;
newNumV ++;
Vcut.conservativeResize(newNumV, Eigen::NoChange);
Vcut.row(newNumV-1) = V.row(F(fi,k));
}
}
//Wrapper of the above with only vertices and faces as mesh input
// wrapper for input/output style
template <typename DerivedV, typename DerivedF, typename DerivedC>
IGL_INLINE void igl::cut_mesh(
const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedC> &cuts,
Eigen::PlainObjectBase<DerivedV> &Vcut,
Eigen::PlainObjectBase<DerivedF> &Fcut)
{
std::vector<std::vector<int> > VF, VFi;
igl::vertex_triangle_adjacency(V,F,VF,VFi);
// Alec: Cast? Why? This is likely to break.
Eigen::MatrixXd Vt = V;
Eigen::MatrixXi Ft = F;
Eigen::MatrixXi TT, TTi;
igl::triangle_triangle_adjacency(Ft,TT,TTi);
std::vector<bool> V_border = igl::is_border_vertex(V,F);
igl::cut_mesh(V, F, VF, VFi, TT, TTi, V_border, cuts, Vcut, Fcut);
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedC>& C,
Eigen::PlainObjectBase<DerivedV>& Vn,
Eigen::PlainObjectBase<DerivedF>& Fn
){
Vn = V;
Fn = F;
typedef typename DerivedF::Scalar Index;
Eigen::Matrix<Index,Eigen::Dynamic,1> _I;
cut_mesh(Vn,Fn,C,_I);
}
template <typename DerivedV, typename DerivedF, typename DerivedC, typename DerivedI>
IGL_INLINE void igl::cut_mesh(
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedC>& C,
Eigen::PlainObjectBase<DerivedV>& Vn,
Eigen::PlainObjectBase<DerivedF>& Fn,
Eigen::PlainObjectBase<DerivedI>& I
){
Vn = V;
Fn = F;
cut_mesh(Vn,Fn,C,I);
}
template <typename DerivedV, typename DerivedF, typename DerivedC, typename DerivedI>
IGL_INLINE void igl::cut_mesh(
Eigen::PlainObjectBase<DerivedV>& V,
Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedC>& C,
Eigen::PlainObjectBase<DerivedI>& I
){
typedef typename DerivedF::Scalar Index;
DerivedF FF, FFi;
igl::triangle_triangle_adjacency(F,FF,FFi);
igl::cut_mesh(V,F,FF,FFi,C,I);
}
template <typename DerivedV, typename DerivedF, typename DerivedFF, typename DerivedFFi, typename DerivedC, typename DerivedI>
IGL_INLINE void igl::cut_mesh(
Eigen::PlainObjectBase<DerivedV>& V,
Eigen::PlainObjectBase<DerivedF>& F,
Eigen::MatrixBase<DerivedFF>& FF,
Eigen::MatrixBase<DerivedFFi>& FFi,
const Eigen::MatrixBase<DerivedC>& C,
Eigen::PlainObjectBase<DerivedI>& I
){
typedef typename DerivedF::Scalar Index;
// store current number of occurance of each vertex as the alg proceed
Eigen::Matrix<Index,Eigen::Dynamic,1> occurence(V.rows());
occurence.setConstant(1);
// set eventual number of occurance of each vertex expected
Eigen::Matrix<Index,Eigen::Dynamic,1> eventual(V.rows());
eventual.setZero();
for(Index i=0;i<F.rows();i++){
for(Index k=0;k<3;k++){
Index u = F(i,k);
Index v = F(i,(k+1)%3);
if(FF(i,k) == -1){ // add one extra occurance for boundary vertices
eventual(u) += 1;
}else if(C(i,k) == 1 && u < v){ // only compute every (undirected) edge ones
eventual(u) += 1;
eventual(v) += 1;
}
}
}
// original number of vertices
Index n_v = V.rows();
// estimate number of new vertices and resize V
Index n_new = 0;
for(Index i=0;i<eventual.rows();i++)
n_new += ((eventual(i) > 0) ? eventual(i)-1 : 0);
V.conservativeResize(n_v+n_new,Eigen::NoChange);
I = DerivedI::LinSpaced(V.rows(),0,V.rows());
// pointing to the current bottom of V
Index pos = n_v;
for(Index f=0;f<C.rows();f++){
for(Index k=0;k<3;k++){
Index v0 = F(f,k);
if(F(f,k) >= n_v) continue; // ignore new vertices
if(C(f,k) == 1 && occurence(v0) != eventual(v0)){
igl::HalfEdgeIterator<DerivedF,DerivedF,DerivedF> he(F,FF,FFi,f,k);
// rotate clock-wise around v0 until hit another cut
std::vector<Index> fan;
Index fi = he.Fi();
Index ei = he.Ei();
do{
fan.push_back(fi);
he.flipE();
he.flipF();
fi = he.Fi();
ei = he.Ei();
}while(C(fi,ei) == 0 && !he.isBorder());
// make a copy
V.row(pos) << V.row(v0);
I(pos) = v0;
// add one occurance to v0
occurence(v0) += 1;
// replace old v0
for(Index f0: fan)
for(Index j=0;j<3;j++)
if(F(f0,j) == v0)
F(f0,j) = pos;
// mark cuts as boundary
FF(f,k) = -1;
FF(fi,ei) = -1;
pos++;
}
}
}
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::cut_mesh<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, int, 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<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, std::vector<bool, std::allocator<bool> > 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> >&);
template void igl::cut_mesh<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> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::cut_mesh<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
template void igl::cut_mesh<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(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, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::cut_mesh<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
template void igl::cut_mesh<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 0, -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<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::cut_mesh<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::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> >&);
template void igl::cut_mesh<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::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<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> >&);
#endif
+46 -45
View File
@@ -1,78 +1,79 @@
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2015 Olga Diamanti <olga.diam@gmail.com>
// Copyright (C) 2019 Hanxiao Shen <hanxiao@cims.nyu.edu>
//
// 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_CUT_MESH
#define IGL_CUT_MESH
#ifndef IGL_CUT_MESH_H
#define IGL_CUT_MESH_H
#include "igl_inline.h"
#include <Eigen/Core>
#include <vector>
namespace igl
{
// Given a mesh and a list of edges that are to be cut, the function
// generates a new disk-topology mesh that has the cuts at its boundary.
//
// Todo: this combinatorial operation should not depend on the vertex
// positions V.
//
// Known issues: Assumes mesh is edge-manifold.
//
// Inputs:
// V #V by 3 list of the vertex positions
// F #F by 3 list of the faces (must be triangles)
// VF #V list of lists of incident faces (adjacency list), e.g. as
// returned by igl::vertex_triangle_adjacency
// VFi #V list of lists of index of incidence within incident faces listed
// in VF, e.g. as returned by igl::vertex_triangle_adjacency
// TT #F by 3 triangle to triangle adjacent matrix (e.g. computed via
// igl:triangle_triangle_adjacency)
// TTi #F by 3 adjacent matrix, the element i,j is the id of edge of the
// triangle TT(i,j) that is adjacent with triangle i (e.g. computed via
// igl:triangle_triangle_adjacency)
// V_border #V by 1 list of booleans, indicating if the corresponging
// vertex is at the mesh boundary, e.g. as returned by
// igl::is_border_vertex
// F #F by 3 list of the faces
// cuts #F by 3 list of boolean flags, indicating the edges that need to
// be cut (has 1 at the face edges that are to be cut, 0 otherwise)
// Outputs:
// Vcut #V by 3 list of the vertex positions of the cut mesh. This matrix
// Vn #V by 3 list of the vertex positions of the cut mesh. This matrix
// will be similar to the original vertices except some rows will be
// duplicated.
// Fcut #F by 3 list of the faces of the cut mesh(must be triangles). This
// Fn #F by 3 list of the faces of the cut mesh(must be triangles). This
// matrix will be similar to the original face matrix except some indices
// will be redirected to point to the newly duplicated vertices.
//
template <
typename DerivedV,
typename DerivedF,
typename VFType,
typename DerivedTT,
typename DerivedC>
// I #V by 1 list of the map between Vn to original V index.
// In place mesh cut
template <typename DerivedV, typename DerivedF, typename DerivedC, typename DerivedI>
IGL_INLINE void cut_mesh(
const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const std::vector<std::vector<VFType> >& VF,
const std::vector<std::vector<VFType> >& VFi,
const Eigen::PlainObjectBase<DerivedTT>& TT,
const Eigen::PlainObjectBase<DerivedTT>& TTi,
const std::vector<bool> &V_border,
const Eigen::PlainObjectBase<DerivedC> &cuts,
Eigen::PlainObjectBase<DerivedV> &Vcut,
Eigen::PlainObjectBase<DerivedF> &Fcut);
//Wrapper of the above with only vertices and faces as mesh input
Eigen::PlainObjectBase<DerivedV>& V,
Eigen::PlainObjectBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedC>& cuts,
Eigen::PlainObjectBase<DerivedI>& I
);
template <typename DerivedV, typename DerivedF, typename DerivedFF, typename DerivedFFi, typename DerivedC, typename DerivedI>
IGL_INLINE void cut_mesh(
Eigen::PlainObjectBase<DerivedV>& V,
Eigen::PlainObjectBase<DerivedF>& F,
Eigen::MatrixBase<DerivedFF>& FF,
Eigen::MatrixBase<DerivedFFi>& FFi,
const Eigen::MatrixBase<DerivedC>& C,
Eigen::PlainObjectBase<DerivedI>& I
);
template <typename DerivedV, typename DerivedF, typename DerivedC>
IGL_INLINE void cut_mesh(
const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedC> &cuts,
Eigen::PlainObjectBase<DerivedV> &Vcut,
Eigen::PlainObjectBase<DerivedF> &Fcut);
};
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedC>& cuts,
Eigen::PlainObjectBase<DerivedV>& Vn,
Eigen::PlainObjectBase<DerivedF>& Fn
);
template <typename DerivedV, typename DerivedF, typename DerivedC, typename DerivedI>
IGL_INLINE void cut_mesh(
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DerivedC>& cuts,
Eigen::PlainObjectBase<DerivedV>& Vn,
Eigen::PlainObjectBase<DerivedF>& Fn,
Eigen::PlainObjectBase<DerivedI>& I
);
}
#ifndef IGL_STATIC_LIBRARY
+16 -16
View File
@@ -25,9 +25,9 @@ namespace igl {
class MeshCutter
{
protected:
const Eigen::PlainObjectBase<DerivedV> &V;
const Eigen::PlainObjectBase<DerivedF> &F;
const Eigen::PlainObjectBase<DerivedM> &Handle_MMatch;
const Eigen::MatrixBase<DerivedV> &V;
const Eigen::MatrixBase<DerivedF> &F;
const Eigen::MatrixBase<DerivedM> &Handle_MMatch;
Eigen::VectorXi F_visited;
DerivedF TT;
@@ -140,9 +140,9 @@ namespace igl {
public:
inline MeshCutter(const Eigen::PlainObjectBase<DerivedV> &V_,
const Eigen::PlainObjectBase<DerivedF> &F_,
const Eigen::PlainObjectBase<DerivedM> &Handle_MMatch_):
inline MeshCutter(const Eigen::MatrixBase<DerivedV> &V_,
const Eigen::MatrixBase<DerivedF> &F_,
const Eigen::MatrixBase<DerivedM> &Handle_MMatch_):
V(V_),
F(F_),
Handle_MMatch(Handle_MMatch_)
@@ -184,9 +184,9 @@ template <typename DerivedV,
typename DerivedF,
typename DerivedM,
typename DerivedO>
IGL_INLINE void igl::cut_mesh_from_singularities(const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedM> &Handle_MMatch,
IGL_INLINE void igl::cut_mesh_from_singularities(const Eigen::MatrixBase<DerivedV> &V,
const Eigen::MatrixBase<DerivedF> &F,
const Eigen::MatrixBase<DerivedM> &Handle_MMatch,
Eigen::PlainObjectBase<DerivedO> &Handle_Seams)
{
igl::MeshCutter< DerivedV, DerivedF, DerivedM, DerivedO> mc(V, F, Handle_MMatch);
@@ -195,11 +195,11 @@ IGL_INLINE void igl::cut_mesh_from_singularities(const Eigen::PlainObjectBase<De
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
template void igl::cut_mesh_from_singularities<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::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> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::cut_mesh_from_singularities<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::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> >&);
template void igl::cut_mesh_from_singularities<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, 3, 0, -1, 3> >(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, 3, 0, -1, 3> >&);
template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(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, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, 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&, Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<double, -1, 3, 0, -1, 3>, 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&, Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::MatrixBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
template void igl::cut_mesh_from_singularities<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::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<int, -1, -1, 0, -1, -1> >&);
template void igl::cut_mesh_from_singularities<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::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
template void igl::cut_mesh_from_singularities<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, 3, 0, -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<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
template void igl::cut_mesh_from_singularities<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -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<int, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> >&);
#endif
+3 -3
View File
@@ -30,9 +30,9 @@ namespace igl
typename DerivedM,
typename DerivedO>
IGL_INLINE void cut_mesh_from_singularities(
const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedM> &MMatch,
const Eigen::MatrixBase<DerivedV> &V,
const Eigen::MatrixBase<DerivedF> &F,
const Eigen::MatrixBase<DerivedM> &MMatch,
Eigen::PlainObjectBase<DerivedO> &seams);
}
#ifndef IGL_STATIC_LIBRARY
-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
+34 -11
View File
@@ -8,21 +8,44 @@
#ifndef IGL_DEPRECATED_H
#define IGL_DEPRECATED_H
// Macro for marking a function as deprecated.
//
// http://stackoverflow.com/a/295229/148668
#ifdef __GNUC__
#define IGL_DEPRECATED(func) func __attribute__ ((deprecated))
#elif defined(_MSC_VER)
#define IGL_DEPRECATED(func) __declspec(deprecated) func
// Use C++14 feature [[deprecated]] if available.
// See also https://stackoverflow.com/questions/295120/c-mark-as-deprecated/21265197#21265197
#ifdef __has_cpp_attribute
# define IGL_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
#else
#pragma message("WARNING: You need to implement IGL_DEPRECATED for this compiler")
#define IGL_DEPRECATED(func) func
# define IGL_HAS_CPP_ATTRIBUTE(x) 0
#endif
#ifdef _MSC_VER
# define IGL_MSC_VER _MSC_VER
#else
# define IGL_MSC_VER 0
#endif
#ifndef IGL_DEPRECATED
# if (IGL_HAS_CPP_ATTRIBUTE(deprecated) && __cplusplus >= 201402L) || \
IGL_MSC_VER >= 1900
# define IGL_DEPRECATED [[deprecated]]
# else
# if defined(__GNUC__) || defined(__clang__)
# define IGL_DEPRECATED __attribute__((deprecated))
# elif IGL_MSC_VER
# define IGL_DEPRECATED __declspec(deprecated)
# else
# pragma message("WARNING: You need to implement IGL_DEPRECATED for this compiler")
# define IGL_DEPRECATED /* deprecated */
# endif
# endif
#endif
// Usage:
//
// template <typename T> IGL_INLINE void my_func(Arg1 a);
// template <typename T>
// IGL_INLINE void my_func(Arg1 a);
//
// becomes
// becomes
//
// template <typename T> IGL_INLINE IGL_DEPRECATED(void my_func(Arg1 a));
// template <typename T>
// IGL_DEPRECATED IGL_INLINE void my_func(Arg1 a);
#endif
+6 -6
View File
@@ -17,8 +17,8 @@ template <
typename Derivedtheta,
typename Derivedcos_theta>
IGL_INLINE void igl::dihedral_angles(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedT>& T,
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedT>& T,
Eigen::PlainObjectBase<Derivedtheta>& theta,
Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta)
{
@@ -37,8 +37,8 @@ template <
typename Derivedtheta,
typename Derivedcos_theta>
IGL_INLINE void igl::dihedral_angles_intrinsic(
const Eigen::PlainObjectBase<DerivedL>& L,
const Eigen::PlainObjectBase<DerivedA>& A,
const Eigen::MatrixBase<DerivedL>& L,
const Eigen::MatrixBase<DerivedA>& A,
Eigen::PlainObjectBase<Derivedtheta>& theta,
Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta)
{
@@ -93,6 +93,6 @@ IGL_INLINE void igl::dihedral_angles_intrinsic(
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::dihedral_angles_intrinsic< Eigen::Matrix<double, -1, 6, 0, -1, 6>, Eigen::Matrix<double, -1, 4, 0, -1, 4>, Eigen::Matrix<double, -1, 6, 0, -1, 6>, Eigen::Matrix<double, -1, 6, 0, -1, 6> >(const Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 6, 0, -1, 6> >&, const Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 4, 0, -1, 4> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 6, 0, -1, 6> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 6, 0, -1, 6> >&);
template void igl::dihedral_angles<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::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<double, -1, -1, 0, -1, -1> >&);
template void igl::dihedral_angles_intrinsic< Eigen::Matrix<double, -1, 6, 0, -1, 6>, Eigen::Matrix<double, -1, 4, 0, -1, 4>, Eigen::Matrix<double, -1, 6, 0, -1, 6>, Eigen::Matrix<double, -1, 6, 0, -1, 6> >(const Eigen::MatrixBase<Eigen::Matrix<double, -1, 6, 0, -1, 6> >&, const Eigen::MatrixBase<Eigen::Matrix<double, -1, 4, 0, -1, 4> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 6, 0, -1, 6> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 6, 0, -1, 6> >&);
template void igl::dihedral_angles<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::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
#endif
+4 -4
View File
@@ -30,8 +30,8 @@ namespace igl
typename Derivedtheta,
typename Derivedcos_theta>
IGL_INLINE void dihedral_angles(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedT>& T,
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedT>& T,
Eigen::PlainObjectBase<Derivedtheta>& theta,
Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta);
template <
@@ -40,8 +40,8 @@ namespace igl
typename Derivedtheta,
typename Derivedcos_theta>
IGL_INLINE void dihedral_angles_intrinsic(
const Eigen::PlainObjectBase<DerivedL>& L,
const Eigen::PlainObjectBase<DerivedA>& A,
const Eigen::MatrixBase<DerivedL>& L,
const Eigen::MatrixBase<DerivedA>& A,
Eigen::PlainObjectBase<Derivedtheta>& theta,
Eigen::PlainObjectBase<Derivedcos_theta>& cos_theta);
+51
View File
@@ -79,8 +79,59 @@ IGL_INLINE void igl::dijkstra(
path.push_back(source);
}
template <typename IndexType, typename DerivedV,
typename DerivedD, typename DerivedP>
IGL_INLINE int igl::dijkstra(
const Eigen::MatrixBase<DerivedV> &V,
const std::vector<std::vector<IndexType> >& VV,
const IndexType &source,
const std::set<IndexType> &targets,
Eigen::PlainObjectBase<DerivedD> &min_distance,
Eigen::PlainObjectBase<DerivedP> &previous)
{
int numV = VV.size();
min_distance.setConstant(numV, 1, std::numeric_limits<typename DerivedD::Scalar>::infinity());
min_distance[source] = 0;
previous.setConstant(numV, 1, -1);
std::set<std::pair<typename DerivedD::Scalar, IndexType> > vertex_queue;
vertex_queue.insert(std::make_pair(min_distance[source], source));
while (!vertex_queue.empty())
{
typename DerivedD::Scalar dist = vertex_queue.begin()->first;
IndexType u = vertex_queue.begin()->second;
vertex_queue.erase(vertex_queue.begin());
if (targets.find(u)!= targets.end())
return u;
// Visit each edge exiting u
const std::vector<int> &neighbors = VV[u];
for (std::vector<int>::const_iterator neighbor_iter = neighbors.begin();
neighbor_iter != neighbors.end();
neighbor_iter++)
{
IndexType v = *neighbor_iter;
typename DerivedD::Scalar distance_through_u = dist + (V.row(u) - V.row(v)).norm();
if (distance_through_u < min_distance[v]) {
vertex_queue.erase(std::make_pair(min_distance[v], v));
min_distance[v] = distance_through_u;
previous[v] = u;
vertex_queue.insert(std::make_pair(min_distance[v], v));
}
}
}
return -1;
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template int igl::dijkstra<int, Eigen::Matrix<double, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(int const&, std::set<int, std::less<int>, std::allocator<int> > const&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
template void igl::dijkstra<int, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(int const&, Eigen::MatrixBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> > const&, std::vector<int, std::allocator<int> >&);
template int igl::dijkstra<int, 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&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > > const&, int const&, std::set<int, std::less<int>, std::allocator<int> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#endif
+26 -2
View File
@@ -67,16 +67,40 @@ namespace igl {
// previous #V by 1 list of the previous visited vertices (for each vertex) - result of Dijkstra's algorithm
//
// Output:
// path #P by 1 list of vertex indices in the shortest path from source to vertex
// path #P by 1 list of vertex indices in the shortest path from vertex to source
//
template <typename IndexType, typename DerivedP>
IGL_INLINE void dijkstra(
const IndexType &vertex,
const Eigen::MatrixBase<DerivedP> &previous,
std::vector<IndexType> &path);
};
// Dijkstra's algorithm for shortest paths on a mesh, with multiple targets, using edge length
//
// Inputs:
// V #V by 3 list of vertex positions
// VV #V list of lists of incident vertices (adjacency list), e.g.
// as returned by igl::adjacency_list, will be generated if empty.
// source index of source vertex
// targets target vector set
//
// Output:
// min_distance #V by 1 list of the minimum distances from source to all vertices
// previous #V by 1 list of the previous visited vertices (for each vertex) - used for backtracking
//
template <typename IndexType, typename DerivedV,
typename DerivedD, typename DerivedP>
IGL_INLINE int dijkstra(
const Eigen::MatrixBase<DerivedV> &V,
const std::vector<std::vector<IndexType> >& VV,
const IndexType &source,
const std::set<IndexType> &targets,
Eigen::PlainObjectBase<DerivedD> &min_distance,
Eigen::PlainObjectBase<DerivedP> &previous);
}
#ifndef IGL_STATIC_LIBRARY
#include "dijkstra.cpp"
#endif
+7 -7
View File
@@ -1,16 +1,16 @@
// 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 "directed_edge_orientations.h"
template <typename DerivedC, typename DerivedE>
IGL_INLINE void igl::directed_edge_orientations(
const Eigen::PlainObjectBase<DerivedC> & C,
const Eigen::PlainObjectBase<DerivedE> & E,
const Eigen::MatrixBase<DerivedC> & C,
const Eigen::MatrixBase<DerivedE> & E,
std::vector<
Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & Q)
{
@@ -25,5 +25,5 @@ IGL_INLINE void igl::directed_edge_orientations(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::directed_edge_orientations<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&, std::vector<Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> > >&);
template void igl::directed_edge_orientations<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&, std::vector<Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> > >&);
#endif
+7 -7
View File
@@ -1,9 +1,9 @@
// 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
//
// 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_DIRECTED_EDGE_ORIENTATIONS_H
#define IGL_DIRECTED_EDGE_ORIENTATIONS_H
@@ -23,12 +23,12 @@ namespace igl
// C #C by 3 list of edge vertex positions
// E #E by 2 list of directed edges
// Outputs:
// Q #E list of quaternions
// Q #E list of quaternions
//
template <typename DerivedC, typename DerivedE>
IGL_INLINE void directed_edge_orientations(
const Eigen::PlainObjectBase<DerivedC> & C,
const Eigen::PlainObjectBase<DerivedE> & E,
const Eigen::MatrixBase<DerivedC> & C,
const Eigen::MatrixBase<DerivedE> & E,
std::vector<
Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & Q);
}
+8 -6
View File
@@ -14,21 +14,23 @@
template <typename DerivedE, typename DerivedP>
IGL_INLINE void igl::directed_edge_parents(
const Eigen::PlainObjectBase<DerivedE> & E,
const Eigen::MatrixBase<DerivedE> & E,
Eigen::PlainObjectBase<DerivedP> & P)
{
using namespace Eigen;
using namespace std;
VectorXi I = VectorXi::Constant(E.maxCoeff()+1,1,-1);
typedef Eigen::Matrix<typename DerivedE::Scalar, Eigen::Dynamic, 1> VectorT;
VectorT I = VectorT::Constant(E.maxCoeff()+1,1,-1);
//I(E.col(1)) = 0:E.rows()-1
slice_into(colon<int>(0,E.rows()-1),E.col(1).eval(),I);
VectorXi roots,_;
slice_into(colon<typename DerivedE::Scalar>(0, E.rows()-1), E.col(1).eval(), I);
VectorT roots,_;
setdiff(E.col(0).eval(),E.col(1).eval(),roots,_);
std::for_each(roots.data(),roots.data()+roots.size(),[&](int r){I(r)=-1;});
std::for_each(roots.data(),roots.data()+roots.size(),[&](typename VectorT::Scalar r){I(r)=-1;});
slice(I,E.col(0).eval(),P);
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::directed_edge_parents<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 void igl::directed_edge_parents<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> >&);
#endif
+1 -1
View File
@@ -22,7 +22,7 @@ namespace igl
//
template <typename DerivedE, typename DerivedP>
IGL_INLINE void directed_edge_parents(
const Eigen::PlainObjectBase<DerivedE> & E,
const Eigen::MatrixBase<DerivedE> & E,
Eigen::PlainObjectBase<DerivedP> & P);
}
+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> >&);
+7 -7
View File
@@ -1,9 +1,9 @@
// 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
//
// 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 "dqs.h"
#include <Eigen/Geometry>
@@ -15,8 +15,8 @@ template <
typename T,
typename DerivedU>
IGL_INLINE void igl::dqs(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedW> & W,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedW> & W,
const std::vector<Q,QAlloc> & vQ,
const std::vector<T> & vT,
Eigen::PlainObjectBase<DerivedU> & U)
@@ -70,5 +70,5 @@ IGL_INLINE void igl::dqs(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::dqs<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> >, Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, std::vector<Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> > > const&, std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
template void igl::dqs<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> >, Eigen::Matrix<double, 3, 1, 0, 3, 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&, std::vector<Eigen::Quaternion<double, 0>, Eigen::aligned_allocator<Eigen::Quaternion<double, 0> > > const&, std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
#endif
+7 -7
View File
@@ -1,9 +1,9 @@
// 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
//
// 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_DQS_H
#define IGL_DQS_H
@@ -17,7 +17,7 @@ namespace igl
// Inputs:
// V #V by 3 list of rest positions
// W #W by #C list of weights
// vQ #C list of rotation quaternions
// vQ #C list of rotation quaternions
// vT #C list of translation vectors
// Outputs:
// U #V by 3 list of new positions
@@ -29,8 +29,8 @@ namespace igl
typename T,
typename DerivedU>
IGL_INLINE void dqs(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedW> & W,
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedW> & W,
const std::vector<Q,QAlloc> & vQ,
const std::vector<T> & vT,
Eigen::PlainObjectBase<DerivedU> & U);
+6 -6
View File
@@ -15,15 +15,15 @@ IGL_INLINE void igl::ears(
Eigen::PlainObjectBase<Derivedear_opp> & ear_opp)
{
assert(F.cols() == 3 && "F should contain triangles");
Eigen::Array<bool,Eigen::Dynamic,3> B;
Eigen::Array<bool, Eigen::Dynamic, 3> B;
{
Eigen::Array<bool,Eigen::Dynamic,1> I;
Eigen::Array<bool, Eigen::Dynamic, 1> I;
on_boundary(F,I,B);
}
find(B.rowwise().count() == 2,ear);
Eigen::Array<bool,Eigen::Dynamic,3> Bear;
slice(B,ear,1,Bear);
Eigen::Array<bool,Eigen::Dynamic,1> M;
find(B.rowwise().count() == 2, ear);
Eigen::Array<bool, Eigen::Dynamic, 3> Bear;
slice(B, ear, 1, Bear);
Eigen::Array<bool, Eigen::Dynamic, 1> M;
mat_min(Bear,2,M,ear_opp);
}
+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> >&);
+20 -20
View File
@@ -9,24 +9,24 @@
#include "is_edge_manifold.h"
#include <algorithm>
template<typename DerivedV, typename DerivedF>
template<typename DerivedV, typename DerivedF, typename DerivedE>
IGL_INLINE void igl::edge_topology(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
Eigen::MatrixXi& EV,
Eigen::MatrixXi& FE,
Eigen::MatrixXi& EF)
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
Eigen::PlainObjectBase<DerivedE>& EV,
Eigen::PlainObjectBase<DerivedE>& FE,
Eigen::PlainObjectBase<DerivedE>& EF)
{
// Only needs to be edge-manifold
if (V.rows() ==0 || F.rows()==0)
{
EV = Eigen::MatrixXi::Constant(0,2,-1);
FE = Eigen::MatrixXi::Constant(0,3,-1);
EF = Eigen::MatrixXi::Constant(0,2,-1);
EV = Eigen::PlainObjectBase<DerivedE>::Constant(0,2,-1);
FE = Eigen::PlainObjectBase<DerivedE>::Constant(0,3,-1);
EF = Eigen::PlainObjectBase<DerivedE>::Constant(0,2,-1);
return;
}
assert(igl::is_edge_manifold(F));
std::vector<std::vector<int> > ETT;
std::vector<std::vector<typename DerivedE::Scalar> > ETT;
for(int f=0;f<F.rows();++f)
for (int i=0;i<3;++i)
{
@@ -34,7 +34,7 @@ IGL_INLINE void igl::edge_topology(
int v1 = F(f,i);
int v2 = F(f,(i+1)%3);
if (v1 > v2) std::swap(v1,v2);
std::vector<int> r(4);
std::vector<typename DerivedE::Scalar> r(4);
r[0] = v1; r[1] = v2;
r[2] = f; r[3] = i;
ETT.push_back(r);
@@ -47,9 +47,9 @@ IGL_INLINE void igl::edge_topology(
if (!((ETT[i][0] == ETT[i+1][0]) && (ETT[i][1] == ETT[i+1][1])))
++En;
EV = Eigen::MatrixXi::Constant((int)(En),2,-1);
FE = Eigen::MatrixXi::Constant((int)(F.rows()),3,-1);
EF = Eigen::MatrixXi::Constant((int)(En),2,-1);
EV = DerivedE::Constant((int)(En),2,-1);
FE = DerivedE::Constant((int)(F.rows()),3,-1);
EF = DerivedE::Constant((int)(En),2,-1);
En = 0;
for(unsigned i=0;i<ETT.size();++i)
@@ -59,7 +59,7 @@ IGL_INLINE void igl::edge_topology(
)
{
// Border edge
std::vector<int>& r1 = ETT[i];
std::vector<typename DerivedE::Scalar>& r1 = ETT[i];
EV(En,0) = r1[0];
EV(En,1) = r1[1];
EF(En,0) = r1[2];
@@ -67,8 +67,8 @@ IGL_INLINE void igl::edge_topology(
}
else
{
std::vector<int>& r1 = ETT[i];
std::vector<int>& r2 = ETT[i+1];
std::vector<typename DerivedE::Scalar>& r1 = ETT[i];
std::vector<typename DerivedE::Scalar>& r2 = ETT[i+1];
EV(En,0) = r1[0];
EV(En,1) = r1[1];
EF(En,0) = r1[2];
@@ -84,7 +84,7 @@ IGL_INLINE void igl::edge_topology(
// the first one is the face on the left of the edge
for(unsigned i=0; i<EF.rows(); ++i)
{
int fid = EF(i,0);
typename DerivedE::Scalar fid = EF(i,0);
bool flip = true;
// search for edge EV.row(i)
for (unsigned j=0; j<3; ++j)
@@ -105,6 +105,6 @@ IGL_INLINE void igl::edge_topology(
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
template void igl::edge_topology<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 3, 0, -1, 3> > const&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&);
template void igl::edge_topology<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&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&, Eigen::Matrix<int, -1, -1, 0, -1, -1>&);
template void igl::edge_topology<Eigen::Matrix<double, -1, 3, 0, -1, 3>, Eigen::Matrix<int, -1, 3, 0, -1, 3>, 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&, 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::edge_topology<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>>&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1>>&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1>>&);
#endif
+6 -6
View File
@@ -34,13 +34,13 @@ namespace igl
// - FE uses non-standard and ambiguous order: FE(f,c) is merely an edge
// incident on corner c of face f. In contrast, edge_flaps's EMAP(f,c)
// reveals the edge _opposite_ corner c of face f
template <typename DerivedV, typename DerivedF>
template <typename DerivedV, typename DerivedF, typename DerivedE>
IGL_INLINE void edge_topology(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
Eigen::MatrixXi& EV,
Eigen::MatrixXi& FE,
Eigen::MatrixXi& EF);
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
Eigen::PlainObjectBase<DerivedE>& EV,
Eigen::PlainObjectBase<DerivedE>& FE,
Eigen::PlainObjectBase<DerivedE>& EF);
}
#ifndef IGL_STATIC_LIBRARY

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