Spaces:
Sleeping
Sleeping
| # core/utils.py | |
| """Shared utility functions for NeuralCAD.""" | |
| from __future__ import annotations | |
| def derive_part_name(text: str, max_chars: int = 40) -> str: | |
| """Derive a filesystem-safe part name from text.""" | |
| name = text[:max_chars].strip().replace(" ", "_").lower() | |
| name = "".join(c for c in name if c.isalnum() or c == "_") | |
| return name or "part" | |