Skip to main content

2D CAD Drawing generation from 3D CAD models

This tool is used to generate 2D CAD drawings from 3D CAD models.

Installation

Install the package from PyPI:

pip install cad-3dto2d

Or install the package from the source code:

git clone https://github.com/neka-nat/cad-3dto2d.git
cd cad-3dto2d
uv sync

Usage

python scripts/gen2d.py --step_file </path/to/step_file> --template A4_LandscapeParam --add_dimensions

Batch generation for machine-learning datasets (random template/style/scale/layout):

python scripts/gen2d_batch_random.py \
  --input_dir path/to/3d_models_dir/ \
  --output_dir path/to/output_dir/ \
  --recursive \
  --variants-per-step 3 \
  --random-side-position \
  --random-top-position \
  --workers 4 \
  --layout-scale-min 30 \
  --layout-scale-max 70 \
  --layout-offset-x-min -20 \
  --layout-offset-x-max 20 \
  --layout-offset-y-min -20 \
  --layout-offset-y-max 20 \
  --seed 42

If you do not need template-based layout alignment, add --no-use-template-layout for faster generation.

Demo

Original 3D model (Flange)

3d_flange

Generated 2D drawing (Flange)

2d_flange

Original 3D model (Lego Block)

3d_lego_block

Generated 2D drawing (Lego Block)

2d_lego_block

Metadata

Release files for cad-3dto2d 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cad-3dto2d 0.3.0
File Size Uploaded Provenance
cad_3dto2d-0.3.0.tar.gz 97.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cad-3dto2d 0.3.0
File Interpreter ABI Platform
cad_3dto2d-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 147.0 kB

Release files / cad_3dto2d-0.3.0.tar.gz

Download URL cad_3dto2d-0.3.0.tar.gz
Size 97.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5157099e19f64cd9ec3738b075c25e279605dde3524111b938361e79481d3bb1
BLAKE2b-256 checksum
How to use checksums
aa736f59309f75c3893c10bbfa0059cbe8a20a7358ff4ff66429f1826f7c2be1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.15

Release files / cad_3dto2d-0.3.0-py3-none-any.whl

Download URL cad_3dto2d-0.3.0-py3-none-any.whl
Size 49.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
653a96941046bfbfdc5958f6feefd588d65c9cf54805e551b71cdeb73839914f
BLAKE2b-256 checksum
How to use checksums
677d98757660c67cbf22ae159b551dcf2183927043ddef6c0e58bb1787b7d4a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.15

Security for cad-3dto2d 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page