mirror of
https://github.com/hannobraun/Fornjot
synced 2025-11-27 09:52:09 +00:00
Refactor to simplify
This commit is contained in:
parent
8583a5d231
commit
37c7cb597c
@ -413,7 +413,7 @@ fn distances(
|
||||
mod tests {
|
||||
use crate::{
|
||||
assert_contains_err,
|
||||
objects::{Curve, Shell},
|
||||
objects::{Curve, HalfEdge, Shell},
|
||||
operations::{
|
||||
build::BuildShell,
|
||||
geometry::UpdateHalfEdgeGeometry,
|
||||
@ -445,51 +445,21 @@ mod tests {
|
||||
cycle.update_half_edge(
|
||||
cycle.half_edges().nth_circular(0),
|
||||
|half_edge, core| {
|
||||
// This is going to be weird:
|
||||
//
|
||||
// - That first call to `update_path` is
|
||||
// going to reverse a path and insert
|
||||
// a new object with the reversed
|
||||
// path.
|
||||
// - The next call to `update_boundary`
|
||||
// relies on that, because it inserts
|
||||
// an object too, and that would cause
|
||||
// a validation failure without the
|
||||
// first call.
|
||||
// - But the new object created from
|
||||
// those two operations doesn't
|
||||
// actually have its geometry set in
|
||||
// the geometry layer, because that
|
||||
// happens in `update_path`, for an
|
||||
// earlier version of the object.
|
||||
// - So we need a last `set_path`, which
|
||||
// sets the path again.
|
||||
//
|
||||
// This is very weird, but good new is,
|
||||
// it's just an artifact of the
|
||||
// transition from a unified object
|
||||
// graph to separate topology and
|
||||
// geometry layers. This should clear up
|
||||
// again, once the separation is
|
||||
// finished, and all APIs can adapt to
|
||||
// the new reality.
|
||||
[half_edge
|
||||
.update_path(
|
||||
|path| path.reverse(),
|
||||
core,
|
||||
)
|
||||
.update_boundary(
|
||||
|boundary| boundary.reverse(),
|
||||
core,
|
||||
)
|
||||
.set_path(
|
||||
core.layers
|
||||
.geometry
|
||||
.of_half_edge(half_edge)
|
||||
.path
|
||||
.reverse(),
|
||||
&mut core.layers.geometry,
|
||||
)]
|
||||
[HalfEdge::new(
|
||||
half_edge.path().reverse(),
|
||||
half_edge.boundary().reverse(),
|
||||
half_edge.curve().clone(),
|
||||
half_edge.start_vertex().clone(),
|
||||
)
|
||||
.insert(core)
|
||||
.set_path(
|
||||
core.layers
|
||||
.geometry
|
||||
.of_half_edge(half_edge)
|
||||
.path
|
||||
.reverse(),
|
||||
&mut core.layers.geometry,
|
||||
)]
|
||||
},
|
||||
core,
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user