2D Drafting CAD Application
A lightweight 2D drafting application with API and command line interface. Provided command line utility to add entities in view port using commands like –
- Drawing : Line, Poly line, Circle, Arc etc.
- Editing : Move, Rotate, Copy, Explode, Offset, Extend, Trim, Join, Scale, Mirror, Fillet, Edit text etc.
- Annotation : Linear Dimension, Aligned Dimension, Leader etc . Also supported snapping point, ortho mode, implied direction text box etc
- Drawing and annotation Commands :
Fig A : (Entities Drawn using Line, Polyline, Circle, Arc, Rectangle, Text etc.)
Fig B : (Entities Drawn using Drawing, Copy, TRIM, MIRROR, MOVE, OFFSET etc)
Fig C : (Entities are drawn using different layer)
CHALLENGES : Among number of challenges, some of them are as follows,
- Snapping points: Highlighting of center point of circle or arc on hovering mouse over entity
- Command line utility: Validating inputs provided by user and listing respective commands and instructions for next expected input like AutoCAD
- Implementing Ortho Mode
Solutions : Solutions for above mentioned challenges are as follows,
- Identified which entity we have under mouse cursor, if it’s a circle or arc then highlighted its center as snap point.
- Decided required number of inputs for a particular command then after getting valid inputs from user for first input, displayed next instruction accordingly.
- For ortho point, calculated smallest distance between current mouse cursor point and respective x or y intersection points.