Tag Archives: GUI Design

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.

Update

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!

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…

Modality in Sketcher

This applies other places in FreeCAD, but the main place I run into problems with modality is in Sketcher. What is modality? In this context, when I am editing a Sketch, there’s a bunch of regular GUI stuff that I’m suddenly unable to do, sometimes with good reason (but often not), because I’m in “edit mode”. For instance, I just inadvertently minimised FreeCAD while Sketcher was in edit mode, and was then unable to close FreeCAD – it won’t save/exit, or un-minimise on Mac, while in this silly mode!

GUI-wise, modes are bad. Especially bad when there aren’t good affordances for returning to normal. So, this TODO is about re-working Sketcher to be more user friendly in terms of it’s “edit mode”.

Cost: 1/2 cup of tea

Drawing Workbench – Initial Thoughts

Drawing first impression

I’ve built a development branch for an updated version of the Drawing workbench, with the intention to do a bit of work on it. This is another part of FreeCAD that I haven’t had much to do with, so with this post I hope to record some initial thoughts. I find it’s sometimes handy to look back at notes like this, as they can give a “fresh pair of eyes”.

Overall, I’m impressed with the workbench – seems like things are going in the right direction! Quite a few little things need fixing before it feels usable though. And, this testing has shown that I have what’s perhaps a more pressing issue with the Property Editor on Mac – it’s nearly unusable on my computer…

Notes:

  • What’s with the floating OpenGL view?  It doesn’t seem to respond to the mouse at all.
    • Confirmed that the same thing does not happen in my Linux virtual machine, which is mostly similar to my Mac in terms of library versions and such.
    • Right clicking and changing Renderer to OpenGL fixes that issue, but results in screen flashing white and generally behaving strangely. Renderer = Image still broken.
  • Some operations seem really slow.
  • Automatic scaling of the Orthographic projection draws the object off the paper.
    • Also doesn’t update the “Custom Scale” field below it.
    • Ditto the scale field on the sheet.
  • Need a visual cue that clicking and dragging the bounding boxes of ortho projections will let the user reposition on the sheet, but dragging elsewhere moves the sheet.
    • Is there a need for moving the sheet at all?
  • Changing to a scale that’s too “zoomed-in” can make the different ortho projections overlap (shown below).
  • Waving the dimension around leaves repaint artefacts (below).
  • SVG export has a couple obvious issues
    • Font size of the circle dimension is different.
    • Bounding boxes and their labels (Top, Side, Front, etc) of ortho projection aren’t shown.
      • Should they be?  If not, then I think it needs to be more obvious in FreeCAD.
  • “Drawing Viewer” doesn’t resize (Cascade windows before opening a drawing),

Some Drawing Bugs

Cost: A few hours worth of monkeying around with git, looking through code, setting up a Linux VM, playing with Drawing module.

GUI Scratchpad

I keep noticing little things that (in my opinion, of course) could be improved in FreeCAD. With this post, I’ll try to keep a running list of them in a scratchpad-style format.

Please don’t take anything here too seriously – I’m sure there are good reasons that things are the way they are, in many cases, and I haven’t investigated these things thoroughly. That said, if you see something here that you’d like to see fixed, leave a comment!

  • Property Editor defaults to showing the “View” tab instead of “Data”, but I use “Data” far more frequently.Fix for this merged 16 April
  • “Combo View”‘s model tree…
    • Lets me highlight some things, but not others.
  • Modality in Sketcher – this probably deserves it’s own post.
  • In the 3D views, when shortcut keys and mouse buttons are pressed that will change mouse behaviour (eg to rotate/zoom/translate), the cursor doesn’t change until the mouse actually moves.

Cost: Ongoing