Stl mass calc

From XuShuwenn/RedAct · View interactive version

Stl mass calc is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Compute the mass of the largest connected component in a binary STL where the 2-byte attribute field stores a material ID, using a Markdown density table.

How to use this skill

Skill file

STL Mass Calculation from Material ID

Determine the mass of a 3D part from a binary STL by isolating the largest connected component, extracting its Material ID from the 2-byte attribute field of each triangle, looking up density from a Markdown table, and computing mass = volume × density.

When to Use

Use this skill when you have:

Core Principles

Core Workflow

1) Parse Binary STL

2) Build Connected Components

3) Volume Calculation

4) Component Material ID

5) Density Lookup (Markdown table)

6) Units and Mass Computation

7) Output

Verification

Common Pitfalls

Optional Script Usage

A helper script is provided to parse the STL, isolate the largest component, extract its Material ID, parse a Markdown density table, and output the mass JSON.

Example:

python3 scripts/stl_mass_tool.py --stl path/to/model.stl --density-table materials.md --out mass_report.json

python3 scripts/stl_mass_tool.py --stl path/to/model.stl --density-table materials.md --out mass_report.json --assume-units mm

The script prints basic diagnostics and writes the requested JSON.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.