Thanks! I know this will have a small audience, most people never get in touch with Gerber.
Fore it's a daily thing and working through the documents was really fun. Until now I took the files "as is" and used external programs, but learning how they work was really interesting.
Need a push for 3D
Re: Need a push for 3D
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: Need a push for 3D
Hi jacdelad,
I'm little bit exited to see the results of your (huge) work.
Good luck!
Marc
I'm little bit exited to see the results of your (huge) work.

Good luck!
Marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
PS: sorry for my english I speak flemish ...
Re: Need a push for 3D
Hi marc_256,
good to know that I have at least two tester. Yesterday I found another bug while rendering G36-regions. Need to fix that next week. But the GerberGadget is progressing, you can now grab the graphic and move it. Zooming works too.
Still need ms time...
good to know that I have at least two tester. Yesterday I found another bug while rendering G36-regions. Need to fix that next week. But the GerberGadget is progressing, you can now grab the graphic and move it. Zooming works too.
Still need ms time...
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: Need a push for 3D
Hi jacdelad
I have inspected your code! It's very interesting for me because I see in your code all my first problems, including try to parse the files dirctly with regular expressions. What I miss in your code is an effective grafical object structure! That's same problem I ran into! It might be not a big problem if you do not want to manipulate the objects and if you do not want to scale rotate ...!
I guess you will run into a big speed problem and a mathematical problem if want to zoom and rotate the 3D-Board.
Because you have regular expressions in the PlotGerber function you have to process the regular expressions every time you do a small
rotation. And if you want to change to 3D Output it's much more effective to convert all objects to Meshes and use the PB Mesh and 3D functions.
This will be much much faster as a manual 3D plot with the 2D Grafic library. Mesh-functions using the massive parallel power of GPU.
I guess you read some of the posts of marc256, he ran into same problems with his CAD-viewer, using the PB drawing library!
----------------------------------------
I figured out and I guess (but I'm not really sure, because I did not finish my 2D/3D Vector Oject Library)
To handle all this 3D Stuff like STL, IGES, STEP ... and Gerber it's basically all the same.
So if we find an effective abstract solution for the internal Object Structure, it is possible to handle all this formats with nearly the same code base.
But this will be a small CAD enginge and it is not so easy to code!
My favorite way now is:
Parse the File and create an abstract internal 3D Object Structrue of very basic objects defined in the Gerber, IGES, STEP -format!
Now forget the orignal file and work only with the internal Object Structure.
The internal Object Structure should contain all definitins of the Gerber Specification
like Rectangle, ObRound, Circle, Polygon
With the internal Object structure it is possible to use standard 3D-Grafic Vector Matrix functions to zoom, rotate ... without an extra overhad!
The biggest problem of my favorite way is: it needs much more developping time
A note on regluar expressions.
I did a lot of speed research in PB and Regular Expression is arraound 10 times slower than Pointer based String operations.
But it's much easier to do!
Here a sample of how I think about a GerberStructrue
I had the greate hope that we can use some of your code for general 3D File handling.
But your code is very special to gerber!
I have inspected your code! It's very interesting for me because I see in your code all my first problems, including try to parse the files dirctly with regular expressions. What I miss in your code is an effective grafical object structure! That's same problem I ran into! It might be not a big problem if you do not want to manipulate the objects and if you do not want to scale rotate ...!
I guess you will run into a big speed problem and a mathematical problem if want to zoom and rotate the 3D-Board.
Because you have regular expressions in the PlotGerber function you have to process the regular expressions every time you do a small
rotation. And if you want to change to 3D Output it's much more effective to convert all objects to Meshes and use the PB Mesh and 3D functions.
This will be much much faster as a manual 3D plot with the 2D Grafic library. Mesh-functions using the massive parallel power of GPU.
I guess you read some of the posts of marc256, he ran into same problems with his CAD-viewer, using the PB drawing library!
----------------------------------------
I figured out and I guess (but I'm not really sure, because I did not finish my 2D/3D Vector Oject Library)
To handle all this 3D Stuff like STL, IGES, STEP ... and Gerber it's basically all the same.
So if we find an effective abstract solution for the internal Object Structure, it is possible to handle all this formats with nearly the same code base.
But this will be a small CAD enginge and it is not so easy to code!
My favorite way now is:
Parse the File and create an abstract internal 3D Object Structrue of very basic objects defined in the Gerber, IGES, STEP -format!
Now forget the orignal file and work only with the internal Object Structure.
The internal Object Structure should contain all definitins of the Gerber Specification
like Rectangle, ObRound, Circle, Polygon
With the internal Object structure it is possible to use standard 3D-Grafic Vector Matrix functions to zoom, rotate ... without an extra overhad!
The biggest problem of my favorite way is: it needs much more developping time
A note on regluar expressions.
I did a lot of speed research in PB and Regular Expression is arraound 10 times slower than Pointer based String operations.
But it's much easier to do!
Here a sample of how I think about a GerberStructrue
Code: Select all
Structure objGerber_Base
EndStructure
Structure objGerber_Circle Extends objGerber_Base
EndStructure
Structure objGerber_Obround Extends objGerber_Base
EndStructure
; .
; .
; .
But your code is very special to gerber!
Re: Need a push for 3D
Sounds like an interesting project. My cae package generates 3d files, but I'd be interested in seeing the results of this anyway!