Skip to content

v2.0.0

Latest

Choose a tag to compare

@yaneony yaneony released this 12 May 23:51
· 3 commits to main since this release

Major release. Multi-output reduction, much better error diagnostics, a self-learning ETA estimator, configurable timeouts, crash-isolated CAD stages, and a complete documentation rewrite.

New features

Reduction

  • Comma-separated reduction values. --reduce 25,50,75 (or DEFAULT_REDUCE: "25,50,75" in config) writes one .stp per value. Works in single-file, multi-file, batch, and watch modes.
  • Output filenames include the reduction percentage as [N], e.g. model [25].stp, model [0].stp for no reduction, model [100].stp for maximum.
  • Interactive reduction prompt with multi-value entry. Type 25, 25,50,75, 0, or just Enter to accept the default.
  • ! prefix in the prompt locks the chosen reduction(s) for all remaining files in the batch. Type !25 once to apply 25% reduction to every following file without re-prompting.
  • Auto-rename in single-file interactive mode: if the user changes the default fraction at the prompt, the output filename updates to match.
  • Mesh is preloaded once and reused across multiple fractions of the same source file, avoiding redundant disk read and Open3D cleanup.

CLI

  • --preview / --no-preview flags override GENERATE_PREVIEW per run without editing the config (uses argparse.BooleanOptionalAction).
  • --watch / -w continues monitoring models/ after the initial batch run and converts new files as they appear.
  • --force / -f re-converts files even if the output is already newer than the source.
  • --dry-run / --dry shows what would be converted or skipped without doing anything.
  • --output-dir / -d writes all outputs to a single directory instead of alongside each source.

Configuration

  • SEW_TIMEOUT config option (default 1800 seconds, was hardcoded to 600). Increase for very dense meshes; decrease if you'd rather fail fast.
  • DEFAULT_REDUCE now accepts numbers (25) or comma-separated strings ("25,50,75") to enable multi-output by default.
  • SKIP_EXISTING config flag - skip files whose output is already newer than the source. Overridable with --force.
  • Config validation at startup. Invalid values produce warnings (printed in yellow) and fall back to defaults.

Diagnostics & estimator

  • Self-learning conversion-time estimator. Records post-sew time per format and globally; after 5 samples shows an ETA right after sewing with R² confidence percentage. Data persists in data/estimator.json.
  • Sewing errors now surface the real cause. Previously every sewing failure printed "try a larger tolerance" regardless. The subprocess now captures stderr and reports the actual error: timeout, silent crash with exit code, or specific OCC RuntimeError.
  • Activity badges (Stars, Issues, Last Commit) and a Ko-fi support button in the README.

Format support

  • STL - both binary and ASCII via a fast vectorised parser.
  • 3MF - multi-object archives, resolves the model document via OPC relationships.
  • OBJ - polygons triangulated automatically, negative vertex indices supported.
  • AMF - both plain XML and zipped variants.
  • IGES - via OpenCASCADE's direct reader, bypassing the mesh stage entirely.

Bug fixes

  • Fixed crash where the interactive prompt zeroing out a default reduction left shape unbuilt, producing a misleading "input produced an empty shape" error.
  • Fixed 0 being silently dropped from comma-separated reduction input.
  • Fixed 100 being silently dropped from comma-separated reduction input.
  • Reduction values are now sorted ascending; --reduce 80,20 runs as 20 then 80.
  • 100% reduction now correctly produces [100] in the filename (was [99]).
  • Refining no longer crashes the converter. ShapeUpgrade_UnifySameDomain is run in an isolated subprocess so a CAD-kernel segfault doesn't take the whole process down.
  • Fixing also runs in a subprocess for the same crash-isolation reason.
  • Sewing timeouts are now correctly reported as timeouts, not as silent crashes.
  • Combined two byte-identical except ImportError / except Exception clauses in the reduce step.
  • Fixed _IGES_EXTS = _IGES_EXTS self-reference that briefly broke module import.

Improvements

Behaviour

  • REDUCE_INTERACTIVE defaults to true so new installs prompt per file. Still skippable with Enter to accept the default.
  • Sewing timeout raised from 600s to 1800s. Dense meshes no longer trip the 10-minute cap by default.
  • Preview always shows reduction X% including 0% for un-reduced files. Output is consistent across all generated previews.
  • Crash isolation: sewing, fixing, and refining each run in dedicated subprocesses. A CAD-kernel crash skips the file but the batch continues.

Pipeline

  • Open3D primary reducer with trimesh and fast-simplification as fallbacks. Previous releases had this attribution backwards.
  • Open3D mesh cleanup before sewing (dedup vertices, dedup triangles, remove degenerate triangles).
  • ShapeUpgrade_UnifySameDomain runs twice inside the refine subprocess for stronger co-planar merging.
  • Preview rendering uses the in-memory shape instead of re-reading the just-written STEP file.

Code quality

  • Internal constants moved out of config.json (BYTES_PER_KB, NAME_TRIM_WIDTH, SEPARATOR_WIDTH, STD_OUTPUT_HANDLE, CONSOLE_MODE_FLAGS). They're now hardcoded - they were never meaningfully user-tunable.
  • Helper extractions to remove duplication: _IGES_EXTS (replaced 6 inline copies), _preload_mesh (replaced 3 identical blocks), _is_up_to_date (replaced 3 inline checks), _first_error_line (stderr parsing).
  • Removed dead code: _topo_counts, four unused return-dict fields (verts, tris, faces, edges), dead import numpy as np statements, duplicate exception handlers, unused label_prefix parameter, dead n_tris = len(tris_np) assignment.
  • _first_* flag patterns replaced with enumerate() + if i > 0: in three loops.
  • getattr(args, 'dry_run', False) simplified to args.dry_run - argparse always provides the attribute.
  • All comments removed from converter.py, 2STEP-Converter.bat, 2STEP-Converter.sh.
  • All em-dashes and en-dashes replaced with hyphens across the entire project.

Filesystem layout

  • Config and estimator moved into data/ (data/config.json, data/estimator.json).
  • One-time auto-migration of an old estimator.json from the project root into data/ on first launch.

Documentation

  • Complete README rewrite with new sections:
    • Installation - explicit download / extract / run steps.
    • Limitations - seven explicit non-features so users know what to expect (no hole filling, no colors/materials, no assembly hierarchy, etc.).
    • Troubleshooting - full error reference table with the actual error strings the converter emits and concrete fixes for each.
    • Credits - links to OpenCASCADE, FreeCAD, Open3D, trimesh, fast-simplification, matplotlib, Pillow, micromamba.
    • Disclaimer - plain-language warranty disclaimer alongside the existing MIT license.
  • Verified install sizes with real dir /s measurements: ~7.5 GB total on Windows.
  • New "Why so large?" section explains the env vs extracted-package-mirror split (~3.5 GB + ~4.1 GB), the duplicate-DLL situation, and what's safe to clean up.
  • "How It Works" pipeline table now correctly credits Open3D for mesh cleanup and as the primary reducer. Steps 5-7 (sew/fix/refine) noted as running in isolated subprocesses.
  • Table of Contents with 12 entries linking to all major sections.
  • Activity badges + Ko-fi support button added at the top. All shields upgraded to for-the-badge style.
  • Descriptive alt text on every image for accessibility and image search.
  • Configuration JSON example now shows all 14 keys (was 8).
  • Project Structure with consistent hierarchy and per-folder size hints.

Breaking changes

  • REDUCE_INTERACTIVE now defaults to true. New installs are prompted on every file. Set it to false in data/config.json to restore the previous quiet behavior.
  • SEW_TIMEOUT is new at 1800s. If you were relying on the old 600s fail-fast behavior, set "SEW_TIMEOUT": 600 in data/config.json.
  • Removed config keys (now hardcoded): BYTES_PER_KB, NAME_TRIM_WIDTH, SEPARATOR_WIDTH, STD_OUTPUT_HANDLE, CONSOLE_MODE_FLAGS. They're silently ignored if present in an existing config.json.

Upgrade

The simplest path: redownload the project.