[Internal Templates][Added] 4 templates for simple 3D render using Blender

This commit is contained in:
Salvador E. Tropea 2023-09-08 13:08:05 -03:00
parent 6c2ec777a3
commit e88df7f595
7 changed files with 100 additions and 0 deletions

View File

@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Global options: - Global options:
- `remove_solder_mask_for_dnp` similar to `remove_solder_paste_for_dnp` but - `remove_solder_mask_for_dnp` similar to `remove_solder_paste_for_dnp` but
applied to the solder mask apertures. (#476) 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: - BoM:
- Support for ${field} expansion. (#471) - Support for ${field} expansion. (#471)
- LCSC links (SchrodingersGat/KiBoM#190) - LCSC links (SchrodingersGat/KiBoM#190)

View File

@ -182,6 +182,22 @@ information consult the :ref:`templates-parameters` section.
Here is a list of currently defined templates and their outputs / groups: 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 - **CheckZoneFill**: enables the ``check_zone_fills`` preflight and checks
the refilled PCB doesnt changed too much. the refilled PCB doesnt changed too much.
@ -322,6 +338,17 @@ CheckZoneFill:
- **_KIBOT_CHKZONE_THRESHOLD**: Maximum pixels difference (default: 100) - **_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. Note that manufacturer templates named *\*_stencil* are created using parameters.
As an example: *Elecrow_stencil* is just *Elecrow* customized like this: As an example: *Elecrow_stencil* is just *Elecrow* customized like this:

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,9 @@
# Blender 3D render
kibot:
version: 1
import:
- file: 3DRender
definitions:
_KIBOT_IMPORT_ID: '_bottom_straight'
_KIBOT_3D_VIEW: bottom

View File

@ -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

View File

@ -0,0 +1,8 @@
# Blender 3D render
kibot:
version: 1
import:
- file: 3DRender
definitions:
_KIBOT_IMPORT_ID: '_top_straight'