lithophane


Namelithophane JSON
Version 1.0.14 PyPI version JSON
download
home_pagehttps://github.com/robbyHuelsi/lithophane
SummaryThis module generates a 3D model of a lithophane from an given image.
upload_time2023-12-16 20:22:32
maintainerRobert Hülsmann
docs_urlNone
authorDirk Colbry
requires_python>=3.8
licenseMIT
keywords lithophane stl 3d-printing 3d image translucent
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python Lithophane Generator
This module generates a 3D model of a lithophane from an given image. The output file is a STL file. It can then be printed on a 3D printer.

"A lithophane is a thin plaque of translucent material, [...] which has been moulded to varying thickness, such that when lit from behind the different thicknesses show as different shades, forming an image." - [Wikipedia](https://en.wikipedia.org/wiki/Lithophane)

The code is originally written by Dirk Colbry ([original repository](https://github.com/colbrydi/Lithophane)) and edited by Robert Hülsmann. Core of this module uses matlab-stl to write stl files written by Rick van Hattem.

[![Example Lithophane](https://raw.githubusercontent.com/robbyHuelsi/lithophane/main/result.tiff)](https://github.com/robbyHuelsi/lithophane/blob/main/result.gif)

## How to Install
```sh
pip install lithophane
```

## How to Use
```python
import lithophane as li

# 1. Generate xyz point cloud from image
x, y, z = li.jpg_to_stl("path/to/image.jpeg")

# 2. Generate stl model from point cloud
model = li.make_mesh(x, y, z)

# 3. Save model as stl file
model.save("path/to/model.stl")
```


## Command Line Interface

```sh
lithophane the_best_siblings.jpeg --width 100 --frame 3
```

### Optional Arguments
* `--width` or `-w` to set the width of the lithophane. Default is image width with a resolution of 10 pixels per millimeter. The height is calculated automatically.
* `--depth` or `-d` to set the depth of the lithophane. Default is 3mm. More depth means more contrast but also longer print time and less translucency.
* `--offset` or `-o` to set the offset of the lithophane. Default is 0.5mm. It's like the back of the lithophane. More offset means more stability but also less translucency. The thickness of the lithophane is the sum of `depth` and `offset`.
* `--frame` or `-f` to add a frame around the lithophane. Default is 0mm (no frame). The frame is added to the width and height of the lithophane.
* `--show` to show the lithophane in a 3D plot.

## After Model Generation
![Example Lithophane](https://raw.githubusercontent.com/robbyHuelsi/lithophane/main/slicer.png)

After the model is generated, open the STL file in your favorite slicer software to generate the GCODE. **Use 100% infill!** Then, print it with a (slightliy) translucent filament and delight yourself and your beloved ones with a personalized memento.

## Background
If you want to understand how the code works, please take a look into the [original repository](https://github.com/colbrydi/Lithophane) of Dirk Colbry. There are two jupyter notebooks you can try out.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/robbyHuelsi/lithophane",
    "name": "lithophane",
    "maintainer": "Robert H\u00fclsmann",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "robby@huelsi.de",
    "keywords": "lithophane,stl,3d-printing,3d,image,translucent",
    "author": "Dirk Colbry",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/38/21/1f6b519b797a3216a336867a93ceb61b0996ae7e1df5391ff007466949f8/lithophane-1.0.14.tar.gz",
    "platform": null,
    "description": "# Python Lithophane Generator\nThis module generates a 3D model of a lithophane from an given image. The output file is a STL file. It can then be printed on a 3D printer.\n\n\"A lithophane is a thin plaque of translucent material, [...] which has been moulded to varying thickness, such that when lit from behind the different thicknesses show as different shades, forming an image.\" - [Wikipedia](https://en.wikipedia.org/wiki/Lithophane)\n\nThe code is originally written by Dirk Colbry ([original repository](https://github.com/colbrydi/Lithophane)) and edited by Robert H\u00fclsmann. Core of this module uses matlab-stl to write stl files written by Rick van Hattem.\n\n[![Example Lithophane](https://raw.githubusercontent.com/robbyHuelsi/lithophane/main/result.tiff)](https://github.com/robbyHuelsi/lithophane/blob/main/result.gif)\n\n## How to Install\n```sh\npip install lithophane\n```\n\n## How to Use\n```python\nimport lithophane as li\n\n# 1. Generate xyz point cloud from image\nx, y, z = li.jpg_to_stl(\"path/to/image.jpeg\")\n\n# 2. Generate stl model from point cloud\nmodel = li.make_mesh(x, y, z)\n\n# 3. Save model as stl file\nmodel.save(\"path/to/model.stl\")\n```\n\n\n## Command Line Interface\n\n```sh\nlithophane the_best_siblings.jpeg --width 100 --frame 3\n```\n\n### Optional Arguments\n* `--width` or `-w` to set the width of the lithophane. Default is image width with a resolution of 10 pixels per millimeter. The height is calculated automatically.\n* `--depth` or `-d` to set the depth of the lithophane. Default is 3mm. More depth means more contrast but also longer print time and less translucency.\n* `--offset` or `-o` to set the offset of the lithophane. Default is 0.5mm. It's like the back of the lithophane. More offset means more stability but also less translucency. The thickness of the lithophane is the sum of `depth` and `offset`.\n* `--frame` or `-f` to add a frame around the lithophane. Default is 0mm (no frame). The frame is added to the width and height of the lithophane.\n* `--show` to show the lithophane in a 3D plot.\n\n## After Model Generation\n![Example Lithophane](https://raw.githubusercontent.com/robbyHuelsi/lithophane/main/slicer.png)\n\nAfter the model is generated, open the STL file in your favorite slicer software to generate the GCODE. **Use 100% infill!** Then, print it with a (slightliy) translucent filament and delight yourself and your beloved ones with a personalized memento.\n\n## Background\nIf you want to understand how the code works, please take a look into the [original repository](https://github.com/colbrydi/Lithophane) of Dirk Colbry. There are two jupyter notebooks you can try out.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "This module generates a 3D model of a lithophane from an given image.",
    "version": "1.0.14",
    "project_urls": {
        "Download": "https://github.com/robbyHuelsi/lithophane/archive/refs/tags/v1.0.14.tar.gz",
        "Homepage": "https://github.com/robbyHuelsi/lithophane"
    },
    "split_keywords": [
        "lithophane",
        "stl",
        "3d-printing",
        "3d",
        "image",
        "translucent"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "38211f6b519b797a3216a336867a93ceb61b0996ae7e1df5391ff007466949f8",
                "md5": "c34e7fc8b6308237a1435f2a162a5392",
                "sha256": "e9c0fae7fb7d136241f75fdb9dd4488112e96297a8019d4ddf2463aa76f231a1"
            },
            "downloads": -1,
            "filename": "lithophane-1.0.14.tar.gz",
            "has_sig": false,
            "md5_digest": "c34e7fc8b6308237a1435f2a162a5392",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 8320,
            "upload_time": "2023-12-16T20:22:32",
            "upload_time_iso_8601": "2023-12-16T20:22:32.786846Z",
            "url": "https://files.pythonhosted.org/packages/38/21/1f6b519b797a3216a336867a93ceb61b0996ae7e1df5391ff007466949f8/lithophane-1.0.14.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-16 20:22:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "robbyHuelsi",
    "github_project": "lithophane",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "lithophane"
}
        
Elapsed time: 0.15029s