CamBam

Resources => Scripts and Plugins => Topic started by: dh42 on February 16, 2017, 11:43:40 am



Title: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 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:
'*************************************
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).

(https://i58.servimg.com/u/f58/14/07/22/66/venus_11.png)

(https://i58.servimg.com/u/f58/14/07/22/66/venus_10.png)

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


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: EddyCurrent 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


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 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


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 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


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 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


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: Garyhlucas 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.


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 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


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: Bubba on February 17, 2017, 21:48:46 pm
David,
This is pretty good. Nice work!


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: BR52 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


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 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


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: BR52 on February 18, 2017, 00:42:11 am


I was thinking in international conspiracy.  :D ;D

David, thanks for the good news.

   Armando


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: papslab 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.


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 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


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: Garyhlucas on March 20, 2017, 13:53:08 pm
That is amazing! What was the source of the 3d model?


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: Bubba on March 20, 2017, 20:52:41 pm
@ papslab. Z jakiego drzewa to wyciete?


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: Dragonfly on March 20, 2017, 22:19:29 pm
Hey, I understood that :)  And noted Polish books on the photo too


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: papslab on March 21, 2017, 09:06:15 am
That is amazing! What was the source of the 3d model?

Hello.
The model is from grabcad or similar page. I don't remember.



Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: papslab on March 21, 2017, 09:21:34 am
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



It works great.
A number of rotational step was 360. Unwrap model was 28MB. There were no visible distorsions.
I used 4mm tapered ball nose end mill. It's a little to large diameter.

Pawel


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 on March 21, 2017, 10:01:25 am
Hello

Ok, nice, so I'll continue to work on this plugin (currently, doing the surfaces without to have to run other plugins)

++
David


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: Bubba on March 21, 2017, 11:25:01 am
Well done, Pawel.

Fly, czytasz po polsku?  :D


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: Dragonfly on March 21, 2017, 15:09:12 pm
With some effort and guessing.
Anyway these are Slavonic words, although far from the way we write and pronounce them in Bulgarian :)


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: Bubba on March 21, 2017, 16:39:01 pm
Anyway these are Slavonic words, although far from the way we write and pronounce them in Bulgarian
***************
Yep. :D


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 on March 30, 2017, 21:13:26 pm
Hello

A new version of the script ; now it creates the 3D surface itself.

a plugin version will follow soon

++
David


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: EddyCurrent on March 30, 2017, 22:11:39 pm
Good effort  ;D it's amazing what can be put in a script.


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: papslab on April 02, 2017, 10:36:30 am
Hello

A new version of the script ; now it creates the 3D surface itself.

a plugin version will follow soon

++
David



Works ok


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 on April 02, 2017, 16:32:48 pm
Hello

I stay surprised that it works  ;D ...

I see that your unrolled model is close to 250k triangles ! .. I assume it takes hours to calculate the unroll ?

Last night I do some job on the UI for the plugin (only the design, currently, code remain to add)

Thanks for the tests  ;)

++
David


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: karst.drenth on April 02, 2017, 17:50:16 pm
looks cool  8)  8)


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 on April 02, 2017, 23:40:14 pm
I wonder why it works bad on the same model in inches .. (the venus, resized to inches)

It's like too small triangles (absolute values) are not detected.

++
David


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: quoy25 on April 18, 2017, 19:04:16 pm
Very Nice and impressive tool !
i've started learning CATIA machining  to be able to use my 4 th axis for complex 3D milling , but i think here is the answer for my needs .
is it possible to use rought + finishing operations with this unwrap/wrap option ?
what i mean is unwrap a "cylindric" shape, make some rought and finishing operation ( wave rought + horizontal finishing for exemple) and then wrap the GCODE with CAMBAM WRAPPER ?
does someone test rought operations ?
thanks in advance
quoy


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 on April 18, 2017, 19:23:07 pm
Hello

Quote
is it possible to use rought + finishing operations with this unwrap/wrap option ?

Yes, in fact it's exactly the same than using a 3D machining operation, except that you wrap the resulting GCode, so you can define rough and finish the same, and use as many 3d mop you want. (and also boundaries as for any 3D job)

++
David


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: quoy25 on April 18, 2017, 19:29:26 pm
Merci David , et chapeau bas pour cet utilitaire indispensable !
principe simple dans le concept, fallait y penser ! encore une fois bravo , je teste des que possible ...


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 on September 12, 2017, 23:17:25 pm
Hello

I just adds a plugin version on the website

http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/Unroll3D.html

http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/Unroll3D_FR.html

++
David


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: SquibLoad on September 13, 2017, 04:55:37 am
This is fantastic, I can't wait to try it!

Would it be possible to allow the choice of which axis to align?
Many milling machines orient a 4th axis along the X axis rather than the Y axis.

Regardless, thanks for this!

It seems that the release of CamBam 1.0 has inspired quite a burst of creativity.
Many, many excellent new plugins have arrived in the last few months, or updates and enhancements to older plugins.
Great fun!




Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: EddyCurrent on September 13, 2017, 08:04:13 am
Hello

I just adds a plugin version on the website

++
David

Nice one  ;D


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 on September 13, 2017, 16:54:22 pm
Hello

Quote
Would it be possible to allow the choice of which axis to align?

The unroll orientation is not really linked to the 4th axis alignment, it only generate a surface ; just rotate the resulting unrolled surface by 90 before applying the 3D mop, so you are able to wrap it on another axis.

For the next release (if that works  :) ) I planed a 'test diameter' button that will allow to check for the min stock diameter needed to cut the shape (not always easy to find if the model have a tortuous shape) ; I also want to try to speed up calculation, that is very slow  :'(

++
David


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: EddyCurrent on September 13, 2017, 18:41:31 pm
David,

Why not combine it with Wrapper, or at least parts of it ?


Title: Re: First attempt to do 4 axis toolpaths from a 3D model
Post by: dh42 on September 13, 2017, 19:48:52 pm
Not sure what can be combined  ???  Wrapper act only on a Gcode and after the shape has been unrolled there is MOP creation that remain to do and job to do with boundaries to avoid that the tool down at the ends.

currently, on the wrapper side, I just set the base Z to the same value as unroll radius, and the diameter to 2x the radius.

With the integrated wrap option in the post pro, there is no way to set the wrap diameter, it is the stock surface value of each mop that is used as wrap radius.

If you want to use the PP to wrap, you must change some setting on a copy of you preferred PP.

1) in the Rotary section, set the right value for Axis of spin and Rotary axis. (in my case, Y and A)

Axis of spin define the axis of alignment of the 4th axis, Rotary axis define the letter used for the 4th axis

2) set rotary wrap to True to enable GCode wrapping

3) you must also edit the macro in the Moves and Canned Cycles sections to remove the axis that is wrapped.

In my case my 4th axis is aligned on Y, so it is the X that is wrapped.

In all macros, I remove the {$_x} macro, so for feedmove the build-in macro is {$g1} {$_f} {$_x} {$_y} {$_z} {$_a} {$_b} {$_c} and become {$g1} {$_f} {$_y} {$_z} {$_a} {$_b} {$_c}

It is not needed to set the Arc Output to convert to line, it is done automatically when Rotary wrap is used.

---

I attach a CB model that has been done with the following settings.

The unroll settings
(https://i11.servimg.com/u/f11/14/07/22/66/venus_10.png) (https://servimg.com/view/14072266/4565)

The Wrapper settings
(https://i11.servimg.com/u/f11/14/07/22/66/venus_11.png) (https://servimg.com/view/14072266/4566)

The result on NCplot
(https://i11.servimg.com/u/f11/14/07/22/66/plot_w10.png) (https://servimg.com/view/14072266/4567)

With CB V1.0, the wrapper plugin is no longer needed for this king of job where rotation is always 360 and the Wrap with the PP is really simpler to use than the plugin.

++
David