Author Topic: First attempt to do 4 axis toolpaths from a 3D model  (Read 51947 times)

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
First attempt to do 4 axis toolpaths from a 3D model
« on: February 16, 2017, 11:43:40 am »
Hello,

I'm playing with VB script to try to do toolpath for 3D models to cut with the 4th axis.

The goal of the script is to "unroll" the 3D model so we get a bunch of polylines.

this polylines are converted to points with the digitize import plugin, then the same plugin is used to do a stl.
http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/Digitizer.html

a 3D machining mop is used to do the toolpath, then the wrapper plugin is used to wrap them for the 4th axis.

some data can be changed in the script in the following section (a little rough ... I write it this night ... no it's coffee time !)

Code: [Select]
'*************************************
dim min as double = 0.1 ' the start and end point of the toolpath (boundaries)
dim max as double = 100
dim ss as double = 25 'stock surface
dim stp as double = 0.5 ' resolution along the axis in current units
'*************************************

min and max values are the boundaries along the rotational axis, here it go from 0.1 to 100mm in Y

ss must be set to the radius of the stock
stp is the distance between the points in the toolpath, in the axial direction.

the script ask for a number of rotational step (60 by default).





It can be very long to compute, depending of the settings for stp and rotational step ... and also depending on the number of triangles of the 3D model.

Enjoy to experiment ;)

a little video that show the workflow and the result (simulation)

https://youtu.be/pBVQY4pFwQo

of course, in further version, I'll try to do the 3D surface without to use the digitize plugin ... and to pluginize the script ;)

++
David
« Last Edit: February 16, 2017, 16:31:25 pm by dh42 »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #1 on: February 16, 2017, 13:19:09 pm »
David,

That is absolutely brilliant !
Watching the stl model rotate as it build the flat version is great, now I must get my 4th axis finished.

... and to pluginize the script ;)

++
David

"pluginize", excellent new word David
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #2 on: February 16, 2017, 13:40:15 pm »
Hello

Quote
Watching the stl model rotate as it build the flat version is great

Yes, I like too, it slow the thing a little, but not too much

There is a timer that give the calculation time in the log windows.

for the venus, resolution 1 and rot step 60 (0.1 to 100 for boundaries)

25.64s with rotation visible during calculation

25.04 if the display is refreshed only at the end (just comment the before-last line)

It would be interesting to see what is the calculation time with a plugin version ...

++
David

Edit: I adds the venus.stl as attachment
« Last Edit: February 16, 2017, 13:42:46 pm by dh42 »

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #3 on: February 16, 2017, 16:35:12 pm »
Re

A more "user friendly" version

Undo is working
All values are taken with a message window (min and max are taken from the model)
Hit ESC to stop calculation

I also add the same as plugin ... and it is not faster than the script  ??? ???

++
David
« Last Edit: February 17, 2017, 00:29:51 am by dh42 »

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #4 on: February 17, 2017, 00:29:33 am »
Re

A new version that do some tests to avoid pb with vertical faces (not always detected)

I tried it (the plugin) on both 0.98 and 1.0, and it is faster on 0.98 ... maybe a different setting somewhere .. ???

PS: only tried with mm at this time ... maybe you will get strange results with inches ... job for another day ;)

++
David
« Last Edit: February 17, 2017, 00:31:15 am by dh42 »

Offline Garyhlucas

  • CNC Jedi
  • *****
  • Posts: 1463
    • View Profile
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #5 on: February 17, 2017, 14:40:45 pm »
David,
This is really amazing work! Combine what you have done with Autodesks 123Catch and you can carve out 3D objects quite easily.
Gary H. Lucas

Have you read my blog?
 http://a-little-business.blogspot.com/

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #6 on: February 17, 2017, 21:40:58 pm »
Hello Gary

Yes but that need to be tested on a real workpiece ; I'm not sure that the tool profile compensation performed on a flat model still match after the model as been wrapped ... no 3D simulator to test that ..

++
David

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3355
    • View Profile
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #7 on: February 17, 2017, 21:48:46 pm »
David,
This is pretty good. Nice work!
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.

Offline BR52

  • Wookie
  • ****
  • Posts: 368
    • View Profile
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #8 on: February 17, 2017, 23:23:32 pm »
Hi David,
The version of my CamBam is "1.0 Rel12" runs on Win10 Pro and on Win7 ultimate.
Problem is that YOUR script does not work and other scripts also do not work.  ???
All script files are unlocked.
The plugins works great.

   Armando

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #9 on: February 17, 2017, 23:56:21 pm »
Hello

Patience .. currently only Python is suported, but VB scripts interpreter will come back soon in CB 1.0 ;) ... and more other nice things !

++
David

Offline BR52

  • Wookie
  • ****
  • Posts: 368
    • View Profile
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #10 on: February 18, 2017, 00:42:11 am »


I was thinking in international conspiracy.  :D ;D

David, thanks for the good news.

   Armando

Offline papslab

  • Ewok
  • *
  • Posts: 4
    • View Profile
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #11 on: March 20, 2017, 12:52:35 pm »
It's my first attempt. i did it two days ago.  120mm high.
Thanks for this scripts.
« Last Edit: March 20, 2017, 12:59:03 pm by papslab »

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7408
    • View Profile
    • Cambam V1.0 French Doc
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #12 on: March 20, 2017, 13:14:30 pm »
Hello

Nice job !

So the unwrap/wrap works in real ? and not only in my mind  :D .. (not yet tested on the machine)

did you notice distortions compared to the original model ?

++
David

Offline Garyhlucas

  • CNC Jedi
  • *****
  • Posts: 1463
    • View Profile
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #13 on: March 20, 2017, 13:53:08 pm »
That is amazing! What was the source of the 3d model?
Gary H. Lucas

Have you read my blog?
 http://a-little-business.blogspot.com/

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3355
    • View Profile
Re: First attempt to do 4 axis toolpaths from a 3D model
« Reply #14 on: March 20, 2017, 20:52:41 pm »
@ papslab. Z jakiego drzewa to wyciete?
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.