Tag Archives: User Interface

little things, and The Process

While I was playing around with FreeCAD today, I felt a little twinge of frustration and decided to do something about it. Perhaps my loyal reader will find the process of identifying issues, fixing them, and publishing fixes interesting?property viewer

There’s a widget, the “Property Viewer”, which is one of a few key GUI components in FreeCAD. It contains two lists of properties (dimensions, positions, colour, etc.) for the thing you’re working on, and allows them to be changed. There are other ways to change most properties too, but the Property Viewer has everything in one place and is usually accessible.

The Property Viewer has two tabs; Data and View, so you can either work on Data properties or View properties at any particular time*. The issue is that I manipulate Data properties much more frequently than View properties, but FreeCAD always starts up with the View tab in front. So, I usually have an extra click to get Property Viewer in the right mode for changing the properties I’m interested in.

To fix this, I added ~20 lines of code to save the last tab that was selected, and to select that tab next time FreeCAD opens. Then, I “pushed” that modification to github, and made a brief post to the FreeCAD forum to ask people to try it out and comment. Assuming that my change doesn’t cause any problems and people like it, in a few days I’ll submit a “pull request” and one of the core developers will bring the code in to the main FreeCAD codebase (unless they notice a problem in the new code). Not all changes justify asking for popular opinion and testing, but that’s a judgement call. This particular change affects a core GUI component of FreeCAD so I felt like it was worth asking.

Every now-and-then, a “release” is made of FreeCAD (incidentally, we just made a release today!), next time that happens, any changes incorporated to that point will be included. Releases happen every few-to-several months, so in the meantime people can only get the new changes by building from the latest source code, which is what some of the early posts on here, for instance the one about building on OS X, are about.

All that said, the process for the Drawing module, which is where I’ve been doing most of my work lately, is a bit different. At this point there are only a couple people working on that module, and we’re working on a fairly significant re-write that involves breaking the existing Drawing module. So, rather than asking for comments and incorporating changes into the main FreeCAD, we [even more] informally push and pull our work to/from github to keep the latest and greatest moving forward. Eventually, when there’s some consensus that the module is ready to go, we’ll go through a testing phase with the wider FreeCAD community, and hopefully the whole thing will eventually be a part of the main codebase.

* Of course, as I type this, I realise that it might make sense to just get rid of the tabs altogether and just put all properties in one widget…

Orthographic Projections

Today has mostly been spent in the Drawing module; working on refactoring code, and fixing automatic positioning of individual views (“view” and “viewer” must be the most commonly used word in FreeCAD source code…) in orthographic projections. This is something I started a few days back, trying to resolve the issue where the views were often drawn on top of each other by default. It turned out to be a sneaky little problem; the main issue boiled down to the coordinate systems used for the 6 individual views having different origins from each other, which also changed depending on the projection used.

So, now we can make a drawing of something like the archetypal orthographic projection demo widget:

Screen Shot 2015-04-04 at 7.58.36 pm

Then, with a few clicks (and an annoying wait, might attack that tomorrow), have a decent looking drawing in either “third angle” as at the top of this post, or “first angle”:

Screen Shot 2015-04-04 at 7.50.56 pm

One small step at a time…

80/20

… = 4?

Also known as the Pareto Principal, the “80/20 rule” is something that detail-oriented people like me need to keep in mind. It applies very well to software development, one example being a quick bit of code last night that’s now in the latest-and-greatest FreeCAD development source:

rendering issue popup

I dig the idea of wiki links in error messages, by the way

To “fix” 80% of the problem that causes the 3D view popping up in the Drawing here, I’m working on a 2-part solution, which should hopefully be far less than 20% of the effort of the proper solution. The first part was to make a little popup, only on Macs, whenever the customer starts using MDI style windows. I don’t think that adding popups is generally the best solution, but in this case the proper solution would involve a large amount of time/effort – essentially adapting both FreeCAD and a large external library to use Qt5. The warning seems to strike a reasonable balance, so I went ahead and submitted that part last night.

The second part applies only to the development version of Drawing, I think. Stay tuned!

Cost: Probably 2 cups of tea, though I wasn’t keeping close track


On a tangent, another example of the 80/20 rule in my [funky, new-to-me] house from this morning – the clothes washer and dryer weren’t meant to go together as a vertical pair, so there used to be a problem with holding the washer door open. Not anymore!

Dryer fixDryer fix-2

Summary: Day 6

Saturday mornings in Dunedin bring the farmer’s market, which is a great way to get tasty food (including, oddly enough, the best bagels in New Zealand) and catch up with local friends. After a relatively quick trip to the farmer’s market, I had a few errands to take care of which were mostly unrelated to this project, but did include a stop at a thrift store to invest $2NZD!

IMG_1975

The mouse has helped a bit with productivity – it’s certainly nicer for development and for driving FreeCAD than the touchpad on my laptop. This got me to thinking about how often different input devices are actually used for FreeCAD, or just 3D CAD in general. Specifically, I wonder how common it is for people to use just the trackpad on a laptop, or a 3D “spaceball” type mouse?

In terms of actual development work, the day was largely devoted to getting started on the Drawing module as discussed on Drawing Workbench – Initial Thoughts, and a couple tangentially-related tasks. There was also a bit of time following up on the forum, maintaining the blog, etc.

One of the tangentially-related tasks deserve a brief mention. From a developer’s perspective, I find source code documentation to be very important. Especially when starting out with a project, finding the bit of code that provides a specific functionality can be a daunting task without a nice way to browse through source. Something like doxygen goes a long way towards providing a nice interface into the source code, so I spent some time on fixing up the doxygen setup in FreeCAD.