53 lines
1.6 KiB
Python
53 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Test geometry import with real ANSYS
|
|
"""
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Add project root to path
|
|
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
|
|
from backend.pymechanical.session_manager import ANSYSSessionManager
|
|
|
|
def test_geometry_import():
|
|
"""Test geometry import functionality"""
|
|
print("Testing Geometry Import with Real ANSYS...")
|
|
|
|
blade_file = Path("resource/blade.step")
|
|
if not blade_file.exists():
|
|
print("✗ Test file resource/blade.step not found")
|
|
return
|
|
|
|
try:
|
|
# Test with real ANSYS
|
|
with ANSYSSessionManager(simulation_mode=False) as session:
|
|
print("✓ ANSYS session started")
|
|
|
|
# Test geometry import
|
|
print(f"Importing geometry from {blade_file}...")
|
|
success = session.import_geometry(str(blade_file))
|
|
|
|
if success:
|
|
print("✓ Geometry import successful")
|
|
|
|
# Get session info
|
|
session_info = session.get_session_info()
|
|
print(f"Session info: {session_info}")
|
|
|
|
# Validate geometry
|
|
validation_result = session.validate_geometry()
|
|
print(f"Validation result: {validation_result}")
|
|
|
|
else:
|
|
print("✗ Geometry import failed")
|
|
|
|
except Exception as e:
|
|
print(f"✗ Test failed: {str(e)}")
|
|
import traceback
|
|
traceback.print_exc()
|
|
|
|
if __name__ == '__main__':
|
|
print("CAE Mesh Generator Geometry Import Test")
|
|
print("=" * 50)
|
|
test_geometry_import() |