Engrave line art

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
ehendrix
Posts: 4
Joined: Mon Nov 25, 2019 1:39 am

Engrave line art

Post by ehendrix »

Hello,
I am new to FreeCAD. Surprise!!! :D
I have spent the better part of an hour or two looking for specifically what I want to do and can't seem to find it.
I have attached a sample file and want to learn how to engrave this as well as convert it to G-code for GRBL 3018 CNC mill.
I found a video that I thought would point me in the right direction to get started but the darn thing was in Russian. (Not much help, Dah?)
What I have read in the forums do not seem to be in newby.
If I were to venture a guess a body needs to be created then the image imported and sized to fit to start. Am I close?

Thank you for any assistance.
Eric
Attachments
Unicorn-Heart.jpg
Unicorn-Heart.jpg (79.4 KiB) Viewed 591 times
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Engrave line art

Post by chrisb »

ehendrix wrote: Mon Nov 25, 2019 2:30 am If I were to venture a guess a body needs to be created then the image imported and sized to fit to start. Am I close?
Not really. FreeCAD can very good generate Gcodes for 3D objects, but you want more. You want lots of lines engraved, which have no real volume. Currently The 2D engraving operation cannot handle B-splines correctly, so I would suggest the following. It works not yet in 0.18, so stick to 0.18.4:

- Load your image into Inkscape
- create a path from it (Bitmap to path)
- simplify the path as far as possible
- load the path as svg geometry in FreeCAD
- use the following very simple sketch to convert B-splines to a series of arcs:

Code: Select all

# Use PathUtils for the approxiamtion
''' Apprixamation of wires containing bezier curves by arcs '''

import FreeCAD
import Path
from PathScripts import PathUtils
import Draft

def shape2Sketch(shape):
  # replace shape.edges with arcs
  global test
  newEdges = PathUtils.cleanedges(shape.Edges,1.0)

  wire = Part.Wire([Part.Edge(i) for i in newEdges])

  sketch = Draft.makeSketch(wire,autoconstraints=True,delete=True)
  
selection = FreeCADGui.Selection.getSelectionEx()
for s in selection:
  shape2Sketch(s.Object.Shape)
The second parameter in cleanedges controls the precision (smaller = better approximation)
- create a job with the sketches as BaseObjects
- Select the sketches and create an engraving operation.

You may try to create Gcodes directly from Inkscape. I never tried this myself.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply