Skip to content

Commit

Permalink
[Internal Templates][Added] 4 templates for simple 3D render using Bl…
Browse files Browse the repository at this point in the history
…ender
  • Loading branch information
set-soft committed Sep 8, 2023
1 parent 6c2ec77 commit e88df7f
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
27 changes: 27 additions & 0 deletions docs/source/configuration/imports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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:

Expand Down
32 changes: 32 additions & 0 deletions kibot/resources/config_templates/3DRender.kibot.yaml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions kibot/resources/config_templates/3DRender_bottom.kibot.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Blender 3D render
kibot:
version: 1

import:
- file: 3DRender
definitions:
_KIBOT_IMPORT_ID: '_bottom_straight'
_KIBOT_3D_VIEW: bottom
10 changes: 10 additions & 0 deletions kibot/resources/config_templates/3DRender_top.kibot.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Blender 3D render
kibot:
version: 1

import:
- file: 3DRender
definitions:
_KIBOT_IMPORT_ID: '_top_straight'

0 comments on commit e88df7f

Please sign in to comment.