Commit: 1afeb0e7c6bdbe03e9d797d64bdb5c3bf68c3af1
Author: mattoverby
Date:   Tue Aug 4 17:13:02 2020 -0500
Branches: soc-2020-soft-body
https://developer.blender.org/rB1afeb0e7c6bdbe03e9d797d64bdb5c3bf68c3af1

cloth sim mode

===================================================================

A       extern/discregrid/CMakeLists.txt
A       extern/discregrid/FindDiscregrid.cmake
A       extern/discregrid/LICENSE
A       extern/discregrid/README.md
A       extern/discregrid/cmake/Modules/FindEigen3.cmake
A       extern/discregrid/cmake/Modules/PatchOpenMPApple.cmake
A       extern/discregrid/cmd/CMakeLists.txt
A       extern/discregrid/cmd/discrete_field_to_bitmap/CMakeLists.txt
A       extern/discregrid/cmd/discrete_field_to_bitmap/bmp_file.cpp
A       extern/discregrid/cmd/discrete_field_to_bitmap/bmp_file.hpp
A       extern/discregrid/cmd/discrete_field_to_bitmap/main.cpp
A       extern/discregrid/cmd/generate_density_map/CMakeLists.txt
A       extern/discregrid/cmd/generate_density_map/gauss_quadrature.cpp
A       extern/discregrid/cmd/generate_density_map/gauss_quadrature.hpp
A       extern/discregrid/cmd/generate_density_map/main.cpp
A       extern/discregrid/cmd/generate_density_map/sph_kernel.hpp
A       extern/discregrid/cmd/generate_sdf/CMakeLists.txt
A       extern/discregrid/cmd/generate_sdf/main.cpp
A       extern/discregrid/cmd/generate_sdf/resources/box.cdf
A       extern/discregrid/cmd/generate_sdf/resources/box.obj
A       extern/discregrid/cmd/generate_sdf/resources/bunny.obj
A       extern/discregrid/cmd/generate_sdf/resources/dragon.obj
A       extern/discregrid/cmd/generate_sdf/resources/hand.obj
A       extern/discregrid/cmd/generate_sdf/resources/happy_buddha.obj
A       extern/discregrid/cmd/resource_path.hpp.in
A       extern/discregrid/discregrid/CMakeLists.txt
A       extern/discregrid/discregrid/include/Discregrid/All
A       
extern/discregrid/discregrid/include/Discregrid/acceleration/bounding_sphere.hpp
A       
extern/discregrid/discregrid/include/Discregrid/acceleration/bounding_sphere_hierarchy.hpp
A       extern/discregrid/discregrid/include/Discregrid/acceleration/kd_tree.hpp
A       extern/discregrid/discregrid/include/Discregrid/acceleration/kd_tree.inl
A       
extern/discregrid/discregrid/include/Discregrid/cubic_lagrange_discrete_grid.hpp
A       extern/discregrid/discregrid/include/Discregrid/discrete_grid.hpp
A       
extern/discregrid/discregrid/include/Discregrid/geometry/mesh_distance.hpp
A       
extern/discregrid/discregrid/include/Discregrid/mesh/entity_containers.hpp
A       
extern/discregrid/discregrid/include/Discregrid/mesh/entity_iterators.hpp
A       extern/discregrid/discregrid/include/Discregrid/mesh/halfedge.hpp
A       extern/discregrid/discregrid/include/Discregrid/mesh/triangle_mesh.hpp
A       extern/discregrid/discregrid/include/Discregrid/utility/lru_cache.hpp
A       extern/discregrid/discregrid/include/Discregrid/utility/serialize.hpp
A       
extern/discregrid/discregrid/src/acceleration/bounding_sphere_hierarchy.cpp
A       extern/discregrid/discregrid/src/cubic_lagrange_discrete_grid.cpp
A       extern/discregrid/discregrid/src/data/z_sort_table.hpp
A       extern/discregrid/discregrid/src/discrete_grid.cpp
A       extern/discregrid/discregrid/src/geometry/mesh_distance.cpp
A       extern/discregrid/discregrid/src/geometry/point_triangle_distance.cpp
A       extern/discregrid/discregrid/src/geometry/point_triangle_distance.hpp
A       extern/discregrid/discregrid/src/mesh/entity_containers.cpp
A       extern/discregrid/discregrid/src/mesh/entity_iterators.cpp
A       extern/discregrid/discregrid/src/mesh/triangle_mesh.cpp
A       extern/discregrid/discregrid/src/utility/spinlock.hpp
A       extern/discregrid/discregrid/src/utility/timing.cpp
A       extern/discregrid/discregrid/src/utility/timing.hpp
A       extern/discregrid/extern/cxxopts/cxxopts.hpp
M       extern/softbody/CMakeLists.txt
M       extern/softbody/src/admmpd_bvh_traverse.cpp
M       extern/softbody/src/admmpd_bvh_traverse.h
M       extern/softbody/src/admmpd_collision.cpp
M       extern/softbody/src/admmpd_collision.h
M       extern/softbody/src/admmpd_energy.cpp
M       extern/softbody/src/admmpd_energy.h
M       extern/softbody/src/admmpd_geom.cpp
M       extern/softbody/src/admmpd_geom.h
M       extern/softbody/src/admmpd_mesh.cpp
M       extern/softbody/src/admmpd_mesh.h
D       extern/softbody/src/admmpd_sdf.cpp
D       extern/softbody/src/admmpd_sdf.h
M       extern/softbody/src/admmpd_solver.cpp
A       extern/softbody/src/admmpd_timer.h
M       extern/softbody/src/admmpd_types.h
M       intern/softbody/admmpd_api.cpp
M       intern/softbody/admmpd_api.h
M       release/scripts/startup/bl_ui/properties_physics_softbody.py
M       source/blender/makesdna/DNA_object_force_types.h
M       source/blender/makesrna/intern/rna_object_force.c

===================================================================

diff --git a/extern/discregrid/CMakeLists.txt b/extern/discregrid/CMakeLists.txt
new file mode 100755
index 00000000000..354dd7dd0d7
--- /dev/null
+++ b/extern/discregrid/CMakeLists.txt
@@ -0,0 +1,62 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+# ***** END GPL LICENSE BLOCK *****
+
+set(INC
+       discregrid/include
+       discregrid/include/Discregrid
+       extern
+)
+
+set(INC_SYS
+       ${EIGEN3_INCLUDE_DIRS}
+)
+
+set(SRC
+       discregrid/include/Discregrid/discrete_grid.hpp
+       discregrid/include/Discregrid/cubic_lagrange_discrete_grid.hpp
+       discregrid/include/Discregrid/acceleration/bounding_sphere_hierarchy.hpp
+       discregrid/include/Discregrid/acceleration/bounding_sphere.hpp
+       discregrid/include/Discregrid/acceleration/kd_tree.hpp
+       discregrid/include/Discregrid/acceleration/kd_tree.inl
+       discregrid/include/Discregrid/mesh/triangle_mesh.hpp
+       discregrid/include/Discregrid/mesh/entity_containers.hpp
+       discregrid/include/Discregrid/mesh/entity_iterators.hpp
+       discregrid/include/Discregrid/mesh/halfedge.hpp
+       discregrid/include/Discregrid/geometry/mesh_distance.hpp
+       discregrid/src/geometry/point_triangle_distance.hpp
+       discregrid/include/Discregrid/utility/serialize.hpp
+       discregrid/include/Discregrid/utility/lru_cache.hpp
+       discregrid/src/utility/timing.hpp
+       discregrid/src/utility/spinlock.hpp
+       discregrid/src/discrete_grid.cpp
+       discregrid/src/cubic_lagrange_discrete_grid.cpp
+       discregrid/src/acceleration/bounding_sphere_hierarchy.cpp
+       discregrid/src/mesh/entity_containers.cpp
+       discregrid/src/mesh/entity_iterators.cpp
+       discregrid/src/mesh/triangle_mesh.cpp
+       discregrid/src/geometry/mesh_distance.cpp
+       discregrid/src/geometry/point_triangle_distance.cpp
+       discregrid/src/utility/timing.cpp
+)
+
+set(LIB
+)
+
+blender_add_lib(extern_discregrid "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/extern/discregrid/FindDiscregrid.cmake 
b/extern/discregrid/FindDiscregrid.cmake
new file mode 100755
index 00000000000..85780ee07c7
--- /dev/null
+++ b/extern/discregrid/FindDiscregrid.cmake
@@ -0,0 +1,89 @@
+# - Try to find Discregrid library
+#
+# The find script can be invoked by using the following command:
+#   find_package(Discregrid)
+#
+# Once done this will define
+#
+#  DISCREGRID_FOUND - System has found the discregrid library
+#  DISCREGRID_INCLUDE_DIRS - Path to the discregrid include directory
+#  DISCREGRID_LIBRARIES - Path to the static discregrid library
+
+# ============================================================================
+# _DISCREGRID_FIND_INCLUDE_DIR
+# Internal function to find the include directories
+#     _var = variable to set
+#     _hdr = header file to look for
+# ============================================================================
+function(_DISCREGRID_FIND_INCLUDE_DIR _var _hdr)
+    find_path(${_var} ${_hdr}
+        PATHS
+        $ENV{DISCREGRID_ROOT}
+        ${DISCREGRID_ROOT}
+       PATH_SUFFIXES
+           /include
+    )
+
+    if (${_var})
+        set(DISCREGRID_INCLUDE_DIRS ${DISCREGRID_INCLUDE_DIRS} ${${_var}} 
PARENT_SCOPE)
+        if (NOT DISCREGRID_SKIP_MARK_AS_ADVANCED)
+            mark_as_advanced(${_var})
+        endif()
+    endif()
+endfunction(_DISCREGRID_FIND_INCLUDE_DIR)
+
+# ============================================================================
+# _DISCREGRID_FIND_LIBRARY
+# Internal function to find libraries packaged with DISCREGRID
+#     _var = library variable to create
+# ============================================================================
+function(_DISCREGRID_FIND_LIBRARY _var _lib _mode)
+    find_library(${_var}
+       NAMES ${_lib}
+       PATHS
+        $ENV{DISCREGRID_ROOT}
+        ${DISCREGRID_ROOT}
+       PATH_SUFFIXES
+           /lib
+    )
+
+    if(${_var})
+        set(DISCREGRID_LIBRARIES ${DISCREGRID_LIBRARIES} ${_mode} ${${_var}} 
PARENT_SCOPE)
+        if(NOT DISCREGRID_SKIP_MARK_AS_ADVANCED)
+            mark_as_advanced(${_var})
+        endif()
+    endif()
+endfunction(_DISCREGRID_FIND_LIBRARY)
+
+# ============================================================================
+#
+# main()
+#
+# ============================================================================
+
+#
+# Find all libraries and include directories.
+#
+_DISCREGRID_FIND_INCLUDE_DIR(DISCREGRID_DISCREGRIDH_INCLUDE_DIR Discregrid/All)
+_DISCREGRID_FIND_LIBRARY(DISCREGRID_LIBRARY_RELEASE "discregrid" optimized)
+_DISCREGRID_FIND_LIBRARY(DISCREGRID_LIBRARY_DEBUG "discregrid_d" debug)
+
+#
+# Try to enforce components.
+#
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(DISCREGRID DEFAULT_MSG
+    DISCREGRID_DISCREGRIDH_INCLUDE_DIR
+    DISCREGRID_LIBRARY_DEBUG
+    DISCREGRID_LIBRARY_RELEASE
+)
+
+if(NOT DISCREGRID_FOUND)
+    set(DISCREGRID_INCLUDE_DIRS)
+    set(DISCREGRID_LIBRARIES)
+endif()
+
+if(DISCREGRID_INCLUDE_DIRS)
+    list(REMOVE_DUPLICATES DISCREGRID_INCLUDE_DIRS)
+endif()
diff --git a/extern/discregrid/LICENSE b/extern/discregrid/LICENSE
new file mode 100755
index 00000000000..960bc4bc699
--- /dev/null
+++ b/extern/discregrid/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2017 Dan Koschier
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/extern/discregrid/README.md b/extern/discregrid/README.md
new file mode 100755
index 00000000000..ddd702a5adf
--- /dev/null
+++ b/extern/discregrid/README.md
@@ -0,0 +1,100 @@
+# Discregrid
+
+<p align=center><img 
src="https://github.com/InteractiveComputerGraphics/Discregrid/workflows/build-linux/badge.svg";>&nbsp;&nbsp;
 <img 
src="https://github.com/InteractiveComputerGraphics/Discregrid/workflows/build-windows/badge.svg";></p>
+
+![](https://www.animation.rwth-aachen.de/media/resource_files/DragonSDFDM.png)
+**Figure 1**: Left: Slice of a three-dimensional discrete signed distance 
field of the Stanford dragon. Right: Density map for SPH boundary handling of 
Stanford dragon.
+
+**Discregrid** is a static C++ library for the parallel discretization of 
(preferably smooth) functions on regular grids.
+The library generates a (cubic) polynomial discretization given a box-shaped 
domain, a grid resolution, and a function that maps a three-dimensional 
position in space to a real scalar value.
+In the current implementation isoparametric cubic polynomials of Serendipity 
type for the cell-wise discretization are employed.
+The coefficient vector for the discrete polynomial basis is computed using 
regular sampling of the input function at the higher-order grid's nodes.
+However, I plan to provide a spatially adaptive version of the cubic 
discretization and moreover an implementation of the hp-adaptive discretization 
algorithm described in [KDBB17].
+The algorithm to generate the discretization is moreover *fully parallelized* 
using OpenMP and especially well-suited for the discretization of signed 
distance functions.
+The library moreover provides the functionality to serialize and deserialize 
the a generated discrete grid.
+
+Besides the library the project includes three executable programs that serve 
the following purposes:
+* *GenerateSDF*: Computes a discrete (cubic) signed distance field from a 
triangle mesh in OBJ format.
+* *DiscreteFieldToBitmap*: Generates an image in bitmap format of a 
two-dimensional slice of a previously computed discretization.
+* *GenerateDensityMap*: Generates a density map according to the approach 
presented in [KB17] from a previously generated discrete signed distance field 
using the widely adopted cubic spline kernel. The program can be easily 
extended to work with other kernel function by simply replacing the 
implementation in sph_kernel.hpp.
+
+**Author**: Dan Koschier, **License**: MIT
+
+## Libraries using Discregrid
+* [PBD] - A C++ library for physically-based simulation of rigid bodies, 
deformables, cloth and fluids using Position-Based Dynamics. Discregrid is used 
to compute discrete signed distance fields of rigid objects for collision 
handling purposes.
+* [SPlisHSPlasH] - A C++ library for the physically-based simulation of fluids 
using Smoothed Particle Hydrodynamics. Discregrid is used to compute density 
maps according to my paper [KB17] for boundary handling.
+
+## Build Instructions
+
+This project is based on [CMake](https://cmake.org/). Simply generate project, 
Makefiles, etc. using [CMake](https://cmake.org/) and compile the project with 
the compiler of your choice. The code was tested with the following 
configurations:
+- Windows 10 64-bit, CMake 3.8, Visual Studio 2017
+- Debian 9 64-bit, CMake 3.8, G

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to