Blender node-based slicer
The silhouette detection was using 2D orientation (CCW/CW in XY projection) which fails for faces perpendicular to the view direction. When a face's normal is parallel to the Z-axis (truly perpendicular to top-down view), the 2D cross product becomes zero and the face is neither CCW nor CW. This fix replaces the 2D orientation approach with 3D normal-based detection: - Categorize faces by the sign of normal.z: - normal.z < 0: front-facing (visible from top) - normal.z > 0: back-facing (not visible) - normal.z == 0: vertical/edge-on - An edge is a silhouette if adjacent faces have different categories This correctly detects silhouette edges for: - Front-facing + back-facing faces - Front-facing + vertical faces - Back-facing + vertical faces Affects: extract_silhouette_contour_edges() and extract_lineart_edges() Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai> |
||
|---|---|---|
| core | ||
| doc | ||
| fonts | ||
| gcode_snippets | ||
| infra | ||
| profiles/prusaslicer | ||
| property_groups | ||
| tests | ||
| ui | ||
| wheels | ||
| .antigravity.md | ||
| .gitignore | ||
| .python-version | ||
| __init__.py | ||
| AGENTS.md | ||
| blender_manifest.toml | ||
| build.sh | ||
| GEMINI.md | ||
| nodes.blend | ||
| pyproject.toml | ||
| README.md | ||
| registry.py | ||
| test.bgcode | ||
| uv.lock | ||
NodeSlicer
NodeSlicer is a high-performance Blender extension that provides a custom node-based interface for mesh slicing and G-code generation. By using NumPy for geometry processing and Pyclipper for robust 2D polygon operations, it offers a flexible and extensible workflow for 3D printing, CNC toolpathing, and procedural geometry tasks.
Key Features
- Custom Node Editor: A dedicated node tree type (
NodeSlicer Tree) for slicing workflows. - Fast Geometry Processing: Vectorized mesh operations using NumPy and robust 2D geometry manipulation via Pyclipper.
- G-code Lifecycle: Direct conversion of 2D contours (toolpaths) into G-code, with support for loading, joining, and exporting G-code.
- Advanced Slicing:
- Shell Slicing: Accurate Z-layer extraction.
- Buffered Offsetting: Layer-independent offsetting with support for Euler rotations (tilted/non-planar offsetting).
- Consistent Infill: Cross-hatch grid infill that maintains alignment across layers and supports degree-based rotation.
- Boolean Slices: Union, Intersection, and Difference operations on slice boundaries.
- Visual Preview: Built-in G-code to Mesh conversion with automated Geometry Nodes integration ("Nonplanar Slicing Preview") for high-quality viewport feedback.
Installation
Requirements
- Blender 3.6 or newer.
- Dependencies:
numpy,pyclipper. (Included in thewheels/directory or managed viauv).
Setup
- Download or clone this repository.
- In Blender, install as an addon by pointing to the directory or zip.
- Ensure the dependencies are available in your Blender Python environment.
Workflow
- Initialize: Open the Node Editor and switch the tree type to NodeSlicer Tree.
- Import: Use a Get Mesh node to bring a Blender object into the slicing engine.
- Slice: Use Slice Shells to generate layer boundaries.
- Process:
- Add perimeters with Buffer Shells.
- Add internal structure with the Infill node.
- Combine or modify paths using Join Paths or Boolean Paths.
- Generate: Convert paths to G-code using Paths to Gcode.
- Export & Preview: Use Gcode To File to save the result, and Gcode to Preview Mesh to visualize the final toolpaths in the viewport.
Documentation
For detailed information on nodes and modules, see:
- User Guide - Start here!
- Node & Socket Reference
- Module Architecture
- Project Overview
License
This project is licensed under the GPL-3.0-or-later license.