Skip to content

Commit ec11fef

Browse files
CLEANUP
1 parent 8d82e31 commit ec11fef

32 files changed

+358
-335
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,4 @@ add_nanobind_module(_isolines src/isolines.cpp)
171171
add_nanobind_module(_massmatrix src/massmatrix.cpp)
172172
add_nanobind_module(_meshing src/meshing.cpp)
173173
add_nanobind_module(_parametrisation src/parametrisation.cpp)
174-
add_nanobind_module(_planarize src/planarize.cpp)
174+
add_nanobind_module(_planarize src/planarize.cpp)

docs/devguide/cmake_configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Core Settings
99

1010
.. code-block:: cmake
1111
12-
set(CMAKE_CXX_STANDARD 17)
12+
set(CMAKE_CXX_STANDARD 20)
1313
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1414
1515
External Dependencies

docs/examples/example_curvature_gaussian.rst

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/examples/example_massmatrix.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import compas
22
import compas_libigl as igl
3+
import numpy as np
34
from compas.colors import ColorMap
45
from compas.datastructures import Mesh
56
from compas_viewer import Viewer
@@ -18,23 +19,25 @@
1819
# ==============================================================================
1920

2021
mass = igl.trimesh_massmatrix(trimesh.to_vertices_and_faces())
22+
# Convert sparse diagonal to dense array
23+
mass_diag = np.array(mass.diagonal())
2124

2225
# ==============================================================================
2326
# Visualisation
2427
# ==============================================================================
2528

2629
cmap = ColorMap.from_rgb()
2730

28-
minval = min(mass)
29-
maxval = max(mass)
31+
minval = mass_diag.min()
32+
maxval = mass_diag.max()
3033

3134
viewer = Viewer(width=1600, height=900)
3235
# viewer.view.camera.position = [1, -6, 2]
3336
# viewer.view.camera.look_at([1, 1, 1])
3437

3538
viewer.scene.add(mesh, show_points=False)
3639

37-
for m, vertex in zip(mass, mesh.vertices()):
40+
for m, vertex in zip(mass_diag, mesh.vertices()):
3841
point = mesh.vertex_point(vertex)
3942
viewer.scene.add(point, pointsize=30, pointcolor=cmap(m, minval, maxval))
4043

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ ruff
88
sphinx_compas2_theme
99
twine
1010
wheel
11+
line_profiler

src/boundaries.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "boundaries.hpp"
22

3-
std::vector<std::vector<int>> trimesh_boundaries(const compas::RowMatrixXi& F) {
3+
std::vector<std::vector<int>> trimesh_boundaries( Eigen::Ref<const compas::RowMatrixXi> F) {
44
std::vector<std::vector<int>> L;
55
igl::boundary_loop(F, L);
66
return L;

src/boundaries.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@
1111
*
1212
* @note The input mesh should be manifold for correct results.
1313
*/
14-
std::vector<std::vector<int>> trimesh_boundaries(
15-
const compas::RowMatrixXi& F);
14+
std::vector<std::vector<int>> trimesh_boundaries(Eigen::Ref<const compas::RowMatrixXi> F);

src/compas_libigl/boundaries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def trimesh_boundaries(M):
1212
1313
Parameters
1414
----------
15-
M : tuple[:class:`list`, :class:`list`]
15+
M : tuple[list[list[float]], list[list[int]]]
1616
A mesh represented by a list of vertices and a list of faces.
1717
The vertices should be 3D points, and faces should be triangles.
1818

src/compas_libigl/curvature.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def trimesh_gaussian_curvature(M):
1111
1212
Parameters
1313
----------
14-
M : tuple[:class:`list`, :class:`list`]
14+
M : tuple[list[list[float]], list[list[int]]]
1515
A mesh represented by a list of vertices and a list of faces.
1616
The vertices should be 3D points, and faces should be triangles.
1717
@@ -36,7 +36,7 @@ def trimesh_principal_curvature(M):
3636
3737
Parameters
3838
----------
39-
M : tuple[:class:`list`, :class:`list`]
39+
M : tuple[list[list[float]], list[list[int]]]
4040
A mesh represented by a list of vertices and a list of faces.
4141
The vertices should be 3D points, and faces should be triangles.
4242

src/compas_libigl/geodistance.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@ def trimesh_geodistance(M, source, method="exact"):
3838
V, F = M
3939
V = np.asarray(V, dtype=np.float64)
4040
F = np.asarray(F, dtype=np.int32)
41-
if method == "exact":
42-
return _geodistance.trimesh_geodistance_exact(V, F, source)
43-
if method == "heat":
44-
return _geodistance.trimesh_geodistance_heat(V, F, source)
45-
raise NotImplementedError
41+
# Extract single integer from source array if needed
42+
source = int(source) # Ensure it's a scalar
43+
return _geodistance.trimesh_geodistance(V, F, source, method)
4644

4745

4846
@plugin(category="trimesh")
@@ -80,8 +78,4 @@ def trimesh_geodistance_multiple(M, sources, method="exact"):
8078
V = np.asarray(V, dtype=np.float64)
8179
F = np.asarray(F, dtype=np.int32)
8280
sources = np.asarray(sources, dtype=np.int32)
83-
if method == "exact":
84-
return _geodistance.trimesh_geodistance_exact_multiple(V, F, sources)
85-
if method == "heat":
86-
return _geodistance.trimesh_geodistance_heat_multiple(V, F, sources)
87-
raise NotImplementedError
81+
return _geodistance.trimesh_geodistance_multiple(V, F, sources, method)

0 commit comments

Comments
 (0)