src/STLSplit.php
private function findNeighbour(array $facet, array &$object, array &$facets)
    {
        foreach ($facets as $key => $_facet) {
            for ($i = 0; $i < 3; $i++) {
                if (in_array($_facet["vertex"][$i], $facet["vertex"])) {
                    unset($facets[$key]);
                    $object[] = $_facet;
                    $this->findNeighbour(
                        $_facet,
                        $object,
                        $facets
                    );
                }
                continue 2;
            }
        }
    }
private function findNeighbour(array $facet, array &$object, array &$facets)
    {
        foreach ($facets as $key => $_facet) {
            for ($i = 0; $i < 3; $i++) {
                if (in_array($_facet["vertex"][$i], $facet["vertex"])) {
                    unset($facets[$key]);
                    $object[] = $_facet;
                    $this->findNeighbour(
                        $_facet,
                        $object,
                        $facets
                    );
                }
                continue 2;
            }
        }
    }
private function findNeighbour ( array $ facet , array & $ object , array & $ facets ) { foreach ( $ facets as $ key => $ _facet ) { for ( $ i = 0 ; $ i < 3 ; $ i ++ ) { if ( in_array ( $ _facet [ "vertex" ] [ $ i ] , $ facet [ "vertex" ] ) ) { unset ( $ facets [ $ key ] ) ; $ object [ ] = $ _facet ; $ this -> findNeighbour ( $ _facet , $ object , $ facets ) ; } continue 2 ; } } }
Finds the neighbouring facets of a facet.

@param array $facet
@param array $object
@param array $facets
Finds the neighbouring facets of a facet .