mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-07 19:38:29 +00:00
Extract dedicated approximate_half_edge
function
This commit is contained in:
parent
2220295b16
commit
d3c770e0f6
@ -55,15 +55,7 @@ pub fn triangulate(face: &Face) -> TriMesh {
|
||||
fn half_edges_to_points(face: &Face, target: &mut Vec<TriangulationPoint>) {
|
||||
target.extend(
|
||||
face.half_edges_with_end_vertex()
|
||||
.map(
|
||||
|HalfEdgeWithEndVertex {
|
||||
half_edge,
|
||||
end_vertex: _,
|
||||
}| {
|
||||
let start = &half_edge.start;
|
||||
start.point
|
||||
},
|
||||
)
|
||||
.map(approximate_half_edge)
|
||||
.map(|point_global| {
|
||||
// Here, we project a 3D point (from the vertex) into the face's
|
||||
// surface, creating a 2D point. Through the surface, this 2D
|
||||
@ -93,6 +85,16 @@ fn half_edges_to_points(face: &Face, target: &mut Vec<TriangulationPoint>) {
|
||||
)
|
||||
}
|
||||
|
||||
fn approximate_half_edge(
|
||||
HalfEdgeWithEndVertex {
|
||||
half_edge,
|
||||
end_vertex: _,
|
||||
}: HalfEdgeWithEndVertex,
|
||||
) -> Point<3> {
|
||||
let start = &half_edge.start;
|
||||
start.point
|
||||
}
|
||||
|
||||
fn polygon_from_half_edges(
|
||||
points_from_half_edges: &[TriangulationPoint],
|
||||
) -> Polygon {
|
||||
|
Loading…
Reference in New Issue
Block a user