Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Gcode to 3D Model Preview - Need help please

Author
Message
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 29th Mar 2020 05:38
I need help in display a 3dPrint Gcode file as n 3D model.
Will this be possible in AGK

My CNC simulator/Controller can now do 2axis /3axis and 4 axis Gcode files,
see thread https://forum.thegamecreators.com/thread/225902

I can display the 2D Gcode images without any problem and actually work pretty well, with my 2D Foam Cutter/3d Printer (Using Marlin Firmware and Gcode generted with Cura)
I would like to display the 3D Print model in my CNC APP and not only a 2D Top view as I run the Gcode file
For those not familiar with Gcode files, there is X/Y/Z coordinates, aswell as the layer Height, so everything is in the GCode file

Any Pointers/Suggestions?

Thanks, appreciate
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 29th Mar 2020 14:16 Edited at: 29th Mar 2020 14:32
Like that ?

This seems to be some "3D Lines".
I'd recomend creating one layer as one mesh using the memblock commands so you can hide it later and view the layers below.
1. Low poly cylinder with the diameter of the nozzle/tool represeting the actual tool path.
2. The harder but more performant version would be to create trails/plains and a shader to rotate the trails facing the camera.
3. Or maybe just creating 3D plains as layers where you draw the lines on.

But producing a solid model from it, involves some tricky algorithm.

I have tuned china Anet A8 3D Printer.
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 30th Mar 2020 03:15
Janbo
Yeah, like that.
I don't care about the 'layer" look for the 3d print effect. Just to show a 3d model from the GCode


Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 31st Mar 2020 01:26
GCode is for all intended purposes just Layered 2D... the 3D itself stems from the specified Layer Height.
That should be in the GCode somewhere as well, but I've never really cared enough about 3D Printing to really care to research it much.

Still it always looked like a simple enough Format.
For the most part you just want to generate Vertices, then Extrude them by the Layer Height to have a "Preview" for Printing... recreating the original Model from it though, eh... I'd imagine that the GCode itself is drawing lines between where the Vertices used to be.
So arguably, if you added a Vertex for each time the Line Vector changed; then you could rebuild (most) of the original Vertex Shell.
From there you could probably do a Loft Algorithm to recreate the Triangulated Shell.

But it's just an idea.
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 31st Mar 2020 16:14 Edited at: 31st Mar 2020 16:18
Quote: "I'd imagine that the GCode itself is drawing lines between where the Vertices used to be"

Not sure but I think it allso adds entrys if you change speed or something so I guess if you just connect all G1 Linear Movement entrys you'll end up with more vertices than the original has, but one could work from that onwards.

Quote: "GCode is for all intended purposes just Layered 2D"

The Format itself, yes, but how do the professionals present it on the screen ?
I use MatterControl Lately and it seems they do a cheap version of number 1. from my post above.
Which is, adding cylinder, without even caring about seamless connections between set positions.


Although you don't care about the layers you could do the same and if you add them to one object instead of creating thousands of objects it should be rendering fast enough I guess.

Attachments

Login to view attachments
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 7th Apr 2020 04:06
Quote: " but how do the professionals present it on the screen ?"


Good Question, Must be easy way to do this... cant see it too complicated... just need to figure out how !!

Login to post a reply

Server time is: 2024-04-19 14:36:07
Your offset time is: 2024-04-19 14:36:07