File size: 1,682 Bytes
fdb3169 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
#!/usr/bin/env python3
"""
SDF-Based Analytic Geometry Solver
Main entry point for batch processing geometry problems.
"""
import argparse
import sys
from pathlib import Path
# Add src directory to path for module imports
sys.path.insert(0, str(Path(__file__).parent))
from sdf_geo import SDFBatchProcessor
def main():
parser = argparse.ArgumentParser(
description='SDF-Based Geometry Solver - Automatic geometry visualization using Signed Distance Fields'
)
parser.add_argument(
'--input', '-i',
type=str,
default='data/test_en.json',
help='Path to input JSON file containing geometry problems'
)
parser.add_argument(
'--output', '-o',
type=str,
default='results',
help='Output directory for generated visualizations'
)
parser.add_argument(
'--max', '-m',
type=int,
default=None,
help='Maximum number of problems to process (default: all)'
)
parser.add_argument(
'--verbose', '-v',
action='store_true',
help='Enable verbose output during processing'
)
args = parser.parse_args()
# Resolve paths
input_path = Path(args.input)
output_path = Path(args.output)
# Check input file exists
if not input_path.exists():
print(f"Error: Input file not found: {input_path}")
return 1
# Create processor and run
processor = SDFBatchProcessor(str(output_path))
processor.process_batch(
str(input_path),
max_problems=args.max,
verbose=args.verbose
)
return 0
if __name__ == '__main__':
exit(main())
|