<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.panotools.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.panotools.org/index.php?title=Idea_Brushing_Polygon&amp;feed=atom&amp;action=history</id>
		<title>Idea Brushing Polygon - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.panotools.org/index.php?title=Idea_Brushing_Polygon&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://wiki.panotools.org/index.php?title=Idea_Brushing_Polygon&amp;action=history"/>
		<updated>2013-05-21T13:08:12Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.0</generator>

	<entry>
		<id>http://wiki.panotools.org/index.php?title=Idea_Brushing_Polygon&amp;diff=10443&amp;oldid=prev</id>
		<title>Klaus: write-up with images</title>
		<link rel="alternate" type="text/html" href="http://wiki.panotools.org/index.php?title=Idea_Brushing_Polygon&amp;diff=10443&amp;oldid=prev"/>
				<updated>2008-05-20T18:20:17Z</updated>
		
		<summary type="html">&lt;p&gt;write-up with images&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Image masks for blending images are currently bitmap-based, but this information can be generated from polygon masks. Usually polygons are manipulated in grabbing the points or the faces. In hugin-ptx, relating to the Google [[SoC 2008 Masking in GUI]] project, the idea of brush strokes for easy mask generation has been put forward. &lt;br /&gt;
&lt;br /&gt;
The following presents an idea on how brush stroke actions with the mouse can act on polygonal outlines. It is a rough description, not yet covering all special cases.&lt;br /&gt;
&lt;br /&gt;
The main idea is that the start point and the initial direction&lt;br /&gt;
of the brush stroke have an effect on how the polygon is modified.&lt;br /&gt;
The click, hold and drag action starts away from any polygonal trace.&lt;br /&gt;
&lt;br /&gt;
A rectangle framing the image shall be the start polygon.&lt;br /&gt;
&lt;br /&gt;
==Starting the brush stroke==&lt;br /&gt;
&lt;br /&gt;
Two different polygon examples are shown, with the brush stroke starting at the bottom in an upwards direction.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;The dot at stroke start and the arrow may not always render correctly.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Brush polygon idea2.svg|300px]] [[Image:Brush polygon idea5.svg|300px]]&lt;br /&gt;
&lt;br /&gt;
The mouse-down start point defines half-way boundaries. For each polygon this is a combination of that polygon being scaled (dashed line) and the perpendicular bisectors (dotted lines) between start point and polygon points.&lt;br /&gt;
&lt;br /&gt;
==Crossing the half-way mark==&lt;br /&gt;
&lt;br /&gt;
[[Image:Brush polygon idea3.svg|300px]] [[Image:Brush polygon idea6.svg|300px]]&lt;br /&gt;
&lt;br /&gt;
When the first of these half-way boundaries are crossed, the corresponding polygon is chosen, the half-way point defined, and also a trace, a part of the polygon outline, is selected as follows:&lt;br /&gt;
&lt;br /&gt;
The start point and the half-way point define a direction.&lt;br /&gt;
From the start point inside the angle range 30-60 degrees left&lt;br /&gt;
one looks for a polygon point to act as trace endpoint (full blue circle).&lt;br /&gt;
If there are several, one chooses the &amp;quot;best&amp;quot; as endpoint,&lt;br /&gt;
which usually means the point nearest to the 45 degrees direction.&lt;br /&gt;
If there is no point within that angle range but a polygon face,&lt;br /&gt;
then a candidate endpoint (open circle) is placed on it at 45 degrees.&lt;br /&gt;
&lt;br /&gt;
Then repeat for the angle range to the right.&lt;br /&gt;
&lt;br /&gt;
There is a continuous polygon trace between two endpoints (blue),&lt;br /&gt;
any segment of it connected to an endpoint is an endpoint segment.&lt;br /&gt;
There may be intermediate points and intermediate segments (violet).&lt;br /&gt;
&lt;br /&gt;
Possibly this trace should be highlighted at that point in the GUI.&lt;br /&gt;
&lt;br /&gt;
==Crossing into the polygon==&lt;br /&gt;
&lt;br /&gt;
[[Image:Brush polygon idea4.svg|300px]] [[Image:Brush polygon idea7.svg|300px]]&lt;br /&gt;
&lt;br /&gt;
When this highlighted trace is being crossed, any candidate endpoint is added as a new point to the polygon.&lt;br /&gt;
&lt;br /&gt;
* If one crosses an endpoint segment (blue line), a new point (red) is created and sticks to the pointer.&lt;br /&gt;
* If one crosses an intermediate segment (violet line), this segment (red line plus two red points) sticks to the pointer.&lt;br /&gt;
&lt;br /&gt;
Each of the violet polygon points between the red sticky middle element&lt;br /&gt;
and a blue endpoint performs a scaled version of the pointer movement,&lt;br /&gt;
with points nearer to an endpoint moving less.&lt;br /&gt;
&lt;br /&gt;
This action is over when one releases the mouse button.&lt;br /&gt;
&lt;br /&gt;
No action is taken is the mouse does not drag across the highlighted polygon trace.&lt;br /&gt;
----&lt;br /&gt;
Clicking into empty space deselects all.&lt;br /&gt;
&lt;br /&gt;
Clicking and dragging on polygon points and lines yields standard response.&lt;br /&gt;
&lt;br /&gt;
Dragging with modifyer down into empty space creates a new polygon.&lt;br /&gt;
&lt;br /&gt;
Several polygons XOR, the resulting masks ORs with any input image bitmap mask.&lt;/div&gt;</summary>
		<author><name>Klaus</name></author>	</entry>

	</feed>