2D CAD style graphics
-
Hello all,
I have spent the last few weeks trying to learn Qt. So far the experience has been both a challenge and rewarding. Especially for a novice programmer like myself.
I have a program in mind that I want to write, but am having problems finding the resources to learn and was hoping someone here could point me in the right direction.
I would like to draw some basic graphic primitives, like rectangles and circles and the like. I would like to be able to select these and generate G-Code from them. Eventually, I would like to be able to load DXF files, but for starters I thought just being able to draw some vectors would be fine.
I would like to specify these on a plane. For example, a line from 1.5, 1.5 to 4.875, 1.5 where the coordiantes relate to physical drawing dimensions. Then select the entity and retrive the points.
Is there an example of this type that I could look at that you are aware of? If I can work this part out, I can do the tool path calculations based on some selections made by the user. For example, a profile with a .25 inch endmill.
Many thanks for any direction you can provide.
Joe
-
hi joe!
To learn Qt draw or 2D paint . QT assistant self is a good start with good examples.you can search "2D paint" or "openGL " for help.
And QCAD is a openSource 2D CAD software.
goto : " www.qcad.org":http://www.qcad.org/ -
Thank you for the response. I have used QCAD and LibreCAD quite a bit to draw files and that is basically what I want to do. I downloaded the source for LibreCAD and looked around a bit, but I am new enough to Qt and Programming, I am not sure what I am looking for.
I have been playing with QPainter and drawing some primitives. Reading in the docs for Qt I am sure I need to use the QGraphicsView and QGraphicsScene classes. I guess I only need to use the floating functions for drawing my pimitives. QLineF for example? Also, I suppose I need to figure out how to flip the Y-Axis so that it represents the regular cartesian system. :-)
Thanks again for your patience with such a green newbie!
Joe