Length Class and Refactoring

Since my last update, I have implemented a Length class. This allows one to store a length with its unit as well as to perform unit conversions. These conversions include functions similar to those found in helper/units.cpp where a length, a “from” unit, and a “to” unit are specified as well as additional functions that allow conversions of the form length.value("to_unit"), where length is a variable of type Length and to_unit is the unit that one wants the value of the length in.

Over the past few days, I have been working on transitioning over from conversions using SPUnit and the conversion functions in helper/units.cpp to conversions using the new Length class. While I originally planned on working incrementally by converting one file at a time, the code is more interconnected than I originally believed, turning the porting of one file at a time to the porting of quite a few more at a time.

Posted in | Tagged , , , , | Leave a comment

Current State of Units

Inkscape’s main unit handling code is in helper/units.cpp and util/units.cpp. The code in helper is originally from libgnomeprint, and the code in util is the start of a rewrite; I plan on moving everything to util. In addition, there is separate code for handling units within an SVG file, for live effects, and for display, as well as a few other miscellaneous header files related to units. Based on these files, I have developed a list of major unit support requirements.

  • Listing units
  • Handling unit names and abbreviations
  • Unit conversion
  • Reading units from SVG files

To start, I plan on making the existing code more readable, then moving all unit handling into util/units.cpp, starting with the functions in helper/units.cpp.

Posted in | Tagged , , , | Leave a comment

Google Summer of Code 2013: Inkscape Units

I was accepted into Google Summer of Code 2013 and will be working with the Inkscape project. My project involves two phases: first refactoring Inkscape’s existing unit handling support into one place, then extending said unit support to properly support real world units such as millimeters. More details are in the full project proposal. I plan to document my progress here and post summaries to the inkscape-devel mailing list. I have created a public repository for the first phase of the project. Once the first phase is completed, the branch will be merged back into the trunk, and a new branch will be created for the second phase.

Posted in | Tagged , , , | Leave a comment

Hawk

After stepping outside, I heard birds making lots of noise. As I was about to get in the car, I saw what they were concerned about; a hawk was perched on a street light. I got my camera and telephoto lens instead. The other birds went as far as diving at the raptor, although it didn’t seem to care.

Hawk

Continue reading

Posted in | Tagged , , | 2 Comments

Saguaro National Park

I was in Tucson, Arizona this past weekend for the AIAA Design Build Fly competition. One can find photos from the competition on Flickr. While there, I visited Saguaro National Park one afternoon after the competition.

Saguaro National Park Continue reading

Posted in | Tagged , , , , , , | Leave a comment