mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-17 13:46:10 +00:00
Merge pull request #1207 from hannobraun/cycle
Fix `SurfaceVertex` duplication when creating circle
This commit is contained in:
commit
da2ccbd9b8
@ -53,19 +53,19 @@ impl Cycle {
|
|||||||
"Edges in cycle do not connect"
|
"Edges in cycle do not connect"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Verify that the edges form a cycle
|
// Verify that the edges form a cycle
|
||||||
if let Some(first) = half_edges.first() {
|
if let Some(first) = half_edges.first() {
|
||||||
if let Some(last) = half_edges.last() {
|
if let Some(last) = half_edges.last() {
|
||||||
let [first, _] = first.vertices();
|
let [first, _] = first.vertices();
|
||||||
let [_, last] = last.vertices();
|
let [_, last] = last.vertices();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first.surface_form(),
|
first.surface_form(),
|
||||||
last.surface_form(),
|
last.surface_form(),
|
||||||
"Edges do not form a cycle"
|
"Edges do not form a cycle"
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,14 +93,19 @@ impl PartialHalfEdge {
|
|||||||
let [a_curve, b_curve] =
|
let [a_curve, b_curve] =
|
||||||
[Scalar::ZERO, Scalar::TAU].map(|coord| Point::from([coord]));
|
[Scalar::ZERO, Scalar::TAU].map(|coord| Point::from([coord]));
|
||||||
|
|
||||||
let global_vertex = Handle::<GlobalVertex>::partial()
|
let global_form = Handle::<GlobalVertex>::partial()
|
||||||
.from_curve_and_position(curve.clone(), a_curve);
|
.from_curve_and_position(curve.clone(), a_curve);
|
||||||
|
|
||||||
|
let path = curve.path.expect("Expected path that was just created");
|
||||||
|
let surface_form = SurfaceVertex::partial()
|
||||||
|
.with_position(Some(path.point_from_path_coords(a_curve)))
|
||||||
|
.with_global_form(Some(global_form));
|
||||||
|
|
||||||
[a_curve, b_curve].map(|point_curve| {
|
[a_curve, b_curve].map(|point_curve| {
|
||||||
Vertex::partial()
|
Vertex::partial()
|
||||||
.with_position(Some(point_curve))
|
.with_position(Some(point_curve))
|
||||||
.with_curve(Some(curve.clone()))
|
.with_curve(Some(curve.clone()))
|
||||||
.with_global_form(Some(global_vertex.clone()))
|
.with_surface_form(Some(surface_form.clone()))
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user