Hello,

 

I appreciate all suggestions and technical details from you as to the “transformation anchor” project. I have summarized them into a proposal in the following. There is plenty of information for the project goal and plan. Later discussion, confirmation on tasks, and further input may help me to keep in the right track in the implementation.  So far, the project and its tasks seem clear enough to me. And, according to my experience, I can see that this project can be done. As well, if there is any time left (I guess there would be), I would like to work on adjusting origin of document coordinates, and allowing math operations for spin boxes.

 

The beginning of April is often the busiest time for students in Canada. It will be much better in the summer (May to August). Last year, I completed a 10+ page proposal for Gimp in the last day. This year, I am slightly earlier, after talking in Inkscape mailing list for half a month.

 

Your feedback will be welcome and important. Then, I will submit the proposal very soon, or I will revise it there. Thank you very much.

Regards,

Zhenfeng.



GSOC proposal - Improve GUI for transformation centers

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

PROJECT SUMMARY (a longer abstract)

 

There are some existing issues with selecting and modifying the transformation center. This project focuses on improving and modifying GUI for transformation centers to solve existing issues and enhance precision and flexibility. In the three month GSOC period, first I will discuss with Inkscape designers and decide a GUI mockup as an implementation guide. With the further analysis and detailed plan, possible refactoring will be done. A control of precision of moving the transformation center will be implemented. Center coordinates would be set numerically. There will be a 9-button-matrix widget that is used to quickly move the center to 9 positions, and a separate tab in the Transform dialog, for adding XY fields using a couple spin-buttons for X and Y. Then, the linkage between the 9-button-widget and the spin-buttons can be done.

 

Another relevant projects will be analyzed and implemented (i) adjust origin of coordinates of document, and (ii) allow math operations (sum, substraction, multiplication, division) inside the spin boxes for Height, Width, X, Y.

 

All implementations will be tested and ensure accuracy, flexibility, and robustness. All code produced will follow the Inkscape coding style. Documentation will be done during coding.

 

BACKGROUND AND SKILLS

 

I am interested in working on the "transformation-anchors" project in GSOC this year. Inkscape is one of my favorite open source software. I have similar work before, to have the default rotation center to be the geometric center of all shapes. Anchor coordinates are a part of the object (drawing) attributes. It can be adjusted, so that geometrical transformations, rotation, translation, scaling, and shearing, can be performed with the updated center. The following is a few points about my background.

 

· Master student in Computer Science (GPA: 4.0/4.0) in Canada, thesis: medical image processing and 3D reconstruction.

· Successfully completed GSOC 2009 for a Gimp project, Advanced GUI for brush dynamics.

· Four years full-time work experience in programming and architecture

· Played key roles in technology R&D and innovation in image processing, vector graphics, 3D modeling, and CAD

 

I have developed vector-based graphics editors both from scratch and on existing large applications. One of them is for a leading manufacturing company in Canada. For example, a graphics editor uses customized XML formats, have OOP architecture design to deal with all shapes/primitives using object classes (e.g. rectangle, ellipse, closed-path with arcs and lines, curves), and allow SVG and DXF (Solidworks drawing file) import and export. I have used Inkscape and SVG at work for one year (e.g. for SVG work, and GUI and HCI design example). One of my contributions for this software is to replace the previous raster based image editor with vector based editor using custom XML format.

 

Every year, hundreds of customers use it for industrial designing, including NASA, Boeing, Google, Microsoft, MIT, US Army, GE, GM, Lockheed Martin, and many more. The company can product near anything that is made using the software. Meanwhile, the R&D goal was to provide the software that reflects what products can be made. Therefore, it is high level quality software that provides flexibility and precision. A few highlights of my work:

·           Completed the release of version 3.1 within 1.5 months of hire, with minimal input

·           “accomplished tasks the first day that took half a month before; amazing” – President

·           “The good news is, you are on the top.” – Chairman, in a review for R&D team performance

 

Besides this software, I have developed dozens of image and video editors. When I worked as Lead Developer with 2D-3D Video Inc. for two years, I worked on image processing, and video editing software, and 2D to 3D image/video conversion. I have led the development of 3D movie player on iPhone/iPod Touch, and LG 42-inch 3D TV. The technology is used to convert image or video and generate 3D viewing effects without 3D glasses required.

 

Sample work:

3D face of Barrack Obama. It is converted to 3D photorealistic view using a single 2D still face photo.

http://www.2d-3dvideo.com/3Dphotos/BarrackObama.wmv

Other:

http://www.2d-3dvideo.com/NewSite/SchoolPhoto.wmv

http://www.2d-3dvideo.com/3Dphotos/Couple.wmv

http://www.2d-3dvideo.com/3Dphotos/33framerotation24degree.wmv

http://www.2d-3dvideo.com/IDcards/male130BG40deg.wmv

 

In my Master thesis research, I have had two publications, and will have couple more soon. I have developed new algorithms and techniques in image segmentations, interpolations, 3D reconstruction, and missing structure generation. Since the work deals with different shapes, it has a vector graphics sense. I used XML to store and process 3D structure and wireframes.


Technically, I am good in C++. I have done some work using the following.

XML: I have used it for many projects, using C++, Python, C# and Java. Libraries used: .NET, DOM, JDOM, Minidom. It is used in my thesis and each of my jobs at work. 
SVG: I have written a SVG viewer before.
GTK+: I have experience with it in the Gimp GSOC project.

Git and SVN: I used it at work before.

Bazaar: I tried it, and it is very similar with SVN and Git.

 

 

PROBLEMS AND IMPLEMENTATION PLAN

A well designed GUI and interaction of transformation anchor manipulation is very important for Inkscape. Currently, the rotation center (in an example of transformation) can be dragged freely. However, where it is dragged to cannot be precisely defined, except eye-balling roughly.

 

There needs to be new UI facilities with an intuitive design that allows the precise adjustment of the center. This precision control is expected to be useful to many Inkscape users, such as Xfig users. In the Transform dialog, XY fields need to be added as a separate tab. A 9-button-matrix widget, which is intuitive and helpful to users, will be implemented to assist moving the center among nine locations easily with one click.

 

To prevent errors or misleading, there should not be center of rotation and anchor as two different entities. A single tool should be used, which is marked by the cross. Then, all transformations should refer to it. Since this object exists in the code, a list of better UI facilities can be added to move it. As well, the cross can be automatically saved into SVG for each object.

 

A simple test was done to confirm this. The center of rotation, marked as cross, can be moved to a different location. It is saved for the object, so that when closing and reopening this SVG file, the cross (center of rotation) stays where it is left. In the SVG, the fields or attributes of the path object shows:

      inkscape:transform-center-x="7.6874748"
      inkscape:transform-center-y="-3.2402241" /

Another quick test was done for moving the transformation centers.

- For rotate and skew, different centers will give different results.
- For scale, moving the center gives the same results, with the same transform values.
- Transform using handles is correct. A simple drag keeps the center as it was, and Shift+drag scales around the rotation center.

 

Obviously, there is an issue in the consistency with scaling. It does not work correctly if scaling by numbers. Selector toolbar, or the mouse tool in the top left interface, uses the top right corner, while Transform scales around the geometric center. The correct way is to use rotation center for scaling, with X/Y in selector toolbar displaying the coordinates of the center. The above issues will be fixed.


The UI needed for rotation center XY coordinates is a couple Gtk-Spin-Buttons for X and Y plus a unit selector, defaulting to the document units. Since there is already the unit selector for X, Y, Height and Width, it may be used without writing a new one.

 

After the 9-button-widget is used to move the X/Y coordinates, the spinbuttons should be updated to reflect the selection of one of nine anchors. Hence, the linkage is required for the 9-button-widget and the spinbuttons.

 

It was pointed out that there were two other relevant projects related to this one:
- adjust origin of coordinates of document
- allow math operations (sum, subtraction, multiplication, division) inside the spin boxes for Height, Width, X, Y.

 

I believe that it would be more beneficial if I work on this two during GSOC. The main focus of the project is on transformation centers, and the above two will be analyzed and planned, when transformation center tasks are half way through. I will propose another implementation plan for them, with a reasonable class structure design/rewrite.

 

I will work on the two after completing the transformation center project. If there is no
time to finish all of these in three months, I will try to make sure on-going work is easy to do. After the three months of work, I may be interested to continue contribution.

 

At some point later, it may become clear what can be done, when unknowns are solved.

 

It was suggested that the math operations can be taken from GIMP 2.7.0+. It can be done easily with my previous experience in Gimp contribution. Taking code from open source is something that I have done for many times, both for Master thesis and at-work programs. Recently, I took some open source code of spline interpolations into my thesis. Translating math operations into C++ is doable too. I do porting of different languages on daily bases.

 

TASKS AND TIME TABLE

Goal: Improve GUI for transformation centers for precision and flexibility

 

1. Communication. May 10 – May 20.

Communication with the mentor.

Code review on relevant source code, class structure.

 

2. Studying. May 21 – May 25.

Study Inkscape development workflow, coding style, committing process.

Study libraries required.

 

3. Reaserch. May 26 – June 6

 

Analysis of the architecture.

Discuss and decide a GUI mockup as an implementation guide.

Get familiar with sample SVG files and GUI mock-up that Pajarico has.

Preparing a list of implementation.

Intuitive GUI design.

 

4. Coding and implementing. June 7 – July 17

 

Possible refactoring.

Precision of center moving.

Fix the issues for scaling around different centers.

Allow setting the center coordinates numerically

Add 9-button-matrix widget

Add XY fields in a separate tab of the Transform dialog

Implement XY coordinates UI, a couple Gtk-Spin-Buttons for X and Y.

Ensure the linkage between the 9-button-widget and the spinbuttons.

Display coordinates and values, take XY input from users, and allow undo and redo

 

5. Second stage implementation. July 18 – July 31.

 Further analysis of two relevant projects:

1) adjust origin of coordinates of document

 2) allow math operations (sum, substraction, multiplication, division) inside the spin boxes for Height, Width, X, Y.

Have another implementation plan for them, with a reasonable class structure design/rewrite.

Implement them.

 

8. Overall debugging, code optimization and further improvements. August 1 - August 10.

 

9. Further optimization. August 11 - August 15.

 

10. Documentation and clean up. August 16 - August 20.

 

 

REFERENCES AND LINKS:


http://wiki.inkscape.org/wiki/index.php/Google_Summer_Of_Code

https://blueprints.launchpad.net/inkscape/+spec/transformation-anchors

http://socghop.appspot.com/gsoc/org/show/google/gsoc2010/inkscape

https://bugs.launchpad.net/inkscape
http://wiki.inkscape.org/wiki/index.php/InkscapeInvariants

http://inkscape.org/bzr.php

 

Note:

I am also interested in a few other interesting projects:        
- Power Stroke - Modulated width stroke LPE.
- xar-to-svg converter - Converter for Xara Xtreme to Inkscape

- KML SVG translation - For use of Inkscape with Google Earth or Maps

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>