cad-mesh-generation

Generate parametric CAD geometry and finite element meshes using FreeCAD and GMSH

5 stars

Best use case

cad-mesh-generation is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Generate parametric CAD geometry and finite element meshes using FreeCAD and GMSH

Teams using cad-mesh-generation should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/cad-mesh-generation/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/data/scientific/cad-mesh-generation/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/cad-mesh-generation/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How cad-mesh-generation Compares

Feature / Agentcad-mesh-generationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Generate parametric CAD geometry and finite element meshes using FreeCAD and GMSH

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Cad Mesh Generation

## When to Use This Skill

Use this skill when you need to:
- Create parametric CAD models of vessels, platforms, or structures
- Generate meshes for finite element analysis (FEA)
- Generate panel meshes for boundary element methods (BEM/hydrodynamics)
- Automate geometry creation for marine structures
- Export geometry to AQWA, WAMIT, ANSYS, or other analysis tools
- Create complex geometries programmatically with Python
- Perform mesh quality checks and refinement

## Core Knowledge Areas

### 1. FreeCAD Python Scripting Basics

Creating geometry with FreeCAD Python API:

```python
import sys
from pathlib import Path
from typing import List, Tuple, Optional
import numpy as np

# Try to import FreeCAD, provide fallback for development
try:

*See sub-skills for full details.*
### 2. GMSH Mesh Generation

Creating meshes with GMSH Python API:

```python
# Try to import gmsh
try:
    import gmsh
    GMSH_AVAILABLE = True
except ImportError:
    GMSH_AVAILABLE = False
    print("Warning: GMSH not available, using mock")

*See sub-skills for full details.*
### 3. Mesh Quality Assessment

Check mesh quality metrics:

```python
def analyze_mesh_quality(
    mesh_file: Path,
    mesh_type: str = 'surface'
) -> dict:
    """
    Analyze mesh quality metrics.


*See sub-skills for full details.*
### 4. Mesh Conversion for Analysis Tools

Convert meshes to various formats:

```python
def convert_mesh_to_wamit_gdf(
    mesh_file: Path,
    output_file: Path,
    symmetry: str = 'none'
) -> None:
    """
    Convert GMSH mesh to WAMIT .gdf format.

*See sub-skills for full details.*

## Complete Examples

### Example 1: Complete Vessel Geometry and Mesh Workflow

```python
from pathlib import Path
import numpy as np

def complete_vessel_geometry_workflow(
    vessel_params: dict,
    mesh_params: dict,
    output_dir: Path
) -> dict:
    """

*See sub-skills for full details.*

## Resources

### FreeCAD

- **Documentation**: https://wiki.freecadweb.org/
- **Python API**: https://wiki.freecadweb.org/Python_scripting_tutorial
- **Examples**: https://github.com/FreeCAD/FreeCAD/tree/master/src/Mod/Part/TestPartApp
### GMSH

- **Documentation**: https://gmsh.info/doc/texinfo/gmsh.html
- **Python API**: http://gmsh.info/doc/texinfo/gmsh.html#Gmsh-API
- **Tutorials**: https://gitlab.onelab.info/gmsh/gmsh/-/tree/master/tutorials
### Mesh Generation

- **Netgen**: https://ngsolve.org/
- **TetGen**: http://wias-berlin.de/software/tetgen/
- **Triangle**: https://www.cs.cmu.edu/~quake/triangle.html
### Marine Geometry

- **DelftShip**: Free ship hull design software
- **MAXSURF**: Professional naval architecture software
- **Rhinoceros**: Advanced 3D modeling (with Grasshopper for parametric)

---

**Use this skill for:** Expert CAD geometry creation and mesh generation for marine structures with full export capabilities to analysis software.

## Sub-Skills

- [1. Parametric Design (+2)](1-parametric-design/SKILL.md)

Related Skills

label-driven-prompt-generation-architecture

5
from vamseeachanta/workspace-hub

Pattern for building automation scripts that classify GitHub issues into prompt templates using label-based routing and extract contextual data for batch processing

agent-team-prompt-generation

5
from vamseeachanta/workspace-hub

Create self-contained execution prompts that define multi-role workflows for Codex sessions without external dependencies

gtm-workflow-gif-generation

5
from vamseeachanta/workspace-hub

Generate workflow-style GTM GIFs from validated HTML demo reports using synthetic scene slides plus Playwright/Pillow scroll capture, with Python 3.12 fallback and GIF size optimization.

gtm-demo-workflow-gif-generation

5
from vamseeachanta/workspace-hub

Generate GTM demo GIF assets from validated HTML reports, including both report-scroll GIFs and one higher-fidelity workflow-style GIF, while avoiding Playwright/Python environment traps.

stable-diffusion-image-generation

5
from vamseeachanta/workspace-hub

State-of-the-art text-to-image generation with Stable Diffusion models via HuggingFace Diffusers. Use when generating images from text prompts, performing image-to-image translation, inpainting, or building custom diffusion pipelines.

orcawave-mesh-generation

5
from vamseeachanta/workspace-hub

Panel mesh generation for OrcaWave diffraction analysis. Use when converting CAD/STL to panel mesh, validating mesh quality, running convergence studies, or generating GDF files for hydrodynamic computations.

lead-generation

5
from vamseeachanta/workspace-hub

B2B demand generation with CAC optimization, multi-channel strategies, and lead qualification frameworks. Use for lead acquisition, nurture campaigns, and conversion optimization. Based on alirezarezvani/Codex-skills.

json-config-loader-3-json-report-generation

5
from vamseeachanta/workspace-hub

Sub-skill of json-config-loader: 3. JSON Report Generation.

hydrodynamic-pipeline-gmsh-panel-mesh-for-hydrodynamics

5
from vamseeachanta/workspace-hub

Sub-skill of hydrodynamic-pipeline: Gmsh Panel Mesh for Hydrodynamics (+3).

hydrodynamic-pipeline-checkpoint-1-mesh-quality

5
from vamseeachanta/workspace-hub

Sub-skill of hydrodynamic-pipeline: Checkpoint 1: Mesh Quality (+2).

gmsh-openfoam-orcaflex-gate-1-mesh-quality

5
from vamseeachanta/workspace-hub

Sub-skill of gmsh-openfoam-orcaflex: Gate 1 — Mesh Quality (+1).

gmsh-openfoam-orcaflex-converter-1-gmsh-msh-openfoam-polymesh

5
from vamseeachanta/workspace-hub

Sub-skill of gmsh-openfoam-orcaflex: Converter 1: Gmsh .msh → OpenFOAM polyMesh (+1).