QT C++ code samples

More
6 years 9 months ago #153607 by Clive S
Replied by Clive S on topic QT C++ code samples
Nice work as always. Thanks
Re the dimensions will you be able to adjust the offset of the lines from the part

Please Log in to join the conversation.

More
6 years 9 months ago #153608 by Grotius
Replied by Grotius on topic QT C++ code samples
Hi Clive,

Good question..

The dimension line will follow the mouse pointer for final position. When a product is stretched, the dimension value will update.
The right object is a stretched left object. It is copied including dimension lines etc.
Also the dimension line position can be stretched where you want to.

The dimension class is constructed as a non block. For editing the dimension line, therefore it does not have to be exploded.

See the picture of possible senario's with the dimension style class.
For coding the dimension style, you need a little experience. the angled dimension line and the corner angle are quite complex coding techniques. Also i made a text font's to display characters. This also includes the dimension style class.

In the blue area i did something strange, i stretched the dimension line itself. The clicked position's of the dimension line stay on the product x,y position, wich is nice.

In the orange area i removed some of the dimension content. So you can edit the arrow's, lines etc.

Later on, releases after march 2020, we can expand the dimension line class with extra option's. We will see about that.

Attachment not found

Please Log in to join the conversation.

More
6 years 9 months ago #153670 by rodw
Replied by rodw on topic QT C++ code samples
PDF would be a good choice and it would be easy to generate via open source.
PDF's predecessor was postscript and to create a PDF file from postscript you used Adobe Acrobat Distiller
Postscript was originally invented by Xerox becasue the Windows GDI and Apple's QuickDraw simply were not able to accurately print vectors. Xerox did not think the idea had legs and a couple of guys took it over and became Adobe!

Postscript is a stack based language was designed to be human readable but able to be consumed by machines (eg. printers).
Its base unit of measurement is a point (1/72 of an inch) and the page is described in x,y coordinates.

Whilst there are no doubt open source PDF solutions today, you could parse your DXF file to a postscript file which could be converted to PDF using Ghostscript. You could also design overlays for the drawing description and embed them as .EPS files very easily or use the Distiller prefix or suffix features.

I'm not sure how it works in a Linux world but on Windows you can dynamically link the Ghostscript DLL at run time so there is no need to link in the library using static methods. If you do this correctly, the program will still run if Ghostscrpt is not present.
I'm sure similar methods exist in Linux.

Please Log in to join the conversation.

More
6 years 9 months ago #153671 by rodw
Replied by rodw on topic QT C++ code samples
Actually, it you thought in terms of replaceable rendering engines, you could replace your DXF rendering engine with a postscript/PDF renderer and it would be super easy to maintain...

Please Log in to join the conversation.

More
6 years 9 months ago #153827 by Grotius
Replied by Grotius on topic QT C++ code samples
Hi Rod,

Many thanks for your reply. In the future i will investegate how to get a postscript output, or a vector based output. For now, i only have 3 month's to go for the release. Reading the pdf bible make's no sence at this moment.

At the moment i can render a .pdf file of my opengl widget.

I am able to give it a user defined paper format like a4 or a1. But it's based on a pixel output, no vector logic is inside the pdf, i know that is bad, but users can at least print the output, wich is important.

In coming 3 month's i have to do :

- tekst class
- a1, a2, a3, a4 templates
- speed up some of the cam logic operations
- file load and save in .gro format, expand the import and export filter to dxf, this is relating that we use full rgba colors.
- review the spline function.
- and some more to do.

I see draftsight is gone for Linux. So we have to hurry.

Please Log in to join the conversation.

More
6 years 9 months ago #154111 by Grotius
Replied by Grotius on topic QT C++ code samples
Hi, a little project update.

The text class is almost finished. Have to do the text edit function.

Cad Drawing :

Attachment not found


Cam output :

Attachment not found


Linuxcnc :

Attachment not found


Print as a4 pdf (pixel based, non vector :unsure: )
Have some work to do, calculate drawing extends for exact print output, now it prints the opengl screen...

Attachment not found

Please Log in to join the conversation.

More
6 years 9 months ago #154459 by Grotius
Replied by Grotius on topic QT C++ code samples
Hi, thank you for the many likes..

Just a little project update..

1a => At this stage we can print paper output : A0, A1, A2, A3, A4, A5, A6, landscape and portrait style.
1b => Use margin's if needed
1c => Print in pdf or png format, fitting exact to selected paper dimension.
1d => Printing is simply done by clicking a 2 point selection window. Then it opens the print dialog and pixel value's are displayed.
1e => User can define own paper format, no problem.

Print dialog :

Attachment not found



Png file loaded into inkscape :

Attachment not found



Pdf file loaded into a pdf viewer :

Attachment not found



2a => The text edit works nice. Now we can write a single line or multiline text at once, and edit the multiline text later on, very easy.

Attachment not found



3a => Expanded some trim functions, had only done the line-line trim so far.
The trim function is expanded with : line-arc trim, arc-arc trim, line-circle trim, see example below.
Have to do the circle-line trim and add extra functions to the extend function later on.

Attachment not found



4a => The dimension style class is extended to modify arrow lenght, arrow height, and text height...
Todo later on is to add a precision format, and a dimension text overwrite option..

Attachment not found



So far so good !
Have a nice day !

Please Log in to join the conversation.

More
6 years 9 months ago #154782 by Grotius
Replied by Grotius on topic QT C++ code samples
Hi,

Here we have a pre-release of the CadCam program. Phill or Tommy can you test this version?
You can play around with the program, let me know if it start's up and if you can get a gcode output...

I updated the link :
LINKS works one week => CadCam-pre-release
--compiled with linux power--
type in terminal : "./Cad" for starting the program..
Program size : 29.3 MB

The program is not in release state, so some functions are not available. For example circle-circle trim is not available at this moment.
Also i need to integrate the cnc text class for marking etc..

Please Log in to join the conversation.

More
6 years 9 months ago #154798 by phillc54
Replied by phillc54 on topic QT C++ code samples

Grotius wrote:
Here we have a pre-release of the CadCam program. Phill or Tommy can you test this version?
You can play around with the program, let me know if it start's up and if you can get a gcode output...

I have one machine with QT 5.7 and another with QT5.11 and neither has room for the 5+ GB that QT5.12 says it needs so I will build another machine for this over the next day or two.

Please Log in to join the conversation.

More
6 years 9 months ago #154811 by Grotius
Replied by Grotius on topic QT C++ code samples
Phill,

You don't have to use QT for it. Just run the ./CadCam file, its a compiled executable about 29mb.
You can directly run the program. Please try if it works!, thanks.

Attachment not found

Please Log in to join the conversation.

Time to create page: 0.242 seconds
Powered by Kunena Forum