mirror of https://github.com/hannobraun/Fornjot
Add ignored failing unit test for triangulation bug #430
https://github.com/hannobraun/Fornjot/issues/430 Fix gitignore not ignoring .idea/ directory
This commit is contained in:
parent
7ae4838134
commit
ad5aaff7d6
|
@ -4,4 +4,5 @@
|
||||||
# IDE Configurations
|
# IDE Configurations
|
||||||
**/.vs/ # Visual Studio
|
**/.vs/ # Visual Studio
|
||||||
**/.idea/ # Intellij
|
**/.idea/ # Intellij
|
||||||
|
.idea/
|
||||||
**/.buildconfig # Gnome Builder
|
**/.buildconfig # Gnome Builder
|
||||||
|
|
|
@ -143,6 +143,49 @@ mod tests {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[ignore]
|
||||||
|
#[test]
|
||||||
|
fn sharp_concave_shape() -> anyhow::Result<()> {
|
||||||
|
//
|
||||||
|
// c
|
||||||
|
// /|
|
||||||
|
// e / |
|
||||||
|
// |\ / |
|
||||||
|
// | | / |
|
||||||
|
// | \ / |
|
||||||
|
// | \ / |
|
||||||
|
// | d |
|
||||||
|
// a ---------- b
|
||||||
|
//
|
||||||
|
|
||||||
|
let a = Point::from([0., 0.]);
|
||||||
|
let b = Point::from([0.4, 0.]);
|
||||||
|
//let b = Point::from([0.5, 0.]); // test passes with this change
|
||||||
|
let c = Point::from([0.4, 1.0]);
|
||||||
|
let d = Point::from([0.1, 0.1]);
|
||||||
|
let e = Point::from([0., 0.8]);
|
||||||
|
|
||||||
|
let face = Face::builder(Surface::xy_plane())
|
||||||
|
.with_exterior_polygon([a, b, c, d, e])
|
||||||
|
.build();
|
||||||
|
|
||||||
|
let triangles = triangulate(face)?;
|
||||||
|
|
||||||
|
let a3 = a.to_xyz();
|
||||||
|
let b3 = b.to_xyz();
|
||||||
|
let c3 = c.to_xyz();
|
||||||
|
let d3 = d.to_xyz();
|
||||||
|
let e3 = e.to_xyz();
|
||||||
|
|
||||||
|
assert!(triangles.contains_triangle([a3, b3, d3]));
|
||||||
|
assert!(triangles.contains_triangle([b3, c3, d3]));
|
||||||
|
assert!(triangles.contains_triangle([a3, d3, e3]));
|
||||||
|
|
||||||
|
assert!(!triangles.contains_triangle([b3, e3, d3]));
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn triangulate(face: Face) -> anyhow::Result<Mesh<Point<3>>> {
|
fn triangulate(face: Face) -> anyhow::Result<Mesh<Point<3>>> {
|
||||||
let tolerance = Tolerance::from_scalar(Scalar::ONE)?;
|
let tolerance = Tolerance::from_scalar(Scalar::ONE)?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue