C coded dxf to g-code converter, the building process...

More
19 Feb 2019 18:09 - 19 Feb 2019 20:16 #126778 by Grotius
Rod,

Dvt is something i don't know. Problably because i never seen such a string.
The complete function an sich is quite easy to understand. Even a new member can imagine the flow of the function.

Today i made usage of pointers and array's to find the biggest object's in the drawing. Okey that works.
But i must work at a perfect algoritme to compare all the objects in the drawing. I think this is the hardest thing to think about.

A sample drawing of objects.


The output in terminal after the array's are calculated and compared to each other :


The drawing has 15 object's following the output ngc file. Following the Array calculation object 15 is the biggest object related
to x, y value.


I will first make a basic algoritme for the ngc file output. Let it work for simple drawings. KIS (keep it simple) first.

Anyone an idea in the mean time to add into the code?

If you think, i count 16 objects.... You are right. Counts start at object Zero. :silly:
That is something about computer code....

A picture is better to understand then a code preview at some cases.


How i looked for the biggest object in dummy words :

1. Every ngc code has a m3 and m5. Beween this characters are g-code lines. M3 is tool on, M5 is tool off.
2. Between m3 and m5 is are multiple lines, they are spotted as object's, because their begin and end point correspondent's or
if they are open lines, they are also spotted by coding. You tell the c code what you want to do. And the c-code does what you want after trail and error. But how more you practice how easyer everyting becomes. Even writing a letter in English become's easy when you do it every day. So it's just a way of practicing and stay interested in what you are doing.

If i look what i did in 2 weeks, i think about military mainframes that need to be updated. But rewriting the old mainframes are a risk.
So the us and russia, they need good developers to guide a space missle coded in c. But it's all possible. We know our target and that is making a open source c coded dxfdecoder. I thank Rodw for thinking about the name. B) It's just a good name !!

3. Every object is calculated seperately in lenght and width. Data is stored in array of 1 miljion lines for x and 1 miljion lines for y.
Making a dynamic growing array is something to do. But today i find that not important. Allocating memory is also something to do.
Allocating memory in the free zone, is something that atrract's me.

4. After the array's are made. We look at the array's and look for biggest x and biggest y value and look if it's correspondent's with the same object. If so, we say okey ... It's good.
But there are 100 way's to make an algoritme. So we must think about the best way simple way to declare inside and outside offsets.
Later on we can perfectonize this. For now a radical simple algoritme can fit 80% of typical cnc users.
Attachments:
Last edit: 19 Feb 2019 20:16 by Grotius.

Please Log in or Create an account to join the conversation.

More
19 Feb 2019 20:04 #126786 by rodw
Yes, C arrays always start at [0]. I noticed from your screendump your line number was out for M5.

There are very good reasons why this is so as its more natively tied to how a computer thinks and how its done in assembly language commands. As you gain more experience you will come appreciate this feature.

In dv/dt, the d really should be the delta signal signifying the change in volts divided by the change in time. (or rate of change involts per second).

I'm still only playing with this but I think I should be able to sense cutting into a void or overcutting at the end of a cut and disable THC in 1-2 milliseconds.
The following user(s) said Thank You: Grotius

Please Log in or Create an account to join the conversation.

More
19 Feb 2019 21:54 #126792 by Grotius
Rod,

Yes it was a screendump of many lines, i like the idea that the code is becoming more and more powerfull each day.
Last day's i thought about c language (in the air for about 40 years) and the first plotter and why i never spotted a open source c coded cad cam program for dxfdecoding process. But i know why. And i will tel you a secret.

A human can never do calculation's like this, and how nice to make your own logic.


It's rod's formula typed into AsciiMath

There are a few people on the earth that are open sourced at this moment. One of them is Tesla.
He is the great improver of all. If i look at the developpers of linuxcnc, sasha, the developper of ethercat, etc.
Without them, I would be nothing writing at this moment.
So my responsibility is to make a open sourced c coded clever program for free.
If it will take 1 year. I see it as my responsebility to the open source community. For the future of our community on mothership earth.
So everything begin's in yourself. Every idea. I hope if their are people around the world with crazy idea's, provide your skill's, provide at least one skill in your lifetime open sourced.
Attachments:

Please Log in or Create an account to join the conversation.

More
19 Feb 2019 22:31 - 20 Feb 2019 00:20 #126793 by Grotius
Okey,

human's on earth : : 7.685.179.980

money on earth :
But let’s try to estimate the money in the world
7 billion dollars, amount in bitcoin investments
7.6 trillion real estate investment
7.9 trillion the amount of gold and silver
70 trillion stock market investment
90 trillion notes and coins in circulation
199 trillion dollars is debt by people and countries
= 374.5 trillion
1.2 quadrillion is the amount of derivatives.


Trillion = 12 zero's (1,000,000,000,000) = 374.500.000.000.000 Trillion
Quadrillion = 15 zero's (1,000,000,000,000,000) = 1.200.000.000.000.000 Quadrillion


Total amount of the world can't be calculated by linux calculator by typing so much zero's. We can modify the calculator to do this job.
It would be perfect if the standard calculator has a 4x4 excel row inside with all funtion's in a button touch.

We need to do it by hand mode for now.
374.5 Triljon's + 1.2 Quadrilion's = 1.574.500.000.000.000 Quadrillion.


1.574.500.000.000.000 Quadrillion / 7.685.179.980 Total people = money divided to every person on earth. They are all equal born.

204874.83 Dollar for every person on earth. Not bad.

Elon Musk is happy off with paypall. Paypall is at the moment the no. 1 bank fraud system in the world to avoid taxes.

Some people are smart and some people think they are smart. But in the end. They will be charged. I think it will take 3-4 years from now.

I'm still only playing with this but I think I should be able to sense cutting into a void or overcutting at the end of a cut and disable THC in 1-2 milliseconds.

Even when you use a high defenition. I have never spotted that problem. But i love it when you think about kerf crossing !!!
I hope to look at the union's tomorrow, from your advice. Let's take a look at that and feel about the possibilities of union's !!

Almost forgotten.
I will make a 5mb dxf file tomorrow and see how fast it is... Very important at this stage.

Rod,

My girfriend is sometimes confused when i talk about strings, float's, array's etc to here. She think's i talk about another girl. :blink:
So string's are meaning also underwear in Holland. I can't do anything about this, sorry. But i got a example of strings just to show how a string looks like. It's alloc memory is located at the underside of the woman, between the stumic and the leg's. Feel free to
make a comment.

Last edit: 20 Feb 2019 00:20 by Grotius.

Please Log in or Create an account to join the conversation.

More
25 Feb 2019 21:49 - 25 Feb 2019 22:02 #127124 by Grotius
Hi, i have little project update.

At the moment i have coupled the c code to glade and to opengl



I saw some difficulties in the dxf i have to solve. The autodesk dxf is really set up as a mess.
So i have to sort everything, compare everything etc. But i have time.

I am short to develop a new cad program wich sort's all the object's before saving.

The Array's are fun to work with. We can do array's up to 9 axis, over millions of lines into the heap. :woohoo:
Attachments:
Last edit: 25 Feb 2019 22:02 by Grotius.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
11 Mar 2019 21:18 - 11 Mar 2019 22:11 #128382 by Grotius
Hi, I have a project update. It's not much.

I had to study OpenGL in the past 2 weeks, because glut is a OpenGL pop up screen.
And we want integrated solution for the DxfDecode program.
It was hard to connect OpenGL to a c coded gui in glade.
But it works after trail and error. I am positive about the 3d functionality. Mouse function's and several button's are
interactive with the object rotation speed, zoom, etc.

In the mean time i tried QT for C coding instead of their integrated C++ coding.
In the first place. QT is very powerfull. Wtf. this is a huge program.
So maybe i will try to adapt my c code to QT and make a gui with .ui extension instead of .glade.

I realize the DxfDecode source code is still a very powerfull piece of code.
So soon is the moment to put everything to one program. But i have one issue to solve.
In the contour recognize it's very hard to declare cw or ccw. I made different patron's that are looking 5 corners forward to declare
if it's a cw or ccw object. It works for 90% of the objects. But i must find a way that it works for 100% of the object output.

I am positive about my adventure in linux. Linux is power to the max !



You can test the OpenGL cube application. Let me know if it works please. It's a test without source code, just like windows :laugh:

start commando in terminal : ./gtk3-opengl
or if it wont do the job paste in terminal : MESA_GL_VERSION_OVERRIDE=4.5 MESA_GLSL_VERSION_OVERRIDE=450 ./gtk3-opengl

File Attachment:

File Name: gtk3-openg...test.tar
File Size:60 KB
Attachments:
Last edit: 11 Mar 2019 22:11 by Grotius.
The following user(s) said Thank You: chimeno

Please Log in or Create an account to join the conversation.

More
11 Mar 2019 23:20 #128402 by tommylight

Please Log in or Create an account to join the conversation.

More
11 Mar 2019 23:34 - 12 Mar 2019 01:04 #128406 by Grotius
Hi Tommy,

I have client for you in your country for milling machine.
He called me last week, i forgot his number. Are you interested?

In Servia taxes are upgraded 2 weeks ago i mentioned from other client.
Hmm. Your country is still the best to avoid taxes. B)

In serbia tax policy is as follows:

VAT is 20%.
At the end of the year, all your profit is taxed with 15%. If you want to take that money from the bank, you need to pay 15% more.
Conclusion: you pay 15% if your profit stay in your company. 30% if you want to take your profit (cash).


Tommy, do you see the flickering of the screen? Did you start up with the short startup or the long one?

The way of programming this way is compatible with displaying a hologram. OpenGL don't use any measurement's like
inches or mm. It's all relative.
Last edit: 12 Mar 2019 01:04 by Grotius.

Please Log in or Create an account to join the conversation.

More
12 Mar 2019 12:35 #128429 by pl7i92
did you get a look into camotics it works fine as a simulator
and Question is there a support for G41/G42 CRC offsets into the CCode project ir will it be like Estlcam only zero path direct milling support

The following user(s) said Thank You: Grotius

Please Log in or Create an account to join the conversation.

More
15 Mar 2019 22:31 - 15 Mar 2019 22:32 #128691 by Grotius
Hi,

Question is there a support for G41/G42 CRC offsets into the CCode project
Yes, toolpath offsets G41/G42 is one of the key concepts.
The difficulty is because there is no logic in the dxf available to see if it's a cw or a ccw contour, so you have to write your own logic.

But at the moment i started the project with QT designer intead of Glade. I had too much trouble with Glade to use Opengl function's. In fact i was busy for 2 weeks only to get OpenGL working in Glade. After some testing and compiling i realised this is not the way.
Glut with c works very good. But Glut is a pop up screen.

I realised a QT project written in C++ with OpenGL working to draw some lines.
My existing C code project is integrated in the project. So it seem's easy to combine C and C++ code.

At the moment i am busy to display the dxf array's to the screen display. This i have to find out in coming day's.
It look's easy, but OpenGL has many booby trap's.



The QT screen designer is nice, it makes your connection's to your code so easy...


And the project structure. You see the cpp (C++) files and the c files in the same project.

So i have to learn QT a little bit and stay on to make some progress !! :woohoo:
Attachments:
Last edit: 15 Mar 2019 22:32 by Grotius.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Moderators: Skullworks
Time to create page: 0.720 seconds
Powered by Kunena Forum