{
  "type": "object",
  "description": "Work in progress. From a topological_offset construction (a .vtu, or a .msh with corr_input_vid), thins the offset band around the solid to a target thickness and, with prism_dominant, rebuilds it as prisms, pyramids and tets.",
  "properties": {
    "application": {
      "type": "string",
      "description": "Application name must be prismatic_mesh.",
      "enum": [
        "prismatic_mesh"
      ]
    },
    "input": {
      "type": "string",
      "description": "Construction .vtu or Gmsh 4.1 .msh with corr_input_vid. MSH can derive labels and cell tags from the tag_0/offset/ambient physical groups; explicit PRISM fields are also supported."
    },
    "output": {
      "type": "string",
      "description": "Output .vtu or .msh (Gmsh 4.1 ASCII) filename, relative to the JSON directory. A missing extension becomes .vtu."
    },
    "input_dir": {
      "type": "string",
      "description": "Base directory for input; set by wmtk_app to the JSON directory.",
      "default": ""
    },
    "thicknessratio": {
      "type": "number",
      "description": "Positive target thickness relative to the mean length of unique input surface edges.",
      "default": 0.1
    },
    "iterations": {
      "type": "integer",
      "description": "Number of collapse/smoothing iterations; 0 computes targets without optimization.",
      "default": 5
    },
    "keep_background_mesh": {
      "type": "boolean",
      "description": "Keep exterior background tetrahedra during optimization/output. Background must remain strictly positive. Without background_remeshing only offset vertices move. Targets are computed from the band alone.",
      "default": false
    },
    "prism_dominant": {
      "type": "boolean",
      "description": "After optimization, reconstruct conforming prisms, input-apex shell pyramids and tetrahedra. Retained background receives kernel-point pyramids in feasible disjoint quad-diagonal edge-star cavities. Preserve existing points, input volume and non-cavity background; fall back to conforming tet regions on failed geometry, overlap or search limits.",
      "default": false
    },
    "export_input_and_shell": {
      "type": "boolean",
      "description": "Additionally export the union of input volume and offset band as <output_stem>_input_shell.msh and .vtu, using the same final coordinates, hybrid cells and attributes while omitting background cells.",
      "default": false
    },
    "min_tet_volume": {
      "type": "number",
      "description": "Optional nonnegative signed-volume floor for new or modified shell tetrahedra, candidate pyramid decompositions and new background pyramid cavity cones. The default zero requires strictly positive volume using exact predicates, without a coordinate-scale-dependent cutoff. Background optimization and unchanged background tets also require strictly positive volume.",
      "default": 0
    },
    "smoothing_max_backtracks": {
      "type": "integer",
      "description": "Maximum smoothing step halvings after the full target step; between 0 and 60.",
      "default": 40
    },
    "jacobian_smoothing_iterations": {
      "type": "integer",
      "description": "Optional prism Jacobian smoothing rounds after tet optimization. Zero disables this stage. Only offset vertices move; input, correspondence and connectivity remain fixed.",
      "default": 0
    },
    "jacobian_target": {
      "type": "number",
      "description": "Positive target det(J), normalized by twice input triangle area times initial mean column length.",
      "default": 0.01
    },
    "jacobian_position_weight": {
      "type": "number",
      "description": "Positive quadratic weight on displacement from the position before Jacobian smoothing, normalized by target thickness (initial column length if unavailable).",
      "default": 0.001
    },
    "jacobian_max_step_ratio": {
      "type": "number",
      "description": "Positive per-move displacement bound relative to thickness. Implemented with an inscribed axis-aligned box.",
      "default": 0.25
    },
    "jacobian_max_displacement_ratio": {
      "type": "number",
      "description": "Positive total displacement bound from the position before Jacobian smoothing, relative to thickness. Implemented with an inscribed axis-aligned box.",
      "default": 0.5
    },
    "background_remeshing": {
      "type": "boolean",
      "description": "Enable adaptive background 2-3/3-2 swaps and interior relaxation after each tet iteration, then retry collapse. Requires keep_background_mesh=true. Input/offset vertices and exterior boundary are fixed during remeshing.",
      "default": false
    },
    "background_remeshing_passes": {
      "type": "integer",
      "description": "Local remeshing passes per tet iteration; positive.",
      "default": 2
    },
    "background_quality_threshold": {
      "type": "number",
      "description": "Trigger on background mean ratio below this threshold in (0,1]; 1 is a regular tet, 0 is degenerate. Background-blocked collapses are also repair targets.",
      "default": 0.1
    },
    "background_remeshing_max_operations": {
      "type": "integer",
      "description": "Maximum accepted background swaps/moves per tet iteration; positive.",
      "default": 500
    },
    "background_remeshing_max_attempts": {
      "type": "integer",
      "description": "Maximum attempted background swaps/moves per tet iteration; positive.",
      "default": 20000
    },
    "$schema": {
      "type": "string"
    }
  },
  "required": [
    "application",
    "input",
    "output"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://wildmeshing.github.io/wildmeshing-toolkit/schemas/prismatic_mesh.json",
  "title": "prismatic_mesh",
  "additionalProperties": false
}
