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 a 3D part by parsing a binary STL that stores Material ID in the 2-byte attribute field, isolating the largest connected component, mapping density from a reference, and performing correct unit conversions.

How to use this skill

Skill file

STL Mass Calculation from Material-ID-Encoded Binary STL

This skill computes the mass of a 3D printed/scanned part from a binary STL where each triangle's 2-byte "Attribute Byte Count" stores a Material ID. It:

When to Use

Use this skill when you need to compute the mass of a part from a binary STL that encodes Material ID in the per-triangle attribute bytes and a separate table maps Material IDs to densities.

Inputs and Assumptions

Core Workflow

  1. Parse the Binary STL
  1. Build Connectivity and Find the Largest Component
  1. Determine the Component's Material ID
  1. Volume Calculation
  1. Density Lookup
  1. Unit Conversion and Mass Calculation
  1. Output

Verification

Perform these checks to ensure correctness and avoid common failure modes:

Common Pitfalls and How to Avoid Them

Success Criteria

Optional Script Usage

A helper script is provided to run the full workflow.

Example usage:

The script prints a short summary and writes the final JSON report.

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.