Skip to content

berrydev-ai/step2image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

step2image

Convert STEP CAD files to rendered PNG images using Blender.

Requirements

  • Blender 5.0+ (with Python 3.11)
  • pythonocc-core 7.7.2+

Installation

1. Install Miniconda (if not already installed)

# macOS with Homebrew
brew install --cask miniconda
conda init zsh  # or: conda init bash
# Restart your terminal after this

2. Install pythonocc-core

# Create environment and install pythonocc-core
conda create -n pythonocc python=3.11
conda activate pythonocc
conda install -c conda-forge pythonocc-core

# Copy OCC folder to step2image directory
cp -r $CONDA_PREFIX/lib/python3.11/site-packages/OCC /path/to/step2image/

3. Download step2image.py

Copy step2image.py to your desired location along with the OCC/ folder.

Alternative: pip (if available for your platform)

pip install pythonocc-core
# Then copy the OCC folder from your site-packages

Usage

Single File

blender --background --python step2image.py -- input.step output.png

Batch Processing (Folder)

blender --background --python step2image.py -- ./step_files/ ./renders/

With Options

blender --background --python step2image.py -- input.step output.png \
    --resolution 1920 1080 \
    --samples 64 \
    --detail 100 \
    --view isometric \
    --background "#FFFFFF" \
    --engine CYCLES

Options

Option Default Description
input required STEP file or folder of STEP files
output required Output PNG file or folder
--resolution 1920 1080 Image width and height
--samples 64 Render samples (quality)
--detail 100 Mesh tessellation detail (1-500)
--view isometric Camera preset
--background #EEEEEE Background hex color
--transparent false Use transparent background
--engine CYCLES Render engine (CYCLES or EEVEE)

Camera Views

  • isometric - Standard isometric view (default)
  • front - Front view
  • back - Back view
  • top - Top view
  • bottom - Bottom view
  • right - Right view
  • left - Left view

Examples

High Quality Render

blender --background --python step2image.py -- part.step render.png \
    --resolution 3840 2160 \
    --samples 256 \
    --detail 200

Quick Preview

blender --background --python step2image.py -- part.step preview.png \
    --resolution 800 600 \
    --samples 16 \
    --engine EEVEE

Transparent Background

blender --background --python step2image.py -- part.step render.png \
    --transparent

Batch Process Folder

blender --background --python step2image.py -- ./cad_models/ ./images/

License

GPL-3.0

Credits

Based on STEPmac by Tommi Hyppanen and theeko. Uses pythonocc-core (OpenCASCADE Python bindings).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages