Back home, and wrapping up the experiment

I’ve been back in Dunedin for a few days now from a trip to the US. The talk went well, and it was great to catch up with friends and family in the states, but I’m also glad to be home!

Aside from catching up on sleep and chores over the last couple days, I’ve been kept somewhat busy with arrangements to start a new job next week. The new role involves software work with a local tech company (which also makes hardware, so may get into that), and I’m quite excited to get started.

The premise of this experiment was to try to fill a gap between jobs, so I suppose the onset of this job marks the end of the experiment. I think this project has clearly demonstrated that it is possible to be supported by the OSS community in exchange for work on an OSS project.

Of course, I’ve still got several irons in the fire with FreeCAD, so my plan is to keep working on it as time allows. I’ll likely post here again with updates, but expect the pace to be more like it has been in the last couple weeks, rather than toward the beginning of this project ;).

Speaking of… My work on FreeCAD over the last few days has been pretty slow, obviously, but I have been trying to follow the forum, get some minor fixes ready to go, and tinkering a bit with the Drawing module. My main project yesterday (aside from getting caught up and remembering what I was doing…) was to fix an annoying little bug where newly-added views within a Drawing would move slightly after being added initially. It was just a small thing (and a one-liner fix in the end), but it struck me how much nicer the creation of a drawing was after that fix. There’s still a lot to do in the Drawing module, but it seems to be on the home stretch now.

To close this post, I’d just like to send a big “Thank you!” to everyone who contributed to this experiment, especially Aleph Objects, you’re all great!

Travel, Lisp, etc.

I’m currently visiting with family in the US, will be heading back to home in a few days. The talk in Madison that prompted this trip went fairly well, and I’ve spent the last several days catching up with family and friends – quite nice overall, and beautiful springtime weather!

I’ve not done a lot with FreeCAD so far on this trip; during the ‘work’ segment in Wisconsin I was too busy, and have been trying to treat the second part as more of a vacation. This is, after all, an experiment to see if working as an open source developer can serve as employment, and any reasonable employment must include vacation ;).

That said, there has been a little tinkering here-and-there with some smaller items in FreeCAD, and I’ve been trying to keep abreast of the forum. I suppose a screenshot of the work on editable texts in Drawing hasn’t made it onto the blog yet – some of this work was done on the trip:Screen Shot 2015-05-07 at 12.50.29 pm

Unrelated to FreeCAD; I’ve finally spent a couple afternoons starting to learn some Common Lisp, which I’ve meant to do for a while now. It’s been a very interesting process so far; the language itself has been fun to start learning, but the history behind it is quite interesting as well. This evening, I was reading about interesting uses of Lisp and came across SHRDLU, which was done 45 years ago! and then watch video of the real thing Amazing!


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.