// Insère une face dans une arête public void CreateFaceFromEdge(HalfEdge dart) { HalfEdge newDart = new HalfEdge(m_halfEdges.Count, dart.Opposite.Position, HalfEdge.TypeFace.ROAD); HalfEdge newDartOpposite = new HalfEdge(m_halfEdges.Count + 1, dart.Position, HalfEdge.TypeFace.ROAD); newDart.SetHalfEdge(newDartOpposite, newDartOpposite, dart); newDartOpposite.SetHalfEdge(newDart, newDart, dart.Opposite); m_halfEdges.Add(newDart); m_halfEdges.Add(newDartOpposite); dart.Opposite.Opposite = newDartOpposite; dart.Opposite = newDart; }
// Relie un brin à deux autres private void AddEdge(HalfEdge previousA, HalfEdge previousB, Vector3 A, Vector3 B) { // de A vers B HalfEdge AB = new HalfEdge(m_halfEdges.Count, A); // De B vers A HalfEdge BA = new HalfEdge(m_halfEdges.Count + 1, B); AB.SetHalfEdge(previousB.Next, previousA, BA); BA.SetHalfEdge(previousA.Next, previousB, AB); m_halfEdges.Add(AB); m_halfEdges.Add(BA); previousA.Next.Previous = BA; previousB.Next.Previous = AB; previousA.Next = AB; previousB.Next = BA; }
// Relie de points pour former une arête private void LinkTwoDegeneratedDarts(HalfEdge dart1, HalfEdge dart2) { dart1.SetHalfEdge(dart2, dart2, dart2); dart2.SetHalfEdge(dart1, dart1, dart1); }