Skip to content

Commit 0b9ed22

Browse files
Merge pull request #1 from cda-tum/clone-openslaice-from-orig-repo
copied code from original repo
2 parents d432e5e + d40b76b commit 0b9ed22

File tree

74 files changed

+174475
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+174475
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/__pycache__/
2+
**/export/
3+
**/build/

ATTRIBUTION.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Attribution for Included STL Files
2+
3+
The following STL files are included in this repository under the Creative Commons Attribution 4.0 International License (CC BY 4.0):
4+
5+
1. **mixer.stl**
6+
- **Author**: Mohamed Yafia & Oriol Ymbern
7+
- **Source**: [[Printables](https://www.printables.com/model/863725-embedded-microfluidic-mixer)]
8+
- **License**: Creative Commons Attribution 4.0 International (CC BY 4.0)
9+
10+
2. **ELISA_chip.stl**
11+
- **Author**: Mohamed Yafia & Oriol Ymbern
12+
- **Source**: [[Printables](https://www.printables.com/model/863723-microfluidic-elisa-chip)]
13+
- **License**: Creative Commons Attribution 4.0 International (CC BY 4.0)
14+
15+
For more details on the license, see [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/).
16+
17+
---
18+
19+
All other files in this repository are licensed under the MIT License unless otherwise noted.

OpenSLAice.ipynb

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "ac3a86a4",
6+
"metadata": {},
7+
"source": [
8+
"### Needed imports"
9+
]
10+
},
11+
{
12+
"cell_type": "code",
13+
"execution_count": null,
14+
"id": "afc55f24",
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"import sys\n",
19+
"import os\n",
20+
"import numpy as np\n",
21+
"\n",
22+
"# Add the project root directory to Python path\n",
23+
"project_root = os.path.dirname(os.path.abspath(os.getcwd()))\n",
24+
"if project_root not in sys.path:\n",
25+
" sys.path.append(project_root)\n",
26+
"\n",
27+
"import src.slicer.resins\n",
28+
"import src.slicer.printers\n",
29+
"from src.slicer.core.printer import PrinterRegistry\n",
30+
"from src.slicer.core.resin import ResinRegistry\n",
31+
"from src.slicer.core.slicer import Slicer, ParameterMode\n",
32+
"from src.slicer.calibration.calibration import create_calibration_print\n"
33+
]
34+
},
35+
{
36+
"cell_type": "markdown",
37+
"id": "aa633e0b",
38+
"metadata": {},
39+
"source": [
40+
"### Test Calibration print\n",
41+
"\n",
42+
"change the exposuretimes to the values you want to test for the 8 test samples"
43+
]
44+
},
45+
{
46+
"cell_type": "code",
47+
"execution_count": null,
48+
"id": "5e59aa94",
49+
"metadata": {},
50+
"outputs": [],
51+
"source": [
52+
"printer = PrinterRegistry.get(\"Anycubic Mono4 Ultra\")\n",
53+
"resin = ResinRegistry.get(\"Resin for Calibration\")\n",
54+
"export_path = \"/home/benni/Documents/Repos/MF-SLA-Slicer/src/slicer/export/\"\n",
55+
"exp_test_start = 4.0\n",
56+
"exp_test_steps = 0.6\n",
57+
"exp_to_test = []\n",
58+
"for i in range(8):\n",
59+
" exp_to_test.append(round(exp_test_start + i * exp_test_steps, 2))\n",
60+
"exp_to_test = exp_to_test[::-1] # Reverse the list to start with the lowest exposure time\n",
61+
"print(exp_to_test)\n",
62+
"\n",
63+
"create_calibration_print(\n",
64+
" printer=printer,\n",
65+
" resin=resin,\n",
66+
" export_path=export_path,\n",
67+
" layer_height=0.05,\n",
68+
" exp_time_base=4.5,\n",
69+
" exp_times_to_test=exp_to_test,\n",
70+
" exp_time_first_layers=40.0,\n",
71+
" first_layers=5\n",
72+
")"
73+
]
74+
},
75+
{
76+
"cell_type": "markdown",
77+
"id": "a0292d48",
78+
"metadata": {},
79+
"source": [
80+
"### Test Slice\n",
81+
"1. choose one of the example stls and use the path variable in the function `add_input_file`\n",
82+
"2. change the file name and the path where the file is stored in the function `save` acording to your needs\n",
83+
"3. run the code"
84+
]
85+
},
86+
{
87+
"cell_type": "code",
88+
"execution_count": null,
89+
"id": "66a0e921",
90+
"metadata": {},
91+
"outputs": [],
92+
"source": [
93+
"spheroid = \"./examples/stls/spheroid_vsmall.stl\"\n",
94+
"mixer = \"./examples/stls/mixer.stl\"\n",
95+
"elisa = \"./examples/stls/ELISA_chip.stl\"\n",
96+
"rot_spheroid = \"./examples/stls/spheroid_vsmall_rotated.stl\"\n",
97+
"rot_mixer = \"./examples/stls/mixer_rotated.stl\"\n",
98+
"rot_elisa = \"./examples/stls/elisa_rotated.stl\"\n",
99+
"docking_plate_subsection = \"/home/benni/Downloads/docking_plate_subsection.stl\"\n",
100+
"\n",
101+
"printer = PrinterRegistry.get(\"Anycubic Mono4 Ultra\")\n",
102+
"resin = ResinRegistry.get(\"Anycubic Standard Clear\")\n",
103+
"\n",
104+
"mf_sla_slicer = Slicer(printer=printer, resin=resin)\n",
105+
"mf_sla_slicer.add_input_file(spheroid)\n",
106+
"mf_sla_slicer.auto_orientation()\n",
107+
"\n",
108+
"\n",
109+
"mf_sla_slicer.auto_arrange(2)\n",
110+
"#mf_sla_slicer.stls[0].set_position_mm(0.5, 12.0)\n",
111+
"mf_sla_slicer.set_layer_height_method(ParameterMode.AUTO)\n",
112+
"mf_sla_slicer.set_forced_layer_height(0.02)\n",
113+
"mf_sla_slicer.slice_all()\n",
114+
"mf_sla_slicer.rasterize(255)\n",
115+
"mf_sla_slicer.save(\"spheroid\", \"/home/benni/Downloads\")"
116+
]
117+
}
118+
],
119+
"metadata": {
120+
"kernelspec": {
121+
"display_name": ".venv",
122+
"language": "python",
123+
"name": "python3"
124+
},
125+
"language_info": {
126+
"codemirror_mode": {
127+
"name": "ipython",
128+
"version": 3
129+
},
130+
"file_extension": ".py",
131+
"mimetype": "text/x-python",
132+
"name": "python",
133+
"nbconvert_exporter": "python",
134+
"pygments_lexer": "ipython3",
135+
"version": "3.13.5"
136+
}
137+
},
138+
"nbformat": 4,
139+
"nbformat_minor": 5
140+
}

README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<div align="center">
2+
3+
# OpenSLAice
4+
5+
**A specialized slicer for microfluidic SLA/mSLA 3D printing**
6+
7+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
8+
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
9+
10+
</div>
11+
12+
## Overview
13+
14+
OpenSLAice is a specialized slicer for microfluidic SLA/mSLA 3D printing, developed as part of a bachelor thesis project. It addresses the unique challenges of printing microfluidic devices with high precision and reliability.
15+
16+
### Key Innovations
17+
18+
1. **Physical Model-Based Calibration**: Single-print calibration method that predicts exposure times for arbitrary layer heights based on a physical model of light penetration.
19+
20+
2. **Automated Microfluidic Feature Detection**: Automatically detects and orients microfluidic features to minimize stair-stepping artifacts, resulting in smoother channel walls.
21+
22+
3. **Dynamic Layer Height Selection**: Intelligently balances print quality with speed by varying layer heights throughout the print - using fine layers for precise channels and thicker layers for stable channel top layers.
23+
24+
## Getting Started
25+
26+
### Prerequisites
27+
28+
- Python 3.9+
29+
- Jupyter Notebook
30+
31+
### Installation dependencies:
32+
33+
```bash
34+
pip install -r requirements.txt
35+
```
36+
37+
### Usage
38+
39+
#### Main Application
40+
41+
Open the main Jupyter notebook `OpenSLAice.ipynb` to access a simple example for how to use OpenSLAice.
42+
43+
#### Exposure Calibration
44+
45+
A specialized notebook is available for calibrating exposure `exp_calibration.ipynb`.
46+
47+
This notebook determine the needed resin model parameter used in the physical model for exposure time prediction. With these parameters and some metadata you can add any resin to the OpenSLAice database and use it for printing.
48+
49+
## Irradiance Measurements
50+
51+
The currently used resin parameters are where calibrated using the Anycubic Mono 4 Ultra with a measured irradiance of 1938.24 μW/cm² at 400nm at the FEP film.
52+
To ensure accurate exposure times across different printers, an irradiance sensor is provided to reuse the physical model.
53+
54+
In the `irradiance_sensor` directory, you'll find resources for building and using an irradiance sensor:
55+
56+
- **KiCad PCB Design**: Complete PCB design files for building a sensor board
57+
- **Arduino Code**: Firmware for an ESP32-S3 SuperMinni with OPT3002 irradiance sensor
58+
- **Usage Instructions**: How to measure and calibrate UV irradiance for your printer
59+
60+
This sensor allows precise measurement of your printer's light source intensity, enabling reuse of the physical model for exposure time prediction across different printers without needing to recalibrate.
61+
62+
## Project Structure
63+
64+
```
65+
OpenSLAice/
66+
├── examples/ # Example STL files and projects
67+
│ ├── stls/ # Directory for STL files
68+
│ │ ├── mixer.stl # Example mixer STL
69+
│ │ └── ELISA_chip.stl # Example ELISA chip STL
70+
│ └── ... # Other example projects
71+
├── irradiance_sensor/ # Resources for irradiance sensor
72+
│ ├── firmware/ # ESP32-S3 firmware for sensor
73+
│ ├── kicad_pcb/ # KiCad PCB design files
74+
│ └── README.md # Sensor usage instructions
75+
├── OpenSLAice.ipynb # Main Jupyter notebook for OpenSLAice
76+
├── exp_calibration.ipynb # Jupyter notebook for exposure calibration
77+
├── requirements.txt # Python package dependencies
78+
└── README.md # Project overview and documentation
79+
```
80+
81+
## Licensing
82+
83+
This repository is licensed under the MIT License. However, the following STL files are included under the Creative Commons Attribution 4.0 International License (CC BY 4.0):
84+
85+
- `examples/stls/mixer.stl`
86+
- `examples/stls/ELISA_chip.stl`
87+
88+
See the [ATTRIBUTION.md](ATTRIBUTION.md) file for details.

examples/stls/ELISA_chip.stl

409 KB
Binary file not shown.
409 KB
Binary file not shown.
120 KB
Binary file not shown.
105 KB
Binary file not shown.

examples/stls/mixer.stl

120 KB
Binary file not shown.

examples/stls/spheroid_vsmall.stl

105 KB
Binary file not shown.

0 commit comments

Comments
 (0)