Category Archives: Daily Summaries

Dead end…

I’ve spent much of today working on things to do with the title block in Drawing – both the old and new versions. This morning, there was some investigation into a bug in the old Drawing, then after that I’ve been working on implementing a nice UI for editing text fields from templates…

My idea was to make text in the SVG template be clickable, so the user could just click on the drawing’s title and edit the title, for instance. Sounds simple enough, but the plan involved one slight complication that’s turned out to require¬†a fair bit of effort. It’s easy to extract the coordinates of the beginning of the text from the source SVG file, but it’s not trivial to get the width and height of the rendered text. That’s important because the width and height are required to determine what area needs to be clickable.

There’s a documented function in Qt though, which should allow one to use the SVG ID of an item in an SVG document to get the width and height once it’s rendered. So, I spent some time getting things setup to use that function, and found that it didn’t work. After spending some time trying to figure out where I had screwed up, I found a post explaining that the function I wanted to use wasn’t actually implemented for SVG text items…

Anyways, a couple random distractions later (some related to the PropertyEnumeration refactoring effort, which has been pushed to the main line and so some folks have been forced into testing it ūüėČ ), and I’m making some progress again on Drawing.

I probably won’t be updating this much over the next few days, as I’ll be travelling, but stay tuned!

Logarithms: Better than bad, they’re good!

Yesterday’s work was focused on two different TO-DO items:

1) I did a little bit of work on the position dialog box, as requested on the forum a few days back. The position dialog has two modes, incremental and not-incremental (I’ve been calling that one absolute), where the position indicated to the dialog is either applied against an object’s current position (incremental), or against the origin of the coordinate space (absolute). That mode is selected by a checkbox, the requested feature was to make the state of that checkbox persist between uses.

Screen Shot 2015-04-24 at 2.13.25 pm

In addition to making the checkbox state persistent, I ended up also changing around the transitions between the two modes a little bit, so now that part works a little more intuitively. Now, when incremental mode is entered, the GUI widgets are initialised to reflect the equivalent incremental placement to the change in absolute position that had been in the GUI before.

I suppose a video clip would’ve been a clearer¬†way to convey the original problem and my changes…

2) The auto-scale in Drawing had a few problems, so I’ve re-worked two areas to resolve those.

First, there’s a little function (Attributed to David Eppstein, whose blog led me off to reading about the Harriss spiral – neat stuff) that takes a scale value and computes a ratio of two integers that closely approximates that scale. The problem was that the function wasn’t really setup for handing big or small scales, so I wrapped it up with a little math to essentially deal with adding 0s onto either the numerator or denominator depending on the scale.

Second, the algorithm¬†for calculating the¬†initial scale to use didn’t handle small scales very well. The re-work there was a little more involved, but fortunately a lot of my earlier work on the placement of orthographic views was useful.

So, now it’s easy¬†to use the drawing workbench for bigger or smaller things than it used to be, though there are still a couple issues. One of them is that there’s a hard-coded level of detail parameter somewhere, which I intend to do something about. So, right now if I try to draw a sphere the size of Earth, then it gets computed to some absurdly high resolution, 0.01mm or something along those lines. There’s a similar problem in the regular 3D view part of FreeCAD too, for instance at the default settings a circle drawn in Sketcher looks like a 30-something sided polygon, so maybe that issue requires a bit more thought.

Apologies for the gap in posts here. I’ve been busy with a number of things, both related to FreeCAD and not.

Next week, my friend and former colleague Dag and I will be giving a talk in Madison, Wisconsin, about our winter at the South Pole. So we’ve been getting prepared for that, which involves a lot of digging through photos, thinking about what was interesting to learn about wintering for the first time, and a pile of logistics. I’m originally from the US, so will also be take the opportunity to visit with some family for a few days after the talk. Also been busy with job search, fixing some things around the house, and of course my “weekend”.

In terms of FreeCAD:

  • Re-worked the isometric drawing movement constraint – simpler solution works a lot better.
  • Updated software on my computer
  • Some more work on the PropertyEnumeration refactoring – that’s about ready to merge now
  • Started working on changing the text strings in templates, for instance in the title block

Incremental changes

Yesterday was spent mostly as anticipated – picking up my shiny new/used monitor (quite happy with that purchase) trying out the new Enumeration class (minor success, needs a couple small changes before further testing), tying up some loose ends in Drawing, etc.

From a user’s perspective, the main change to Drawing is that isometric views are now constrained so they’ll only move in 45 degree angles from the Front view, much like the normal orthographic views move only vertically or horizontally from the Front view. I’m not 100% happy with the implementation here, so may do a bit more work on that later – the movement can get¬†a bit jittery when isometric views are moved too near the centre of the Front view, although¬†there’s not much good reason to do that anyway.

But! I also tracked down the source of a bug that’s closely related to the one discussed previously in Bounding Bounding Boxes. Isometric views were sometimes being positioned a little strangely, which became more of an issue after their positions were constrained. The problem is that the centroid of an object’s bounding box¬†is dependant on the orientation of the bounding box. The isometric views end up wanting a bounding box for the object that’s not aligned with the originally calculated one, so they sometimes are not centred on the origin. A fix for that is first up on my list for today, though I’m a bit slow with this Open CASCADE 3D geometry stuff.


Today was spent on a few different aspects of the project, with a brief interlude to deal with some external (car) stuff. First thing, I got caught up on¬†emails/forums, then did a bit of shopping*, then on to programming! For better or worse, the changes¬†I made¬†aren’t involved in any new features, and didn’t address any specific bugs that I’m aware of (though, I did find a couple possible sources of bugs). But, I think it was a valid use of time because I learned a bit more about the internals of FreeCAD, and think I’ve also cleaned up those internals to a degree.

In object oriented programming, there’s a distinction between¬†“is a” and “has a” relationships. My project today involved splitting one class into two, to make this particular area a bit more consistent and to allow for the use of one piece of functionality provided by the original class without the other.

Specifically, FreeCAD has several classes descended from a parent class Property, which are used to store various pieces of information to be saved into configuration or project files. These are the things that are modified by the Property Viewer. The refactoring I did today took a descendent of the PropertyInteger class – PropertyEnumeration – and made it instead derive directly from Property and contain a (new) Enumeration object. So, PropertyEnumeration now “is a” Property that “has an” Enumeration.

There are a number of reasons I worked on this, none of them is terribly compelling if taken alone, but to me it fell into a category of “things that I’d want a professional programmer to fix, but that I wouldn’t bother with¬†as a hobbyist”.¬†So, the project for tomorrow is to try out those changes in the Drawing-dev branch (which is where I came across a use case for them), then clean up and submit them for testing if they seem worth the trouble.

Also intend to tie up a couple loose ends in Drawing. I’d like to try a couple different options for constraining the position of the new isometric views, then there’s a bug that causes newly added views to not be scaled appropriately sometimes.

Oh! This evening I went over to the maker space and learned a couple interesting things. First, there’s a possibility that I can get access to some machine tools in town! Second, that it’s possible to print nylon with filament type 3D printers, and that some neat things can be done by designing air bubbles into 3D printed nylon parts.¬†That’s got me thinking about a project that was discussed at South Pole – making a 3D ice printer. I’m sure someone has done it already, but it does seem like a fun party trick regardless.

* As for that shopping; I’ve arranged to buy¬†a monitor (2nd hand local), and bought a 3D mouse (amazon). I’m quite intrigued by these 3D mice, looking forward to having one to play with aside from the obvious need to have one for work purposes.

Aleph Objects Rocks!

For a few days now, I’ve been meaning to post an update here on the general state of this experiment. This afternoon, I received a nudge in that direction in the form of a very generous donation from Aleph Objects, makers of open source LulzBot 3D Printers! Thanks so much!

lulzbot logo

For the last week or so I had been considering reducing the¬†time spent on this stuff, as the numbers just weren’t adding up. Now though, it’s clear that I can keep at it for a while longer!

With that in mind, a few thoughts about the experiment so far, in no particular order:

  • The sense of accomplishment that goes with a commit¬†to an open source project¬†is¬†amazing! Open Source gives a real sense of connection with the customer, and there can be an aspect of instant gratification¬†too since it’s so easy to¬†share changes.
  • Although I really like my somewhat-outdated MacBook Pro, laptops aren’t¬†the best ergonomically for¬†all day work. So, I intend to¬†arrange a better workspace, starting with a regular desktop monitor (which I suppose implies a desk!).
  • Keeping abreast of¬†the FreeCAD forum, and updating this blog, takes quite a lot of time! For some reason though, it still feels a bit weird to admit to spending time on work-related online reading, posting, etc.¬†In¬†a regular job I wouldn’t think twice about accounting for equivalent time spent in meetings or on conference calls, but for some reason the OSS equivalent doesn’t feel the same.
  • Especially considering how little effort I’ve put in¬†to publicity of this project, I think this is a viable way to spend a few weeks/months in a productive and fulfilling way. That said, I do need to find a Real Job, and it’s hard to get motivated to work on that while I’ve got so much other fun stuff to do! Fortunately, things on that front are still moving forward, stay tuned.
  • I’ve mentioned the Dunedin maker space, DSPACE, on here only briefly. It’s a great resource, and I’m hoping to get a bit more involved with that as the Drawing workbench gets a little more wrapped up. There are a few 3D printers available at DSPACE, so I’m hoping to get a bit more hands-on experience with drawing up parts in FreeCAD to be printed on them.
  • Getting back to the Aleph Objects donation – as a former Boulderite, I’m super proud of the Colorado tech scene! Thanks guys!


Today was supposed to be a “weekend” day, but a number of events transpired to keep me in front of the computer for much of the day.

First off, I spent some time cleaning up the changes I’ve been working on in the Drawing workbench, and getting them pushed up to github. The main two items are a re-work of code involved in generating “wires”, which are what OpenCASCADE calls collections of edges, some work on BSplines, and the isometric projections. There had been a couple¬†bugs in the BSpline and wire¬†code, finding and fixing those occupied most of yesterday. Now, the Isometric projections aren’t completely done, but they’re usable and I just need to make a few design decisions to finish them up.

A couple other smallish bug fixes made it in, and a lot of cleaning up/commenting source code. There’s a discussion ongoing on the FreeCAD forum regarding code formatting/reviews/etc, so have been occasionally getting distracted by thinking about that stuff too.

Will probably take tomorrow “off”, as I need to¬†take care of some things out of the house, but stay tuned!