diff --git a/Readme.md b/Readme.md index d9deaa1..36fb351 100644 --- a/Readme.md +++ b/Readme.md @@ -44,7 +44,7 @@ Using an MSLA (Masked Stereolithography) resin printer for creating PCBs is a te Here is why the **Anycubic Photon Mono 4** specifically is well-suited for this task: **1. Extremely High Resolution (10K Screen)** -The standout feature of this printer is the **10K (9024 x 5120)** resolution on a 7-inch screen. +The standout feature of this printer is the **10K (9024 x 5120)** resolution with a pixel size of 17µm (0.017mm) on a 7-inch screen. * **Why it helps:** In PCB fabrication, resolution dictates how thin your traces can be. A 10K screen provides an exceptionally small pixel pitch. To put this in perspective, this is equivalent to a print resolution of approximately **1500 DPI**. * *Calculation: The screen width is 153.4mm (6.04 inches). 9024 pixels / 6.04 inches ≈ 1494 DPI.* * This allows you to expose traces for fine-pitch SMD components (like TQFP or 0402 packages) with professional-grade sharpness, far exceeding what is possible with inkjet or laser-printed transparencies. @@ -68,9 +68,12 @@ The process involves exporting 2D layer images from your PCB design, converting * Chitubox (or your printer's slicing software) ### Hardware -* A resin 3D printer (e.g., Anycubic Photon Mono 4) -* Photosensitive PCB. For consistent results, a pre-sensitized board like the **Bungard positive photoresist boards** is highly recommended due to its uniform coating. Available on [www.conrad.sk](https://www.conrad.sk/sk/p/bungard-150306e50-100x60mm-zakladny-material-jednostranna-35-m-foto-vrstva-pozitiv-d-x-s-100-mm-x-60-mm-1-ks-525472.html) -* UV light curing Solder Mask e.g. from Mechanic +* A resin 3D printer (e.g., Anycubic Photon Mono 4) + Anycubic Photon Mono 4 +* Photosensitive PCB. For consistent results, a pre-sensitized board like the **Bungard positive photoresist boards** is highly recommended due to its uniform coating. A good example is [Bungard 16x100 double sided](https://www.conrad.sk/sk/p/bungard-120306z33-zakladny-material-dvojstranna-35-m-foto-vrstva-pozitiv-d-x-s-160-mm-x-100-mm-1-ks-529176.html). + Bungard PCB +* UV light curing Solder Mask e.g. from Mechanic. + Mechanic UV Solder Mask ### Installation @@ -93,9 +96,10 @@ This guide was developed to work with Inkscape 1.2.2 and Blender 5.0.0 1. Open your PCB project in the KiCad PCB Editor. 2. Go to **File -> Plot** and select `Plot format` as `SVG` and set the `Output directory`. -3. In the `Include Layers` section select one layer (e.g. `F.Cu`, `F.Mask` or `F.Silkscreen`). If you select multiple layers they will be ploted as separate files. -4. Optionaly, select additional layer(s) e.g. `Edge.Cuts` in the `Plot on All Layers` section. This way you can merge layers (e.g. front copper layer with board outset) into a single svg file. -5. Click **Plot** and **Close**. +3. In the `Include Layers` section select layers `B.Cu`, `B.Mask` and `F.Silkscreen`. Each layer will be ploted as a separate SVG file. +4. Optionaly, select additional layer(s) e.g. `Edge.Cuts` in the `Plot on All Layers` section. This way you can merge layers i.e. add board outset into each file generated. +5. Click **Plot** and **Close**. + KiCad KiCad Plot ### 2. SVG to STL Conversion @@ -212,7 +216,6 @@ THICKNESS_MM="0.1" EXPORT_DPI=1494 ``` - **Usage:** ```bash ./svg2stl.sh my_design.svg @@ -253,7 +256,8 @@ Since the minimum exposure time per layer is 0.1s and maximum 200s, calculate th * **Normal Exposure Time:** `200 s` (This will apply to the 3 normal layers, giving 3*200 = 600s total). 4. **Crucially, turn off Anti-aliasing**. Go to the "Advanced" tab and set **Anti-aliasing**. This ensures the sharpest possible pixels for crisp traces. -5. Slice the model and save the file to the USB drive. +5. Slice the model and save the file to the USB drive. + Chitubox ### 4. Exposing the Board diff --git a/example/Anycubic_Photon_Mono_4_profile_00.cfgx b/assets/Anycubic_Photon_Mono_4_profile_00.cfgx similarity index 100% rename from example/Anycubic_Photon_Mono_4_profile_00.cfgx rename to assets/Anycubic_Photon_Mono_4_profile_00.cfgx diff --git a/examples/Step_Down_Carrier_Board-B_Cu.stl b/examples/Step_Down_Carrier_Board-B_Cu.stl new file mode 100644 index 0000000..4121b74 Binary files /dev/null and b/examples/Step_Down_Carrier_Board-B_Cu.stl differ diff --git a/examples/Step_Down_Carrier_Board-B_Cu.svg b/examples/Step_Down_Carrier_Board-B_Cu.svg new file mode 100644 index 0000000..580dbd4 --- /dev/null +++ b/examples/Step_Down_Carrier_Board-B_Cu.svg @@ -0,0 +1,1146 @@ + + + +SVG Image created as Step_Down_Carrier_Board-B_Cu.svg date 2025/11/28 15:32:38 + Image generated by PCBNEW + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/Step_Down_Carrier_Board-B_Mask.stl b/examples/Step_Down_Carrier_Board-B_Mask.stl new file mode 100644 index 0000000..7221b0b Binary files /dev/null and b/examples/Step_Down_Carrier_Board-B_Mask.stl differ diff --git a/examples/Step_Down_Carrier_Board-B_Mask.svg b/examples/Step_Down_Carrier_Board-B_Mask.svg new file mode 100644 index 0000000..5568365 --- /dev/null +++ b/examples/Step_Down_Carrier_Board-B_Mask.svg @@ -0,0 +1,143 @@ + + + +SVG Image created as Step_Down_Carrier_Board-B_Mask.svg date 2025/11/28 15:32:38 + Image generated by PCBNEW + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/Step_Down_Carrier_Board.stl b/examples/Step_Down_Carrier_Board-F_Silkscreen.stl similarity index 64% rename from example/Step_Down_Carrier_Board.stl rename to examples/Step_Down_Carrier_Board-F_Silkscreen.stl index 176c568..da66698 100644 Binary files a/example/Step_Down_Carrier_Board.stl and b/examples/Step_Down_Carrier_Board-F_Silkscreen.stl differ diff --git a/example/Step_Down_Carrier_Board.stl_0.05_0.1.pm4n b/examples/Step_Down_Carrier_Board-F_Silkscreen.stl_0.05_200_2025_11_28_16_45_00.pm4n similarity index 55% rename from example/Step_Down_Carrier_Board.stl_0.05_0.1.pm4n rename to examples/Step_Down_Carrier_Board-F_Silkscreen.stl_0.05_200_2025_11_28_16_45_00.pm4n index ffd017f..c7fa2ef 100644 Binary files a/example/Step_Down_Carrier_Board.stl_0.05_0.1.pm4n and b/examples/Step_Down_Carrier_Board-F_Silkscreen.stl_0.05_200_2025_11_28_16_45_00.pm4n differ diff --git a/example/Step_Down_Carrier_Board.svg b/examples/Step_Down_Carrier_Board-F_Silkscreen.svg similarity index 86% rename from example/Step_Down_Carrier_Board.svg rename to examples/Step_Down_Carrier_Board-F_Silkscreen.svg index b24a261..5d1213a 100644 --- a/example/Step_Down_Carrier_Board.svg +++ b/examples/Step_Down_Carrier_Board-F_Silkscreen.svg @@ -7,7 +7,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="297.0022mm" height="210.0072mm" viewBox="0.0000 0.0000 297.0022 210.0072"> -SVG Image created as Step_Down_Carrier_Board-F_Silkscreen.svg date 2025/11/27 14:53:26 +SVG Image created as Step_Down_Carrier_Board-F_Silkscreen.svg date 2025/11/28 15:32:38 Image generated by PCBNEW - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " +# Check for at least one input file +if [ "$#" -lt 1 ]; then + echo "Error: No input files provided." + echo "Usage: ./svg2stl.sh [file2.svg ...]" exit 1 fi -# 2. Setup Absolute Paths -INPUT_FILE="$(readlink -f "$1")" -WORK_DIR="$(dirname "$INPUT_FILE")" -BASENAME="$(basename "$INPUT_FILE" .svg)" -TEMP_SVG="$WORK_DIR/${BASENAME}_temp_processed.svg" -OUTPUT_STL="$WORK_DIR/$BASENAME.stl" +# Loop over all input files +for INPUT in "$@"; do + INPUT_FILE="$(readlink -f "$INPUT")" -# 3. Inkscape Processing -# Note: We do NOT resize here. We export high-res geometry and resize in Blender. -ACTIONS="select-by-element:text;delete;select-all;object-stroke-to-path;path-union;export-plain-svg;export-filename:$TEMP_SVG;export-do" -INK_ARGS="--export-dpi=$EXPORT_DPI --actions=$ACTIONS" + echo "Processing: $INPUT_FILE" -echo "------------------------------------------------" -echo "Step 1: Inkscape Processing" -echo "Input: $INPUT_FILE" -echo "------------------------------------------------" + # Setup Absolute Paths + WORK_DIR="$(dirname "$INPUT_FILE")" + BASENAME="$(basename "$INPUT_FILE" .svg)" + TEMP_SVG="$WORK_DIR/${BASENAME}_temp_processed.svg" + OUTPUT_STL="$WORK_DIR/$BASENAME.stl" -inkscape "$INPUT_FILE" $INK_ARGS + # Inkscape Processing + # Note: We do NOT resize here. We export high-res geometry and resize in Blender. + ACTIONS="select-by-element:text;delete;select-all;object-stroke-to-path;path-union;export-plain-svg;export-filename:$TEMP_SVG;export-do" + INK_ARGS="--export-dpi=$EXPORT_DPI --actions=$ACTIONS" -if [ ! -f "$TEMP_SVG" ]; then - echo "ERROR: Inkscape failed to create the temp file." - exit 1 -fi + echo "------------------------------------------------" + echo "Step 1: Inkscape Processing" + echo "Input: $INPUT_FILE" + echo "------------------------------------------------" -echo "------------------------------------------------" -echo "Step 2: Blender Processing" -echo "Target Width: ${TARGET_WIDTH_MM} mm" -echo "Target Thickness: ${THICKNESS_MM} mm" -echo "------------------------------------------------" + inkscape "$INPUT_FILE" $INK_ARGS -# Pass Width and Thickness to Python -blender --background --python pcb_to_stl.py -- "$TEMP_SVG" "$OUTPUT_STL" "$THICKNESS_MM" "$TARGET_WIDTH_MM" + if [ ! -f "$TEMP_SVG" ]; then + echo "ERROR: Inkscape failed to create the temp file." + exit 1 + fi -# 4. Cleanup -rm "$TEMP_SVG" -echo "Done! Saved to $OUTPUT_STL" \ No newline at end of file + echo "------------------------------------------------" + echo "Step 2: Blender Processing" + echo "Target Width: ${TARGET_WIDTH_MM} mm" + echo "Target Thickness: ${THICKNESS_MM} mm" + echo "------------------------------------------------" + + # Pass Width and Thickness to Python + blender --background --python pcb_to_stl.py -- "$TEMP_SVG" "$OUTPUT_STL" "$THICKNESS_MM" "$TARGET_WIDTH_MM" + + # Cleanup + rm "$TEMP_SVG" + echo "Done! Saved to $OUTPUT_STL" + # --------------------- +done \ No newline at end of file