mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 18:08:26 +00:00
Simplify
This commit is contained in:
parent
3c06851a9b
commit
ace80850de
@ -7,17 +7,14 @@ use crate::{
|
|||||||
topology::vertex::Vertex,
|
topology::vertex::Vertex,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn triangulate<'r>(
|
pub fn triangulate(vertices: &[Handle<Vertex>], surface: &Plane) -> TriMesh {
|
||||||
vertices: impl IntoIterator<Item = &'r Handle<Vertex>>,
|
|
||||||
surface: &Plane,
|
|
||||||
) -> TriMesh {
|
|
||||||
// This is a placeholder implementation that only supports convex faces.
|
// This is a placeholder implementation that only supports convex faces.
|
||||||
|
|
||||||
let mut triangulation = spade::ConstrainedDelaunayTriangulation::<_>::new();
|
let mut triangulation = spade::ConstrainedDelaunayTriangulation::<_>::new();
|
||||||
|
|
||||||
triangulation
|
triangulation
|
||||||
.add_constraint_edges(
|
.add_constraint_edges(
|
||||||
vertices.into_iter().map(|vertex| {
|
vertices.iter().map(|vertex| {
|
||||||
// Here, we project a 3D point (from the vertex) into the face's
|
// Here, we project a 3D point (from the vertex) into the face's
|
||||||
// surface, creating a 2D point. Through the surface, this 2D
|
// surface, creating a 2D point. Through the surface, this 2D
|
||||||
// point has a position in 3D space.
|
// point has a position in 3D space.
|
||||||
|
Loading…
Reference in New Issue
Block a user