Skip to content

Commit

Permalink
Merge pull request pppalain#235 from SpectralVectors/master
Browse files Browse the repository at this point in the history
Custom Cutter Icons and README updates
  • Loading branch information
SpectralVectors authored Jan 22, 2025
2 parents bdda204 + 0a9a4a9 commit 22aea06
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 54 deletions.
113 changes: 62 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

- - -

### [About](#About)[How to Use](#-how-to-use-wiki)[Features](#-features)[Post-Processors](#-post-processors)[Files](#-files-organisation)[Contribute](#-contribute)[License](#-license)[Disclaimer](#-disclaimer)
### [About](#-about)[How to Use](#-how-to-use-wiki)[Features](#-features)[Post-Processors](#-post-processors)[Files](#-files-organisation)[Contribute](#-contribute)[License](#-license)[Disclaimer](#-disclaimer)

- - -

Expand All @@ -28,8 +28,9 @@
</div>

## 👁️ About
[**Fabex CNC CAM extension for Blender**](https://blendercam.com/) is an open source solution for artistic, personal, commercial or industrial CAM - Computer aided machining - a g-code generation tool. It was called Blendercam but the name Blender can no longer be used in the name due to Trademark.
[**Fabex CNC CAM extension for Blender**](https://blendercam.com/) is an open source solution for artistic, personal, commercial or industrial CAM - Computer aided machining - a G-code generation tool.

Formerly known as BlenderCAM, the Blender Foundation has requested that external projects no longer use the name Blender due to Trademark, so it was renamed **Fabex**!

It has been used for many milling projects _(artistic, personal, commercial and industrial)_ since its creation in 2012, and is actively developed.

Expand All @@ -38,7 +39,7 @@ It has been used for many milling projects _(artistic, personal, commercial and
## 👨‍🎓 How to Use (Wiki)

![Linux](https://img.shields.io/badge/Plateform-Linux%20|%20MacOS%20|%20Windows-brightgreen.svg)
![Linux](https://img.shields.io/badge/Platform-Linux%20|%20MacOS%20|%20Windows-brightgreen.svg)

Fabex CNC CAM extension for Blender (formerly Blendercam) works on Windows or Linux and MacOS.

Expand All @@ -51,66 +52,76 @@ Fabex CNC CAM extension for Blender (formerly Blendercam) works on Windows or Li
(The full [documentation](https://blendercam.com/documentation/) can also be found on the website)
## 👌 Features

| | Blender from 4.2.1
| -------------------------- | :----------------: |
| Several Milling Strategies for 2D and 3D | ✔️ |
| Cutter Types: Ball, Ballcone, Endmill Flat, V-Carve _(various angles)_, User Defined | ✔️ |
| Work with 3D Data or Depth Images | ✔️ |
| Layers and Skin for Roughing | ✔️ |
| Inverse Milling | ✔️ |
| Various Options for Ambient around Model | ✔️ |
| Protection of Vertical Surfaces | ✔️ |
| Stay Low - Option for Movement | ✔️ |
| Material Size Setup | ✔️ |
| Simulation of 3D Operations | ✔️ |
| Arc Retract | ✔️ |
| Pack Curves and Slice Model | ✔️ |
| Automatic Bridges for Cutout Operation | ✔️ |
| Chain Export and Simulation | ✔️ |
| Adaptive milling speed | ✔️ |

### Pending Features
* Helix entry and ramp down are experimental.
* 4 and 5 axis milling are only manual
| _Feature_ | _Description_ | _Status_ |
| ---: | :--- | :---: |
| **2D & 3D Milling Strategies** | _Profile, Pocket, Drill, Parallel, Cross, Block, Spiral, Medial Axis and more_ ||
| **Cutter Types** | _Ballnose, Ballcone, Bullnose, Flat Endmill, V-Carve, User Defined and more_ ||
| **3D Data or 2D Images** | _Model in Blender, or import 3D objects or b/w images, and generate toolpaths_ ||
| **Layers & Skin** | _Leave material during Roughing to ensure that your Finishing passes have enough to work with_ ||
| **Inverse Milling** | _Cut an inverted piece for joinery, e.g. Male to Female connector_ ||
| **Ambient Around Model** | _Restrict Cutter to specified radius around the model_ ||
| **Protect Vertical Surfaces** | _Cutter moves vertically next to surfaces greater than a threshold angle_ ||
| **Stay Low** | _Keeps the Cutter low, if possible, to reduce travel time_ ||
| **Stock Material Setup** | _Enter material dimensions & location, or get them from your 3D model_ ||
| **Operation Simulations** | _Use toolpaths to generate a 3D mesh simulation of your finished product_ ||
| **Arc Retract** | _Retracts cutter in an arc, rather than straight lines to reduce travel time_ ||
| **Pack Curves** | _Arrange selected curves to fit on a plywood sheet for bulk cutting_ ||
| **Slice Model** | _Vertically slices model into a series of curves to be cut and stacked to recreate the 3D shape_ ||
| **Automatic Bridges** | _One click to add Bridges/Tabs to keep your work in place during Cutout Operations_ ||
| **Chain Operations** | _Combine multiple CAM operations into a Chain, Export as Gcode, or create a Chain Simulation_ ||
| **Adaptive Milling Speed** | _Adjusts the operation feedrate relative to the chipload calculation_ ||
| :warning: **Helix Entry**:warning: | _EXPERIMENTAL - Available in the Extension, but not yet fully supported_ ||
| :warning: **Ramp Down** :warning: | _EXPERIMENTAL - Available in the Extension, but not yet fully supported_ ||
| :warning: **4 Axis Milling** :warning: | _Currently only possible via manual indexing_ ||
| :warning: **5 axis Milling** :warning: | _Currently only possible via manual indexing_ ||

> [!NOTE]
> _All features listed above are for Blender 4.2.1 and up. For previous versions of Blender, check the Releases page._
## 💻 Post-processors
* GRBL
* Iso
* LinuxCNC - EMC2
* Fadal
* Heidenhain
* Sieg KX1
* [GRBL](https://github.com/gnea/grbl/wiki)
* [ISO](https://www.iso.org/obp/ui/#iso:std:iso:4343:ed-2:v1:en)
* [LinuxCNC - EMC2](https://linuxcnc.org/)
* [Fadal](https://fadal.com/)
* [Heidenhain](https://www.heidenhain.com/)
* [Sieg KX1](https://www.sieg.co.za/)
* Hafco HM-50
* Centroïd M40
* [Centroïd M40](https://www.centroidcnc.com/)
* Anilam Crusader M
* Gravos
* WinPC-NC
* ShopBot MTC
* Lynx Otter o
* [Gravos](https://www.gravos.cz/)
* [WinPC-NC](https://www.lewetz.de/de/)
* [ShopBot MTC](https://shopbottools.com/)
* [Lynx Otter o](https://lynx-poland.com/)
* ...


## 📒 Files Organisation

```graphql
.
├── config - # 'startup' and 'userpref' blend files
├── documentation - # How to Use (Wiki) - files
├── Examples - # Bas Relief & Intarsion operation demo files and images
├── scripts
│   └── addons
│      └── cam - # Main Addon Folder
│         ├── nc - # Post-Processors
│         ├── opencamlib - # OpenCAMLib functions
│    ├── presets - # Quick access to pre-defined cutting tools, machines and operations
│    │ ├── cam_cutters
│    │ ├── cam_machines
│    │ └── cam_operations
│ ├── tests - # Developer Tests
│ │ └── test_data - # Test output
│ └── ui_panels - # User Interface
└── static - # Logo
├── config/ - # 'startup' and 'userpref' blend files
├── documentation/ - # How to Use (Wiki) - files
├── Examples/ - # Bas Relief & Intarsion operation demo files and images
├── scripts/
│ └── addons/
│ └── cam/ - # Main Addon Folder
│ ├── operators/ - # Blender Operators
│ ├── post_processors/ - # CAM Post-Processors
│ ├── presets/ - # Quick access to pre-defined cutting tools, machines and operations
│ │ ├── cam_cutters/
│ │ ├── cam_machines/
│ │ └── cam_operations/
│ ├── properties/ - # Blender PropertyGroups to store Machine, Operation, Cutter data
│ ├── tests/ - # Developer Tests
│ │ └── test_data/ - # Test output
│ ├── ui/ - # Blender User Interface
│ │ ├── icons/ - # .png files for custom icons
│ │ ├── menus/
│ │ ├── panels/
│ │ └── pie_menu/
│ ├── utilities/ - # Low level helper functions
│ └── wheels/ - # Python Dependencies (as binary wheels)
└── static/ - # Logo

```

Expand Down
18 changes: 16 additions & 2 deletions scripts/addons/cam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
register as ui_register,
unregister as ui_unregister,
)
from .ui.icons import (
register as icons_register,
unregister as icons_unregister,
)
from .utilities.addon_utils import (
on_blender_startup,
keymap_register,
Expand All @@ -49,9 +53,12 @@


def register() -> None:
# Register classes from the list above
for cls in classes:
bpy.utils.register_class(cls)

# Import and run the Register functions of the submodules
icons_register()
props_register()
ops_register()
ui_register()
Expand All @@ -60,22 +67,25 @@ def register() -> None:
# CAM_OPERATION_Properties - last to allow dependencies to register before it
bpy.utils.register_class(CAM_OPERATION_Properties)

# Store a reference to the CAM Operation Properties in the Scene so it can be easily accessed
bpy.types.Scene.cam_operations = CollectionProperty(type=CAM_OPERATION_Properties)

# Use the Message Bus to notify when the Render Engine is changed
# And run the 'on_engine_change' function
bpy.types.Scene.engine_check = object()

subscribe_to = bpy.types.RenderSettings, "engine"

bpy.msgbus.subscribe_rna(
key=subscribe_to,
owner=bpy.types.Scene.engine_check,
args=(),
notify=on_engine_change,
)

# Get all the compatible UI panels, as defined in 'engine.py'
for panel in get_panels():
panel.COMPAT_ENGINES.add("FABEX_RENDER")

# Adding Application Handlers to run functions after certain events
bpy.app.handlers.frame_change_pre.append(timer_update)
bpy.app.handlers.load_post.append(on_blender_startup)

Expand All @@ -84,6 +94,7 @@ def unregister() -> None:
for cls in classes:
bpy.utils.unregister_class(cls)

icons_unregister()
ui_unregister()
ops_unregister()
props_unregister()
Expand All @@ -96,3 +107,6 @@ def unregister() -> None:
for panel in get_panels():
if "FABEX_RENDER" in panel.COMPAT_ENGINES:
panel.COMPAT_ENGINES.remove("FABEX_RENDER")

bpy.app.handlers.frame_change_pre.remove(timer_update)
bpy.app.handlers.load_post.remove(on_blender_startup)
Binary file added scripts/addons/cam/ui/icons/BallconeIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scripts/addons/cam/ui/icons/BallnoseIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scripts/addons/cam/ui/icons/BullnoseIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scripts/addons/cam/ui/icons/CylinderConeIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scripts/addons/cam/ui/icons/EndMillIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scripts/addons/cam/ui/icons/FabexCNC_Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scripts/addons/cam/ui/icons/LaserPlasmaIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scripts/addons/cam/ui/icons/VCarveIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions scripts/addons/cam/ui/icons/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import os
from pathlib import Path

import bpy
import bpy.utils.previews

preview_collections = {}


def register():
icon_images = [
"EndMillIcon",
"BallnoseIcon",
"VCarveIcon",
"CylinderConeIcon",
"LaserPlasmaIcon",
"BullnoseIcon",
"BallconeIcon",
"FabexCNC_Logo",
]

fabex_icons = bpy.utils.previews.new()
icons_dir = Path(__file__).parent
for image in icon_images:
fabex_icons.load(image, os.path.join(icons_dir, f"{image}.png"), "IMAGE")
preview_collections["FABEX"] = fabex_icons


def unregister():

for fabex_icons in preview_collections.values():
bpy.utils.previews.remove(fabex_icons)
preview_collections.clear()
22 changes: 21 additions & 1 deletion scripts/addons/cam/ui/panels/cutter_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from bpy.types import Panel

from .parent_panel import CAMParentPanel
from ..icons import preview_collections


class CAM_CUTTER_Panel(CAMParentPanel, Panel):
Expand All @@ -25,6 +26,19 @@ def draw(self, context):
layout.use_property_split = True
layout.use_property_decorate = False

fabex_icons = preview_collections["FABEX"]
cutter_icons = {
"END": "EndMillIcon",
"BALLNOSE": "BallnoseIcon",
"BULLNOSE": "BullnoseIcon",
"VCARVE": "VCarveIcon",
"BALLCONE": "BallconeIcon",
"CYLCONE": "CylinderConeIcon",
"LASER": "LaserPlasmaIcon",
"PLASMA": "LaserPlasmaIcon",
"CUSTOM": "FabexCNC_Logo",
}

# Cutter Preset Menu
if self.level >= 1:
row = layout.row(align=True)
Expand All @@ -42,8 +56,14 @@ def draw(self, context):

box = layout.box()
col = box.column(align=True)

# Cutter Type
col.prop(self.op, "cutter_type", text="Type")
col.prop(
self.op,
"cutter_type",
text="Type",
icon_value=fabex_icons[cutter_icons[self.op.cutter_type]].icon_id,
)

# Ball Radius
if self.op.cutter_type in ["BALLCONE"]:
Expand Down

0 comments on commit 22aea06

Please sign in to comment.