ldraw-to-scad
A tool to convert from an LDraw drawing to an Open SCAD CAD file
State: Alpha Intent: Converting LDraw projects to Open SCAD to render, animate or use for other assemblies.
Usage
Requires python3, with no external python dependancies:
ldraw2scad <ldraw file> <scad file>
Besides this basic parameters several options are available to generate results either as self-contained OpenSCAD files or relying on an LDraw OpenSCAD library that can be generated with this tool as well. Invoke the tool with the --help option for more information.
By default it requires the ldraw library in lib/ldraw relative to the working directory you run this from. Alternatively you can point the tool to a different location for the libray with the --lib option. It also (naively) expects the ldraw library filenames to be lowercase.
Testing
Install the test-requirements.txt file, then run pip install -e . and finally pytest ..
Making animations
This requires a bit of OpenSCAD knowledge. First - ensure you have clearly separated the sections that will move relative to each other. You can put them either in one single MPD file or put them in a couple of separate LDraw DAT files.
You can then add the movement transformations. LDraw actually stores matrices that are relative to the parts origin. You will want to wrap these in simple transformations - like translate and rotate.
OpenSCAD has a special variable $t - which is a time offset between 0 and 1. You can multiple $t by a value to create movement. You can then enable animation in the window options, and specify a framerate, and the total number of steps in the animation.
This will start OpenSCAD rendering in the preview window. To start exporting the frames - tick the "Dump Pictures" box under the window. Warning - "Dump Pictures" will dump the resolution the preview window is in, which may be a bit odd.
You can then use FFMpeg or AVtools to stitch them into a video:
avconv -framerate 20 -i frame%05d.png -c:v libx264 -r 30 out.mp4
Metadata
Release files for ldraw-to-scad 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ldraw_to_scad-0.5.0.tar.gz | 17.6 kB | Without provenance | Details for ldraw_to_scad-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ldraw_to_scad-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for ldraw_to_scad-0.5.0-py3-none-any.whl |
Total release size: 32.5 kB
Release files / ldraw_to_scad-0.5.0.tar.gz
| Download URL | ldraw_to_scad-0.5.0.tar.gz |
|---|---|
| Size | 17.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
42d0eb2476ed618f7545fc5ccc6bd9d6f46b1ca1e0736a251935507b0be001e6
|
|
BLAKE2b-256 checksum How to use checksums |
7ba00e28240208c8a7bd47985927c79f61a71cbc85da2748a28377126d508997
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / ldraw_to_scad-0.5.0-py3-none-any.whl
| Download URL | ldraw_to_scad-0.5.0-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a384cb998a6ff4b85ff22ccd810b3538e4d562fb53b17f3e1604e2d888b63b08
|
|
BLAKE2b-256 checksum How to use checksums |
7287bc710b4b9b4b72128fb3c2afe2859676910bf5c8689aca4cdf6f502f3fa6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Security for ldraw-to-scad 0.5.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.