SpaceClaim.AddIn.Unfold.FlatFace.IsAdjacentTo C# (CSharp) Method

IsAdjacentTo() public method

public IsAdjacentTo ( FlatFace otherFace ) : bool
otherFace FlatFace
return bool
        public bool IsAdjacentTo(FlatFace otherFace)
        {
            if (this == otherFace)
                throw new InvalidOperationException();

            foreach (FlatLoop thisLoop in loops) {
                foreach (FlatFin thisFin in thisLoop.Fins) {
                    foreach (FlatLoop otherLoop in otherFace.Loops) {
                        foreach (FlatFin otherFin in otherLoop.Fins) {
                            if (otherFin.AdjacentFin == thisFin)
                                return true;

                            if (thisFin.AdjacentFin == otherFin)
                                return true;
                        }
                    }
                }
            }

            return false;
        }