mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-13 14:28:27 +00:00
Derive invalid solid from valid one
This commit is contained in:
parent
73d9b16ad6
commit
6fd750b498
@ -188,21 +188,14 @@ impl<T, U> ReferenceCounter<T, U> {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
assert_contains_err,
|
assert_contains_err,
|
||||||
geometry::GlobalPath,
|
|
||||||
operations::{
|
operations::{
|
||||||
build::{
|
build::{BuildShell, BuildSketch, BuildSolid},
|
||||||
BuildHalfEdge, BuildShell, BuildSketch, BuildSolid,
|
|
||||||
BuildSurface,
|
|
||||||
},
|
|
||||||
insert::Insert,
|
|
||||||
update::{
|
update::{
|
||||||
UpdateFace, UpdateRegion, UpdateShell, UpdateSketch,
|
UpdateCycle, UpdateFace, UpdateRegion, UpdateShell,
|
||||||
UpdateSolid,
|
UpdateSketch, UpdateSolid,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
topology::{
|
topology::{Cycle, Face, HalfEdge, Region, Shell, Sketch, Solid},
|
||||||
Cycle, Face, HalfEdge, Region, Shell, Sketch, Solid, Surface,
|
|
||||||
},
|
|
||||||
validate::Validate,
|
validate::Validate,
|
||||||
validation::{
|
validation::{
|
||||||
checks::MultipleReferencesToObject, ValidationCheck,
|
checks::MultipleReferencesToObject, ValidationCheck,
|
||||||
@ -446,27 +439,44 @@ mod tests {
|
|||||||
&core.layers.geometry,
|
&core.layers.geometry,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let surface = Surface::from_uv(
|
let invalid = valid.solid.update_shell(
|
||||||
GlobalPath::circle_from_radius(1.),
|
valid.solid.shells().first(),
|
||||||
[0., 0., 1.],
|
|shell, core| {
|
||||||
|
[shell.update_face(
|
||||||
|
shell.faces().first(),
|
||||||
|
|face, core| {
|
||||||
|
[face.update_region(
|
||||||
|
|region, core| {
|
||||||
|
region.update_exterior(
|
||||||
|
|cycle, core| {
|
||||||
|
cycle.update_half_edge(
|
||||||
|
cycle.half_edges().first(),
|
||||||
|
|_, _| {
|
||||||
|
[shell
|
||||||
|
.faces()
|
||||||
|
.nth(1)
|
||||||
|
.unwrap()
|
||||||
|
.region()
|
||||||
|
.exterior()
|
||||||
|
.half_edges()
|
||||||
|
.first()
|
||||||
|
.clone()]
|
||||||
|
},
|
||||||
|
core,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
core,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
core,
|
||||||
|
)]
|
||||||
|
},
|
||||||
|
core,
|
||||||
|
)]
|
||||||
|
},
|
||||||
&mut core,
|
&mut core,
|
||||||
);
|
);
|
||||||
|
|
||||||
let shared_edge =
|
|
||||||
HalfEdge::circle([0., 0.], 1., surface.clone(), &mut core);
|
|
||||||
|
|
||||||
let invalid = Solid::new(vec![Shell::new(vec![Face::new(
|
|
||||||
surface,
|
|
||||||
Region::new(
|
|
||||||
Cycle::new(vec![shared_edge.clone()]).insert(&mut core),
|
|
||||||
vec![Cycle::new(vec![shared_edge.clone()]).insert(&mut core)],
|
|
||||||
)
|
|
||||||
.insert(&mut core),
|
|
||||||
)
|
|
||||||
.insert(&mut core)])
|
|
||||||
.insert(&mut core)])
|
|
||||||
.insert(&mut core);
|
|
||||||
|
|
||||||
assert_contains_err!(
|
assert_contains_err!(
|
||||||
core,
|
core,
|
||||||
invalid,
|
invalid,
|
||||||
|
Loading…
Reference in New Issue
Block a user