Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Abrahamsson <erik85>2022-07-27 16:38:30 +0300
committerJacques Lucke <jacques@blender.org>2022-07-27 16:38:44 +0300
commitc8ae1fce6024556b72c9e48c2b97c310aceb556c (patch)
tree31328550a7a4511f23a33a122cc4d671d4681400 /source/blender/geometry
parent9ac81ed6abfbd431aafd75969f8590703ebe122f (diff)
Geometry Nodes: Shortest Paths nodes
This adds three new nodes: * `Shortest Edge Paths`: Actually finds the shortest paths. * `Edge Paths to Curves`: Converts the paths to separate curves. This may generate a quadratic amount of data, making it slow for large meshes. * `Edge Paths to Selection`: Generates an edge selection that contains all edges that are part of a path. This can be used with the Separate Geometry node to only keep the edges that are part of a path. For large meshes, this approach can be much faster than the `Edge Paths to Curves` node, because less data is created. Differential Revision: https://developer.blender.org/D15274
Diffstat (limited to 'source/blender/geometry')
-rw-r--r--source/blender/geometry/GEO_mesh_to_curve.hh5
-rw-r--r--source/blender/geometry/intern/mesh_to_curve_convert.cc8
2 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/geometry/GEO_mesh_to_curve.hh b/source/blender/geometry/GEO_mesh_to_curve.hh
index f619aaff217..b0f24853dbc 100644
--- a/source/blender/geometry/GEO_mesh_to_curve.hh
+++ b/source/blender/geometry/GEO_mesh_to_curve.hh
@@ -21,4 +21,9 @@ namespace blender::geometry {
*/
bke::CurvesGeometry mesh_to_curve_convert(const Mesh &mesh, const IndexMask selection);
+bke::CurvesGeometry create_curve_from_vert_indices(const Mesh &mesh,
+ Span<int> vert_indices,
+ Span<int> curve_offsets,
+ IndexRange cyclic_curves);
+
} // namespace blender::geometry
diff --git a/source/blender/geometry/intern/mesh_to_curve_convert.cc b/source/blender/geometry/intern/mesh_to_curve_convert.cc
index fdacb174462..350dfe73d57 100644
--- a/source/blender/geometry/intern/mesh_to_curve_convert.cc
+++ b/source/blender/geometry/intern/mesh_to_curve_convert.cc
@@ -30,10 +30,10 @@ static void copy_with_map(const VArray<T> &src, Span<int> map, MutableSpan<T> ds
});
}
-static bke::CurvesGeometry create_curve_from_vert_indices(const Mesh &mesh,
- const Span<int> vert_indices,
- const Span<int> curve_offsets,
- const IndexRange cyclic_curves)
+bke::CurvesGeometry create_curve_from_vert_indices(const Mesh &mesh,
+ const Span<int> vert_indices,
+ const Span<int> curve_offsets,
+ const IndexRange cyclic_curves)
{
bke::CurvesGeometry curves(vert_indices.size(), curve_offsets.size());
curves.offsets_for_write().drop_back(1).copy_from(curve_offsets);