Monday, 12 May 2014

Drawing Updates

I've returned from an interesting cycling vacation in Europe and if I can call myself rested, it helped provide me with a bit more energy to gear me towards getting the Drawing Module finished.

With a steady stream of testing, I have been ironing out some long standing issues, some hidden bugs and adding a bit more functionality. Fuelled by beer and eagerness to get this module complete, there's been some steady progress over the last week - or if deemed worthy a coding 'sprint'.

There have been a substantial number of changes since last time, both visible and under the hood. I'll try my best to highlight the most important changes:

With anything this creates new bugs and also helps discover ones hidden away. I think the philosophy is starting to come true: you complete 90% of your project in 10% of the time and the remaining 90 % of time is spent debugging the remaining 10% .

New Features:

Drawing Icons

Drawing Icons are now used to represent objects in the drawing. Courtesy of Jim!

Dimensioning tool bar

You may now select specific dimensions for your drawing

Diameter constraints

I recently added a diameter constraint which has various positional arrangements depending where you position the dimension label. 

Centre mark option available for diameter and radius dimension

Drawing is updated dynamically when changing properties using property editor

Orthographic Task View Dialog:

Due to architectural changes,l the previous task dialog coded by Joe was difficult to incorporate with what I had done.  The difference now is the way views are now handled positioning and views are managed with a container object (Orthographic projections) - this allows you to set the scale for each individual view and eventually the projection type. 

These are automatically updated in real time. Along with this there are now three different scale types: 'Document' uses the page scale, 'Automatic' will attempt to calculate this automatically and also custom option. The latter two are available for all views.

Undo & Redo now possible

Before this was a notable problem where it was never guaranteed that you could undo and redo correctly. It appears to work very well under most situations - even deleting items. The only issue I have seen so far is when deleting a dimension this isn't correctly positioned when you try to redo operation. 


  • Select 'anchor' view and now correctly drags the group
  • Drawing dimensions don't recalculate every time they are moved.
  • Dimensions correctly positioned when you save and restore the document. 
  • Reduction in number of document.recomputes - updates are automatically made. 
  • Vertical and horizontal dimension is checks edges are not zero
  • When you  create a page using the tool bar, the template is now loaded for the page (A4/A3) chosen
  • Tangent edges (e.g. cones, fillets) should now appear after disabling a check. Note: there is a limitation that these cannot be dimensioned


These are some recent changes this morning to try and prevent the random crashes/segfaults from occurring. As a result the bounding box also includes dimensions. I'm not sure if this is a good thing but I just need see if we still experience random crashes. This was a notable problem encountered in particular when you dragged a drawing view or more likely deleting a view. If I can get feedback on this over the course of time it'll help diagnose a better solution.

There  are more bugs out there some I'm aware of and some I'm not and to coin a nostalgia phrase we 'gotta catch em all'