File size: 1,675 Bytes
b06e5cf
 
 
 
 
 
 
 
 
 
 
9c39329
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
70
71
72
73
74
---
title: Mesh Refinement Agent
emoji: 🏢
colorFrom: indigo
colorTo: gray
sdk: docker
pinned: false
short_description: This is an AI agent which uses optimizes mesh generation
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

# Mesh Refinement Agent (HF Space)

This Hugging Face Space runs a full machine-learning–guided mesh refinement workflow
for STEP CAD geometry.

The system performs:

- STEP loading and feature extraction  
- Detection of planes, fillets, circular holes, non-circular pockets  
- Part-level feature aggregation  
- Four ML model predictions:
  - Convergence classifier  
  - Global mesh size regressor  
  - Local refinement flag classifier  
  - Local mesh size regressor  
- Gmsh meshing with background field refinement  
- PNG + interactive Plotly visualization  
- `.msh` mesh export

---

## How to Use

1. Upload a `.step` / `.stp` file  
2. Select the load type (bend or tension)  
3. Pick visualization mode:
   - Wireframe
   - Highlight (local refinement)
   - Heatmap (element size inverse)  
4. Press **Run**

You will receive:

- A natural-language summary of predicted convergence & refinement  
- Global mesh PNG  
- Refined mesh PNG  
- Interactive 3D mesh viewer  
- Downloadable `mesh_refined.msh`

---

## Project Files

Key files included in this Space:

Models are pre-trained and do not require Ansys or dataset files.

---

## Notes

- Computation is CPU-only (HF Spaces restriction)
- Very large STEP files may take 10–40 seconds
- All geometry processing uses `cadquery-ocp` OpenCascade backend
- Gmsh 4.11.1 CLI is used for meshing

---

## License

MIT License