From e88df7f595ce0523270d22c40f6c973668ffbe54 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Fri, 8 Sep 2023 13:08:05 -0300 Subject: [PATCH] [Internal Templates][Added] 4 templates for simple 3D render using Blender --- CHANGELOG.md | 3 ++ docs/source/configuration/imports.rst | 27 ++++++++++++++++ .../config_templates/3DRender.kibot.yaml | 32 +++++++++++++++++++ .../3DRender_bottom.kibot.yaml | 11 +++++++ .../3DRender_bottom_straight.kibot.yaml | 9 ++++++ .../config_templates/3DRender_top.kibot.yaml | 10 ++++++ .../3DRender_top_straight.kibot.yaml | 8 +++++ 7 files changed, 100 insertions(+) create mode 100644 kibot/resources/config_templates/3DRender.kibot.yaml create mode 100644 kibot/resources/config_templates/3DRender_bottom.kibot.yaml create mode 100644 kibot/resources/config_templates/3DRender_bottom_straight.kibot.yaml create mode 100644 kibot/resources/config_templates/3DRender_top.kibot.yaml create mode 100644 kibot/resources/config_templates/3DRender_top_straight.kibot.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index e727a13c4..b4f7adff9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Global options: - `remove_solder_mask_for_dnp` similar to `remove_solder_paste_for_dnp` but applied to the solder mask apertures. (#476) +- Internal templates: + - 3DRender_top, 3DRender_top_straight, 3DRender_bottom and + 3DRender_bottom_straight: to generate simple and quick 3D renders. - BoM: - Support for ${field} expansion. (#471) - LCSC links (SchrodingersGat/KiBoM#190) diff --git a/docs/source/configuration/imports.rst b/docs/source/configuration/imports.rst index c70d629ba..a20bf916a 100644 --- a/docs/source/configuration/imports.rst +++ b/docs/source/configuration/imports.rst @@ -182,6 +182,22 @@ information consult the :ref:`templates-parameters` section. Here is a list of currently defined templates and their outputs / groups: +- **3DRender_top**: Creates a top view render using Blender. The PCB is rotated to show it better. + + - **_blender_3d_top**: Generates a PNG rotating (30, 0, -20) degrees the PCB. + +- **3DRender_top_straight**: Creates a top view render using Blender. + + - **_blender_3d_top_straight**: Generates a PNG with the stright top view. + +- **3DRender_bottom**: Creates a bottom view render using Blender. The PCB is rotated to show it better. + + - **_blender_3d_bottom**: Generates a PNG rotating (-30, 0, -20) degrees the PCB. + +- **3DRender_bottom_straight**: Creates a bottom view render using Blender. + + - **_blender_3d_bottom_straight**: Generates a PNG with the stright bottom view. + - **CheckZoneFill**: enables the ``check_zone_fills`` preflight and checks the refilled PCB doesn’t changed too much. @@ -322,6 +338,17 @@ CheckZoneFill: - **_KIBOT_CHKZONE_THRESHOLD**: Maximum pixels difference (default: 100) +3DRender: Is the base for **3DRender_top**, **3DRender_top_straight**, **3DRender_bottom** and **3DRender_bottom_straight** + +- **_KIBOT_IMPORT_ID**: Suffix used for the output (default: '') +- **_KIBOT_IMPORT_DIR**: Target directory for the output (default: 'Render_3D') +- **_KIBOT_3D_VIEW**: View point (default: 'top') +- **_KIBOT_3D_FILE_ID**: Text used to differentiate this view from others (default: **_KIBOT_IMPORT_ID**) +- **_KIBOT_ROT_X**: X axis rotation (default: 0) +- **_KIBOT_ROT_Y**: Y axis rotation (default: 0) +- **_KIBOT_ROT_Z**: Z axis rotation (default: 0) + + Note that manufacturer templates named *\*_stencil* are created using parameters. As an example: *Elecrow_stencil* is just *Elecrow* customized like this: diff --git a/kibot/resources/config_templates/3DRender.kibot.yaml b/kibot/resources/config_templates/3DRender.kibot.yaml new file mode 100644 index 000000000..7749d7925 --- /dev/null +++ b/kibot/resources/config_templates/3DRender.kibot.yaml @@ -0,0 +1,32 @@ +# Blender 3D render +kibot: + version: 1 + +outputs: + - name: _blender_3d@_KIBOT_IMPORT_ID@ + comment: "HQ 3D Render of the PCB" + type: blender_export + dir: @_KIBOT_IMPORT_DIR@ + options: + render_options: + transparent_background: true + samples: 10 + point_of_view: + rotate_x: @_KIBOT_ROT_X@ + rotate_y: @_KIBOT_ROT_Y@ + rotate_z: @_KIBOT_ROT_Z@ + view: @_KIBOT_3D_VIEW@ + file_id: @_KIBOT_3D_FILE_ID@ + outputs: + - type: blender + - type: render + +... +definitions: + _KIBOT_IMPORT_ID: '' + _KIBOT_IMPORT_DIR: 'Render_3D' + _KIBOT_3D_VIEW: top + _KIBOT_3D_FILE_ID: '@_KIBOT_IMPORT_ID@' + _KIBOT_ROT_X: 0 + _KIBOT_ROT_Y: 0 + _KIBOT_ROT_Z: 0 diff --git a/kibot/resources/config_templates/3DRender_bottom.kibot.yaml b/kibot/resources/config_templates/3DRender_bottom.kibot.yaml new file mode 100644 index 000000000..c64f89a92 --- /dev/null +++ b/kibot/resources/config_templates/3DRender_bottom.kibot.yaml @@ -0,0 +1,11 @@ +# Blender 3D render +kibot: + version: 1 + +import: + - file: 3DRender + definitions: + _KIBOT_IMPORT_ID: '_bottom' + _KIBOT_3D_VIEW: bottom + _KIBOT_ROT_Z: -20 + _KIBOT_ROT_X: -30 diff --git a/kibot/resources/config_templates/3DRender_bottom_straight.kibot.yaml b/kibot/resources/config_templates/3DRender_bottom_straight.kibot.yaml new file mode 100644 index 000000000..26e5ea899 --- /dev/null +++ b/kibot/resources/config_templates/3DRender_bottom_straight.kibot.yaml @@ -0,0 +1,9 @@ +# Blender 3D render +kibot: + version: 1 + +import: + - file: 3DRender + definitions: + _KIBOT_IMPORT_ID: '_bottom_straight' + _KIBOT_3D_VIEW: bottom diff --git a/kibot/resources/config_templates/3DRender_top.kibot.yaml b/kibot/resources/config_templates/3DRender_top.kibot.yaml new file mode 100644 index 000000000..9a5fe5d19 --- /dev/null +++ b/kibot/resources/config_templates/3DRender_top.kibot.yaml @@ -0,0 +1,10 @@ +# Blender 3D render +kibot: + version: 1 + +import: + - file: 3DRender + definitions: + _KIBOT_IMPORT_ID: '_top' + _KIBOT_ROT_X: 30 + _KIBOT_ROT_Z: -20 diff --git a/kibot/resources/config_templates/3DRender_top_straight.kibot.yaml b/kibot/resources/config_templates/3DRender_top_straight.kibot.yaml new file mode 100644 index 000000000..61e25242a --- /dev/null +++ b/kibot/resources/config_templates/3DRender_top_straight.kibot.yaml @@ -0,0 +1,8 @@ +# Blender 3D render +kibot: + version: 1 + +import: + - file: 3DRender + definitions: + _KIBOT_IMPORT_ID: '_top_straight'