Skip to main content

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

warp_engine-0.3.0.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

warp_engine-0.3.0-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file warp_engine-0.3.0.tar.gz.

File metadata

  • Download URL: warp_engine-0.3.0.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for warp_engine-0.3.0.tar.gz
Algorithm Hash digest
SHA256 467450b904e6ec43ed26230fda98b796990817946ef79b261d5efb302858ae6c
MD5 0f5fedafc7864fb9b0202e41bee94f9a
BLAKE2b-256 4ce392f3702420681858e7a1526fde147c1a0d30e67a18a05c8c6d96472a9f00

See more details on using hashes here.

File details

Details for the file warp_engine-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: warp_engine-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for warp_engine-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c648bcca57e980f91c793a9c7485a8d5e971335261602e7efb17673c78fea9c
MD5 8420280a9cc653d5c82c30970ddfe5a7
BLAKE2b-256 abf0f3fa8534ec373ad11b519aafb692de51db7f9cd6358f0cd7b35d2ddc67ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page