![]() ![]() It would matter only at the time of printing if printing to scale, changing the base measurement, or when exporting and importing to a library or another drawing (neither of which are implemented yet). What is a unit? In this case, it doesn’t really matter what a unit is, it could be an inch, a centimeter, a mile. All points used by any draw tools, edit tools, snap points etc., are done using the unit point. To keep a clear separation between the screen and the data units, I created the UnitPoint class. (Note, The correct name for the coordinate system is the Cartesian system, Wikipedia explains the coordinate system.) World unitsĪ commonly used coordinate system when drawing in CAD is the world coordinate system where the origin is located at the lower left corner and the positive X direction is right, and the positive Y direction is up, as opposed to the default screen coordinates where the origin is upper left and the Y direction is down. ![]() #Simplecad specify angle codeNote! I am aware of several bugs in the code at this point, but these bugs are related to the snap and selection tool, and do not affect the overall design. Copy of selected object (for now, only when moving). Snap is used to precisely attach a draw object to another object. Basic draw tool: line, circle, and arc.Select enclosed objects (when moving left to right) or select any partially enclosed objects (moving right to left). ![]() Using world units and a coordinate system instead of screen units and a coordinate system.So, what I have implemented so far is the basic framework and only the most basic tools, but it does demonstrate how a CAD application could be implemented. Now, implementing a fully functional 2D CAD is a tremendous task for a single person, and not something that can be completed in just a couple of months when only working on it on and off in the evenings. Have you ever wondered how a 2D CAD application is designed and implemented? I have, so I decided to sit down and write one. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |