import gCode

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
lalberts
Posts: 87
Joined: Fri Feb 05, 2016 2:40 pm
Location: Esslingen am Neckar

import gCode

Post by lalberts »

Hello,

how can I import a readymade GCode to simulate it.

I want to cut geographic models of buildings with a 45m radius tool to simulate lightning protection. (osm models out of BlenderGIS for example)
I need those cutted surfaces to show the protected areas. (compare those envelops with and without thunder protection items)

Pycam or Freemill can generate gcodes. But they do not export the cutted model.
Blender-Cam needs updates and how-tos..
Sounds like Freecad is the last ressort :-)

Thank you for your help.

Lukas
Esslingen
lalberts
Posts: 87
Joined: Fri Feb 05, 2016 2:40 pm
Location: Esslingen am Neckar

Re: import gCode

Post by lalberts »

Sorry,

managed it... create a solid.. create a new path, even if empty.. open the gcode file via normal import..
not yet where i want to be, but progressing..

Lukas
lalberts
Posts: 87
Joined: Fri Feb 05, 2016 2:40 pm
Location: Esslingen am Neckar

Re: import gCode

Post by lalberts »

I can see some path next to my solid cube.. but it still not a gcode path..or is this it? how to let it run/simulate..
copy&paste inside the path editor?
in property 'Path'/'Gcode' there is a bunch of commands..
need to have a checked tool,operation,model,stock and setup?

hard to get through..

Lukas
lalberts
Posts: 87
Joined: Fri Feb 05, 2016 2:40 pm
Location: Esslingen am Neckar

Re: import gCode

Post by lalberts »

need to remove to setup infos out of the pycam/freemill export file..
do I?
lukas
lalberts
Posts: 87
Joined: Fri Feb 05, 2016 2:40 pm
Location: Esslingen am Neckar

Re: import gCode

Post by lalberts »

no way...

tired..
Attachments
test.FCStd
(3.66 KiB) Downloaded 85 times
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: import gCode

Post by chrisb »

You should at least upload the gcode as well. The standard 10x10x10 cube doesn't help much.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
sliptonic
Veteran
Posts: 3460
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: import gCode

Post by sliptonic »

You might be interested in PR 3600

With this, you should be able to import external gcode using the gcode_pre.py preprocessor. It will create Custom ops that behave more like regular operations. You can enable/disable them and even apply dressups. So you could import externally created gcode and then add holding tags for example.

I would appreciate some testing.
lalberts
Posts: 87
Joined: Fri Feb 05, 2016 2:40 pm
Location: Esslingen am Neckar

Re: import gCode

Post by lalberts »

Thanks for your help..
is this pr4600 already in 0.19.21622 ?

Lukas
User avatar
sliptonic
Veteran
Posts: 3460
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: import gCode

Post by sliptonic »

Pr 3600 hasn't been merged yet. I don't like merging my own stuff without giving other developers a chance to comment. If I don't hear otherwise, I'll merge it later this week
memfis
Posts: 590
Joined: Tue Nov 15, 2016 7:58 pm

Re: import gCode

Post by memfis »

as long as something new is being introduced. On the example of an attempt to import my code, I noticed that if we use comments marked / instead of () in our code, we may get an empty trajectory instead. And I would like to see comments for /, as well as the use of conditions, loops, subroutines, processed correctly during import -




o<101> sub
G0 X[#2 * 0.00] Y[#3 * 762.50]
G1 F[#<_pm>] Z[#1]
G1 F[#<_pb>]
X[#2 * 0.00] Y[#3 * 762.50] Z[#1]
X[#2 * 0.08] Y[#3 * 1200]
o<prav> if [#4 ge 1]
G0 Z5
G0 Y[#3 * [1200 + #<_hp>]]
G1 F[#<_pm>] Z[#1]
G1 F[#<_pb>]
o<prav> endif



/X[#2 * 0.08] Y[#3 * 1143.73] Z[#1]
X[#2 * 0.00] Y[#3 * 1525.00] Z[#1]
X[#2 * 28.13] Y[#3 * 1524.90] Z[#1]
X[#2 * 45.83] Y[#3 * 1524.80] Z[#1]
X[#2 * 55.08] Y[#3 * 1524.60] Z[#1]
X[#2 * 57.58] Y[#3 * 1524.40] Z[#1]
o<101> endsub

o<101> call [-1] [1] [1] [0]
Post Reply