-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathChainIntersectionAlgorithm.lean
More file actions
34 lines (27 loc) · 1.26 KB
/
Copy pathChainIntersectionAlgorithm.lean
File metadata and controls
34 lines (27 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/-
This is a legacy file, no longer needed for the human facing specification of
mesh intersection.
-/
import CSG.Def
import CSG.Legacy.ChainDef
import CSG.Impl.Legacy.ChainIntersectionAlgorithm
import CSG.Proof.ChainIntersectionAlgorithm
/-!
# The chain intersection algorithm and its specification
-/
namespace CSG.Legacy
/--
The **intersection of two simplicial chains**, as a computable function. The
implementation lives in `CSG.Impl.Legacy.ChainIntersectionAlgorithm`. -/
def intersect (w₁ w₂ : Chain) : Chain :=
Impl.Legacy.ChainIntersectionAlgorithm.intersect w₁ w₂
/-- **Correctness of the intersection algorithm** (Feito & Rivero, Theorem 4).
For normal inputs, the chain produced by `intersect` is normal and its solid is
the intersection of the input solids, up to a finite union of planes. This is
the same specification claimed existentially in
`CSG.Legacy.exists_intersection_chain`, now realized by a concrete function. -/
theorem intersect_spec (w₁ w₂ : Chain) (h₁ : Chains.Normal w₁) (h₂ : Chains.Normal w₂) :
Chains.Normal (intersect w₁ w₂) ∧
EqOffPlanes (Chains.solid (intersect w₁ w₂)) (Chains.solid w₁ ∩ Chains.solid w₂) :=
Proof.ChainIntersectionAlgorithm.intersect_spec w₁ w₂ h₁ h₂
end CSG.Legacy