Things to do for Sketch
(see also PROJECTS for larger and more ambitious things to do) 


New Graphics Features:
======================

Beziers / Curves / Polygons:
----------------------------

- a function that smoothes a polygon (mainly for importing) or poly
  bezier by reducing the number of nodes and adjusting the auxiliary
  nodes.

- Boolean operators: Intersection, Union, Difference of bezier
  objects/paths.

  This can probably be implemented with a few functions that only work
  on curve objects. These would therefore be quite independent from the
  rest of Sketch.

- take continuity at nodes between line and bezier segments into account

Image Objects:
--------------

- user-definable resolution. (now always 72dpi)
  The resultion is used to determine the intrinsic size of an image.
  In some cases the image file format may contain the relevant information.

- More image processing

Patterns:
---------

- more hatching varieties: more lines, `transparent' color

- vector patterns (that is, tiled images represented by graphics
  primitives (and which map more or less directly to PostScript
  patterns))

- raster image patterns:

  - make the pattern trafo editable independently of the object.



Other Graphics Features:
------------------------

- extend grid: have one major unit and a subdivision of that unit

- userdefinable grid. Perhaps defined by plugin-grids

- Maybe even multiple grid layers and guide layers.

- multi-path arrows

- clone objects

- ideas for plugin objects

  - A plot object (function plot, data plot)

  - geometrical/mathematical objects:
  
    - spirals

    - fractals. at least those that are easily represented by vector
      primitives like L-Systems.

  - 3D objects: cubes, spheres, ...

  - extrusions

- support for TrueType fonts.

  This would require an X-server or a font server that supports TrueType
  fonts or text rendering on the client side.

- define circles by center and radius, or by two points (center and a
  point on the edge), or by three points. this might be implemented by
  plugin objects.

- A dialog to directly set coordinates of lines, the dimensions of
  rectangles, ...


Import/Export Filters:
======================

- bitmap export

- some filters have options that the user should be able to set. (see
  the notes for a file dialog in the User Interface section)

- when importing EPS-files:

  - Maybe read preview image and use that instead of an image rendered
    by ghostscript. (if ghostscript is not available or the user wants
    it that way)

  - resolution of rendered preview should be configurable

- PostScript output:

  - optionally include a preview image in EPS. How do we render this?

- PostScript import:

  - import as an EPS image is implemented. This image can only be edited
    as a whole (its size, position and orientation can be changed)

  - import via pstoedit (or some similar thing). This could be done
    transparently from the open command with an appropriate import
    filter. Files imported that way can be edited. pstoedit does not
    work correctly for every PostScript file (for instance: it ignores
    sampled images completely and doesn't understand tricks with
    gsave/grestore (like the ones used in postscript files generated by
    sketch)).


User Interface:
===============

- The Ungroup command could also be Split Beziers if only one bezier
  object is selected

- The current facilities for styles are insufficient. We need a better
  interface to let the user use styles to their full potential.

- The file dialog box should have a facility that lets the user set file
  format specific options. It might also have an optional preview
  window.

- A Transformation Panel. One panel to let the user specify rotations,
  translations, scalings and arbitrary affine transformations. It should
  include an option to transform a duplicate of the selected object(s).

- A Property panel that lets the user set node coordinates, radii and
  other dimensions.

- edit patterns directly in the canvas. This allows more precise control
  especially for the gradient patterns.

- allow the user to change the line width of hatching patterns

- change the cursor to indicate snapping (change its form and/or color)

- move the object with the cursor keys

- Make the palette editable: add colors, remove colors, change colors...

- define colors in various color models: RGB, HSV, ...

- Let the user define new dash patterns

- Let the user add new arrow heads

- export as bitmap image (with preview). For best results, it should
  probably be done with ghostscript which allows advanced features like
  anti aliasing and it can always render true color images regardless of
  the capabilities of the Xserver (which could also be used to render
  the image).

- Allow more than 4 MRU files...

- Maybe have a tree view for the object hierarchy of a drawing

- A clip art facility

- Snapping to the grid/guide lines should also be controllable via the
  layers panel. Visibility of the grid might be tied to state of
  snapping.

- Zoom out in zoom mode with mouse button 2. 

- Use a modifier+drag to create a copy.

- Use shift+drag to resize/transform relative to the center of the
  object. Or resize/transform relative to the rotation center handle.
  This extended center should also be remembered by the object.

- Have some help in the status bar or in a separate window. This could
  display things like 'Mouse 2 to end line'

- Support Wheel mice.

- maybe edit the grid parameters with the mouse.

- Maybe snap to intersections of guides.

- Align relative to a specific object which is not moved.



Other Features:
===============

- WM_PROTOCOLS: SAVE_YOURSELF, etc

- Autosave

- More flexible backup files. Maybe like emacs ~NN~ optionally

- page layout: margins

- Objects should have some `meta' info:

  - at least during an editing session

  - the rotation center should be such meta info

- attach URLs to objects as meta data. This can be used to create image
  maps when exporting to a raster image file or for SVG or PDF.



Implementation:
===============

- clarify the purpose and semantics of the methods Connect/Disconnect
  and TieToDocument/UntieFromDocument

- Text objects should use the individual bounding boxes of the
  characters to detect hits.

- make the bitmap renderer for the gradient patterns optional.

- pax specific code (i.e. initialization from tk-object, a Tkinter
  baseclass for a PaxWidget, etc) should go into a python module
  provided by pax.


Tk:
---

- Look at Tk_RestrictEvents for a way to detect user events during
  redraw. This might also lead to a cleaner solution for the double
  scroll bug and a way to catch SHM-image notifications.

GraphicsDevice:
---------------

- There should be a ClipBox (or possibly a `protected' clip_box) method
  that returns the bounding box of the current clip region in device
  coordinates.

   
Bezier Objects:
---------------

- better behavior for degenerate cases when changing continuity to
  smooth or symmetrical

- maybe more memory efficient undo info

- implement the curve_check_state function

C-Modules:
----------

- skpoint:

  - maybe convert from and to complex numbers? If that is implemented
    trafos should also accept complex numbers. This doesn't really add
    functionalty, it's just `syntactic sugar', and since complex numbers
    are not used anywhere in Sketch it's not useful to implement it
    right now.

- sktrafo:

  - methods for computing the eigen vectors and/or eigen values. This
    could be used in the hit test for degenerate ellipses.



Documentation:
==============

- add remarks about Acrobat Reader and the Times and helvetica fonts to
  the section about font installation

- It should be possible to read linearly through each document by
  clicking on a "next" reference.



Thoughts and Questions:
=======================

- When changing line attributes (pattern, width, join, cap,...), should
  objects with an empty line style be affected?

- should objects with no outline and no fill be selectable by single
  click in normal display mode (not outline)? This can be confusing,
  since they are invisible.

- MoveSelectionToLayer (in document.py) should distinguish three cases:

  - objects that are below the current layer should be inserted at the
    bottom of the current layer

  - objects that are above the current layer should be inserted at the
    top of the current layer

  - objects that are already in the current layer should not be moved at
    all
