Hello,
I would first like to say that I am not a professional programmer. My degree is in electronic engineering and I work at a steel fabrication shop. My function at the shop is designing automated tooling. Because of my love for C++ and C# I frequently get programming projects thrown my way. The apps I mostly develop are utilities that we use in the office.
Because I don't work on a team of developers and that I am not a computer science major I feel like my development efforts lack the proper design needed up front to yield strong software. Having said that is why I am asking for your help.
I need to develop a simple CAD type app that will allow the user to create and edit a simple 2d parts to be produced on a CNC machine. I know you are thinking why don't you use AutoCAD or any other package that all ready exist? The answer is I have thought of doing a VBA app for AutoCAD, but I feel that this should be simple enough, why tie up an AutoCAD license when we just need to draw a few circles and rectangles.
What I was thinking of is creating some type of a custom class that would define the entities:
For example: Circle Class, Rectangle Class, Line Class, ETC. these classes will contain x,y values for the end points as well as methods on how to draw each entity on the screen.
How do you select a entities from the screen so that they may be edited..etc?
What about a dimension that could reference two other entities?
I may be way off base on this thing, if that is the case pleas let me know as well as any better approaches! Please guide me through this design, I am ready to learn!!!
Mike
Loading
Mahesh ChandPosted Jul 21, 2011, 4:29 PM
To merge two shapes, you can use union, intersect options. This needs to be done using Geomerty objects in WPF. In GDI+, it used to be done using Path and Regions, where you could merge (union, intersect etc).
You can also create a Geomerty object in WPF and add multiple objects to it and then draw it, that is what you will see merging objects on front end. I will post a link to Geometry objects articles soon. I worked with them couple of years ago and need to find out my documents :).
Sam HobbsPosted Jul 21, 2011, 3:46 PM
Mahesh ChandPosted Jul 21, 2011, 2:09 PM
So there are two ways you can build this product. First, Windows Forms (GDI+) and second WPF. I would recommend WPF.
Go to WPF section and learn how to work with various shapes and select them and move them. This site has lot of articles and tutorials on this.
Here are some ideas:
PaintBrush in C#
PaintBrush in C# - II
Drawing Shapes in WPF
Shaped Windows in WPF
Good luck!
Mike SportmanPosted Jul 21, 2011, 8:48 AM
I did not hear the news about the bridge demolition project, but that does sound impressive. I agree with what you are saying and to finish a project of that magnitude before the estimated schedule, WOW!
Your are correct in assuming the products a relatively simple.
Once again thank you for you support!!!
Sam HobbsPosted Jul 20, 2011, 8:58 PM
Unfortunately I cannot help much. I know the obvious; that you will need at least two big pieces, graphics and database. I think you are headed the right direction by designing your system to use entities/objects. You should learn graphics programming such that you can manipulate items in a drawing as entities/objects. You should look for books that help with that.
I assume that your products are relatively simple. In large products, perhaps as large as automobiles or airplanes, there might be complex hierarchies of items, whereby assemblies have components that are assemblies. Designing a database that can manage a hierarchy such as that is important. Hierarchies are common; a computer's file system has folders and sub-folders. If your products/drawings are simple then the heirarchy won't be a problem (hopefully).
When I was at Lockheed I talked with the group working on the newer CAD/CAM; I think they called it Edge. I assume you are familiar with CADAM, one of the original CAD software. One of the design goals of the newer sofware was the ability for the Engineers to design aircraft that was as close as possible to what can actually be built. At that time, the Engineer would design something but the aircraft had to go through a major redesign to be buildable. If you want to be able to provide something like that, then that might require an important amount of designing. In other words, do you want the Engineer to be able to design something and then get the CNC programming out? If so then the software might need a special level for figuring out how to make something. Perhaps it needs to know about tools, material and manufacturing instructions.
You might want to also think of Order Location and Project Management systems.
I can't help much beyond telling you what you already know. I think the one thing I can say to help is that it helps to design it. You need to analyze the requirements; think about the things I described above. Decide what you need to do. Analyze it as an Engineer; don't try to decide how to build it. Decide what you need first. Being a non-programmer helps with that.
Did you hear about Carmageddon in Los Angeles this past weekend? They de-constructed half a bridge, but only half a bridge lengthwise. They did it in about 35 hours, ahead of scheduloe. They did not blow it up; it was a very precise Engineering project. As an Engineer, you understand the need for planning. That applies to software too; it will help to be methodical in the design.