Programatic SVG creation for laser engraving

I want to laser engrave a large clock face something like this;

But I drew that one with Python code that looks like this (this is just a small part of the code);

for x in range(1, 8, 1):
    degrees = (x * 45) + solarOffset
    clockCircle = size * .9
    Line(center, center, center-math.sin(math.radians(degrees))*size*.8, center+math.cos(math.radians(degrees))*size*.8, dashes=True)


for x in range(1, 25, 1):
    degrees = (x * 15) + solarOffset
    clockCircle = size * .87
    Label(x, center-math.sin(math.radians(degrees))*clockCircle, center+math.cos(math.radians(degrees))*clockCircle)

But there’s 2 problems.

  1. I can’t export it from the Python online editor I’m using
  2. The Python program doesn’t have any options on the font for the numbers

I installed Gimp on my Macbook, but there’s a pretty big learning curve and I’m not sure if it’s really a good tool for something like this. I really want pretty good accuracy on this since it’s a clock. Any suggestions?

1 Like

Given the visual result of your coding, I’d think it’d be easy to recreate in Lightburn.
The key feature to making this statement preposterous is called Circle Arrays.
When you break it down, it’s essentially a circle and circle arrays around an axis.

Check out this tutorial:

1 Like

Which online editor are you using? Are you comfortable coding locally and using libraries/packages?

Since you already know python it might be easier to find a library which outputs your design to an SVG or EPS or something. Wish I had a better answer, but it’s definitely doable with just python since you’ve already achieved the hard part.

1 Like

@DanHawn I used the Python editor on https://academy.cs.cmu.edu/ (I was co-teaching Intro to Computer Science in a local high school and it was the tool we used). I think I could potentially change the program to output gcode…

But that LightBurn video that @TravisGood posted really looks like the easy way to go. Thanks Travis! I’m starting the trial on LightBurn now.

2 Likes

2 hours later and TaDa! Oops, but I wanted to make this 46" diameter but now I see;

  • “Tarkin” Custom made 225W Laser Cutter with Ruida controller 63″ x 39″

So I guess it’s going to be about 39" diameter.

4 Likes

hoo dang! that looks even better! way to go @LeeDr !!

1 Like

If the diagonals are important then those can easily be added and precisely rotated.
Capto_Capture 2022-12-07_06-53-02_PM

Congrats, it looks amazing!

1 Like