import type { MeshLabWebScript } from './scriptTypes';

export const PRESET_SCRIPTS: MeshLabWebScript[] = [
  {
    version: 1, name: 'Clean & Smooth',
    description: 'Basic cleanup followed by light smoothing',
    createdAt: '',
    filters: [
      { id: 'remove_duplicate_vertices', params: {} },
      { id: 'remove_unreferenced_vertices', params: {} },
      { id: 'remove_degenerate_faces', params: {} },
      { id: 'laplacian_smooth', params: { iterations: 2 } },
      { id: 'compute_normals', params: {} },
    ],
  },
  {
    version: 1, name: 'Scan Cleanup',
    description: 'Remove noise and small components from 3D scan data',
    createdAt: '',
    filters: [
      { id: 'remove_duplicate_vertices', params: {} },
      { id: 'remove_small_components', params: { minFaces: 100 } },
      { id: 'remove_degenerate_faces', params: {} },
      { id: 'fix_non_manifold_edges', params: {} },
      { id: 'laplacian_smooth', params: { iterations: 1 } },
      { id: 'compute_normals', params: {} },
    ],
  },
  {
    version: 1, name: '3D Print Preparation',
    description: 'Repair mesh for 3D printing',
    createdAt: '',
    filters: [
      { id: 'remove_duplicate_vertices', params: {} },
      { id: 'remove_unreferenced_vertices', params: {} },
      { id: 'remove_degenerate_faces', params: {} },
      { id: 'fix_non_manifold_edges', params: {} },
      { id: 'fill_holes', params: { maxEdges: 0 } },
      { id: 'compute_normals', params: {} },
    ],
  },
  {
    version: 1, name: 'Simplify 50%',
    description: 'Reduce face count to half',
    createdAt: '',
    filters: [
      { id: 'remove_duplicate_vertices', params: {} },
      { id: 'simplification', params: { targetFaces: 0 } },
      { id: 'compute_normals', params: {} },
    ],
  },
];
