import { tm_edge_kill } from "./tm_edge_kill.js";
import { tm_kill_only_vert } from "./tm_kill_only_vert.js";

/**
 * Remove vertex and all edges that use it
 * @param {TopoMesh} mesh
 * @param {TopoVertex} vertex
 */
export function tm_vert_kill(mesh, vertex) {
    const edges = vertex.edges;

    const edge_count = edges.length;

    for (let i = edge_count - 1; i >= 0; i--) {
        tm_edge_kill(mesh, edges[i]);
    }

    tm_kill_only_vert(mesh, vertex);
}
