recreateFaces() {
        // Remove all faces
        this.faces.clear();
        for (let edge of this.edges) {
            edge.face = null;
        }

        // Restore faces
        let first;
        let unassignedEdgeFound = true;
        while (unassignedEdgeFound) {
            unassignedEdgeFound = false;
            for (let edge of this.edges) {
                if (edge.face === null) {
                    first = edge;
                    unassignedEdgeFound = true;
                    break;
                }
            }

            if (unassignedEdgeFound) {
                let last = first;
                do {
                    last = last.next;
                } while (last.next !== first)

                this.addFace(first, last);
            }
        }
    }
/**
     * Clear all faces and create new faces from edges
     */
Clear all faces and create new faces from edges
Clear all faces and create new faces from edges
recreateFaces() {
        this.faces.clear();
        for (let edge of this.edges) {
            edge.face = null;
        }
        let first;
        let unassignedEdgeFound = true;
        while (unassignedEdgeFound) {
            unassignedEdgeFound = false;
            for (let edge of this.edges) {
                if (edge.face === null) {
                    first = edge;
                    unassignedEdgeFound = true;
                    break;
                }
            }
            if (unassignedEdgeFound) {
                let last = first;
                do {
                    last = last.next;
                } while (last.next !== first)
                this.addFace(first, last);
            }
        }
    }
recreateFaces ( ) { this . faces . clear ( ) ; for ( let edge of this . edges ) { edge . face = null ; } let first ; let unassignedEdgeFound = true ; while ( unassignedEdgeFound ) { unassignedEdgeFound = false ; for ( let edge of this . edges ) { if ( edge . face === null ) { first = edge ; unassignedEdgeFound = true ; break ; } } if ( unassignedEdgeFound ) { let last = first ; do { last = last . next ; } while ( last . next !== first ) this . addFace ( first , last ) ; } } }
Clear all faces and create new faces from edges
Clear all faces and create new faces from edges
// Remove all faces // Restore faces