G-code warp prediction engine for 3D printing
Project description
warp-engine
A predictive warp analysis engine for 3D printing. Feed it G-code and it tells you where your print is likely to warp, why, and what to do about it.
warp-engine parses G-code from any major slicer, runs a multi-factor risk analysis (thermal, geometry, adhesion, print settings), and produces a scored report with per-region risk breakdowns and actionable recommendations.
Installation
pip install warp-engine
Requires Python 3.11+.
Quick Start
from warp_engine.engine import Engine
from warp_engine.models import AnalysisTier
engine = Engine()
# Read your G-code file
with open("my_print.gcode") as f:
gcode = f.read()
# Run analysis
report = engine.analyze(
gcode=gcode,
material="ABS",
tier=AnalysisTier.STANDARD,
printer_profile="bambu_x1c",
)
# Check results
print(f"Risk: {report.risk_level.name} ({report.overall_score:.0%})")
for rec in report.recommendations:
print(f" [{rec.category}] {rec.message}")
Analysis Tiers
| Tier | Method | Speed | Best For |
|---|---|---|---|
| Quick | Heuristic lookup tables | < 1s | Fast screening, free-tier API |
| Standard | 1D heat equation per layer stack | 5-15s | Most prints, good accuracy |
| Performance | 3D FEA-lite voxel solver | 30s-5min | Large/complex prints, maximum accuracy |
All tiers produce the same WarpReport output structure.
Risk Factors
The engine evaluates four independent risk categories and combines them with material-specific weights:
- Thermal -- inter-layer cooling, temperature gradients, airflow effects
- Geometry -- large flat regions, thin walls, sharp corners, overhangs
- Adhesion -- bed contact area, first layer coverage, adhesion type
- Settings -- cooling fan speed, bed temp, print speed, layer height
Supported Materials
PLA, ABS, PETG, ASA, TPU, Nylon, PC -- each with calibrated thermal properties and risk weights. See docs/materials.md for full property tables.
Supported Printers
Bambu Lab X1C, H2D, P1S, A1, A1 Mini | Prusa MK4 | Creality Ender-3 V3 | Voron 2.4
Printer profiles include airflow source positions for accurate thermal simulation. See docs/printers.md for details.
G-code Compatibility
Parses all major G-code flavors: Marlin, Klipper, RepRap, Smoothieware, Sailfish. Auto-detects the flavor from slicer comments.
Documentation
- Getting Started -- installation, first analysis, interpreting results
- API Reference -- Engine class, data models, WarpReport structure
- Materials -- built-in material profiles and properties
- Printers -- built-in printer profiles and airflow configs
- REST API -- Django integration endpoints
License
MIT -- see LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file warp_engine-0.2.0.tar.gz.
File metadata
- Download URL: warp_engine-0.2.0.tar.gz
- Upload date:
- Size: 29.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5160f31d85590a56adc7a6a565850050cceeeff546d3e2697a7b8abd508f15d
|
|
| MD5 |
fb84db99b95d3388905f536eae5ef09f
|
|
| BLAKE2b-256 |
d6b70fc2ab18afac86c9452441f73797bfa817dcdf692677a3b8b34043e6097b
|
File details
Details for the file warp_engine-0.2.0-py3-none-any.whl.
File metadata
- Download URL: warp_engine-0.2.0-py3-none-any.whl
- Upload date:
- Size: 31.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f37eeb1667db2602ead9fe34afaf9c64d3c95071e6e33673b7153a7b3c8cb149
|
|
| MD5 |
1b432f4127e706655db3e7d9fcbae917
|
|
| BLAKE2b-256 |
bcf33f0e25c4af3a3bdaf14901a875ca9ceb5413b459fea230163596e5d1bab5
|