<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GSoC &#8211; Matthew Petroff</title>
	<atom:link href="https://mpetroff.net/category/programming/gsoc/feed/" rel="self" type="application/rss+xml" />
	<link>https://mpetroff.net</link>
	<description>mpetroff.net</description>
	<lastBuildDate>Fri, 10 May 2019 22:29:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Finishing Google Summer of Code</title>
		<link>https://mpetroff.net/2013/09/finishing-google-summer-of-code/</link>
					<comments>https://mpetroff.net/2013/09/finishing-google-summer-of-code/#respond</comments>
		
		<dc:creator><![CDATA[Matthew Petroff]]></dc:creator>
		<pubDate>Fri, 20 Sep 2013 20:34:39 +0000</pubDate>
				<category><![CDATA[GSoC]]></category>
		<category><![CDATA[Google Summer of Code]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[units]]></category>
		<guid isPermaLink="false">http://www.mpetroff.net/?p=1130</guid>

					<description><![CDATA[I have now merged the second phase of my Google Summer of Code project, unit support improvements, into the Inkscape trunk. Back in April when I proposed this project, I thought refactoring Inkscape&#8217;s unit support would be the easier part &#8230; <a href="https://mpetroff.net/2013/09/finishing-google-summer-of-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap">I</span> have now merged the second phase of my Google Summer of Code project, unit support improvements, into the Inkscape trunk. Back in April when I proposed this project, I thought refactoring Inkscape&#8217;s unit support would be the easier part of the project and improving the unit support would be the more difficult part. In retrospect, the opposite was true. To refactor Inkscape&#8217;s unit support, I had to learn the details of all the different unit handling systems and become familiar with the rest of the code they interacted with. Inkscape contains over 500k lines of code, and learning the code base was the most time consuming part of this project. By the time I finished phase one, I was familiar with the unit support code and the code that used it, so extending unit support was fairly straightforward. The most difficult part of phase two was tracking down and fixing transform bugs the were manifested during document unit changes.</p>
<p>Highlights of phase two include:</p>
<ul>
<li>Use of real world units for page sizes</li>
<li>Use of real world document units via a <code>viewBox</code></li>
<li>Refactor of expression evaluator and addition of exponent operator to it</li>
<li>Addition of expression evaluator support to toolbars</li>
</ul>
<p><span id="more-1130"></span><br />
The unit support refactor during phase one made these improvements possible and will ease the development of future improvements. With the exception of object specific unit support, I finished everything in my proposal. In working on the project, I decided, due to the way units are defined in the SVG specification, that there&#8217;s no good way to store object specific units. This leaves having an Inkscape specific attribute that only affects the UI, but I&#8217;m not even sure if this behavior is desirable.</p>
<p>Two other ideas I picked up along the way that I would have liked to implement but didn&#8217;t get around to are an option to flip the y-axis in Inkscape and a configurable pixel to real world unit ratio. Implementing the former would involve some extensive refactoring due to the parts of Inkscape that are tied directly to the current document coordinate system. To say the latter isn&#8217;t implemented is only partially true. With the completion of phase one, all of Inkscape&#8217;s unit conversions are defined in <code>units.xml</code>. By editing this file, one can change the conversion factors Inkscape uses. For example, here is a <code>units.xml</code> file <a href="https://cdn0.mpetroff.net/wp-content/uploads/2013/09/units_10px_per_mm.xml">using a 10px/mm ratio</a>. The preceding file uses millimeters as the primary unit of length, unlike the current <code>units.xml</code> file that uses pixels. Therefore, the preceding file allows one to change the pixel to real world unit ratio by changing one line. An option could be added to the Inkscape preferences dialog to override this line, allowing one to easily set one&#8217;s preferred ratio, something I might add in the future.</p>
<p>I would like to thank my mentor, Johan Engelen, for his support and encouragement throughout this project, as well as the Inkscape community and Google for giving me this wonderful opportunity. It has been a good summer, and I hope to remain involved in the project for the foreseeable future.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mpetroff.net/2013/09/finishing-google-summer-of-code/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Bug Fixes</title>
		<link>https://mpetroff.net/2013/09/bug-fixes/</link>
					<comments>https://mpetroff.net/2013/09/bug-fixes/#respond</comments>
		
		<dc:creator><![CDATA[Matthew Petroff]]></dc:creator>
		<pubDate>Sun, 15 Sep 2013 21:05:04 +0000</pubDate>
				<category><![CDATA[GSoC]]></category>
		<category><![CDATA[Google Summer of Code]]></category>
		<category><![CDATA[GSocC]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[units]]></category>
		<guid isPermaLink="false">http://www.mpetroff.net/?p=1115</guid>

					<description><![CDATA[I have devoted the past two weeks to fixing bugs in my viewBox based document unit implementation, deciding against implementing the object specific units I mentioned in my previous post. The most serious bug fixed was a bug that caused &#8230; <a href="https://mpetroff.net/2013/09/bug-fixes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap">I</span> have devoted the past two weeks to fixing bugs in my <code>viewBox</code> based document unit implementation, deciding against implementing the object specific units I mentioned in my <a href="/2013/09/document-and-object-units/">previous post</a>. The most serious bug fixed was a bug that caused new objects to be defined in <code>px</code> with a transformation back to the document unit. A majority of the other bugs fixed were bugs in the transformations performed when changing the document unit from one unit to another. Just about everything is working properly now. With the Google Summer of Code drawing to close, I plan on fixing any remaining bugs I can find and merging my branch with the Inkscape trunk in the coming week.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mpetroff.net/2013/09/bug-fixes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Document and Object Units</title>
		<link>https://mpetroff.net/2013/09/document-and-object-units/</link>
					<comments>https://mpetroff.net/2013/09/document-and-object-units/#respond</comments>
		
		<dc:creator><![CDATA[Matthew Petroff]]></dc:creator>
		<pubDate>Sun, 01 Sep 2013 21:49:44 +0000</pubDate>
				<category><![CDATA[GSoC]]></category>
		<category><![CDATA[Google Summer of Code]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[units]]></category>
		<guid isPermaLink="false">http://www.mpetroff.net/?p=1098</guid>

					<description><![CDATA[I have now implemented pages sizes using real world units as well as document units using a viewBox as described in my previous post. Although it is mostly working, there are a few known bugs when changing the document unit, &#8230; <a href="https://mpetroff.net/2013/09/document-and-object-units/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap">I</span> have now implemented pages sizes using real world units as well as document units using a <code>viewBox</code> as described in my <a href="/2013/08/analysis-of-svg-units/">previous post</a>. Although it is mostly working, there are a few known bugs when changing the document unit, namely connectors and 3d boxes do not scale properly. I have also worked on fixing regressions introduced by the phase one unit refactor.</p>
<p>Besides document-wide units, it is also useful to have object specific units for convenience. As real world units are handled as scaling factors of the document unit by the SVG specification, they are only recommended for the document size, not individual objects, and their values are counterintuitive when a <code>viewBox</code> is used to specify document-wide units. Therefore, I&#8217;ve decided to implement object specific units using an <code>inkscape:unit</code> attribute instead, which will also allow for units not defined in the SVG specification, e.g. feet. The manner in which object sizes and positions are written to a SVG file will not change; the attribute will only be used to remember which unit should be displayed when an object is selected in the Inkscape UI.<br />
<span id="more-1098"></span><br />
Choosing the appropriate unit to display is trivial when only one object is selected or multiple objects are selected with the same unit&#8212;display the object&#8217;s or objects&#8217; unit. Things become more complicated, however, when objects with different units are selected. Either the unit selector can be left to keep its current unit, the document unit can be displayed, or the most common unit can be displayed, chosen arbitrarily when two or more units are equally common. I think leaving the unit selector alone is the most intuitive solution but am open to suggestions. When objects are deselected, the unit selector will return to its previous unit, unless the unit was manually changed while the objects were selected in which case it would retain its unit.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mpetroff.net/2013/09/document-and-object-units/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Analysis of SVG Units</title>
		<link>https://mpetroff.net/2013/08/analysis-of-svg-units/</link>
					<comments>https://mpetroff.net/2013/08/analysis-of-svg-units/#comments</comments>
		
		<dc:creator><![CDATA[Matthew Petroff]]></dc:creator>
		<pubDate>Sat, 24 Aug 2013 15:40:17 +0000</pubDate>
				<category><![CDATA[GSoC]]></category>
		<category><![CDATA[Google Summer of Code]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[units]]></category>
		<guid isPermaLink="false">http://www.mpetroff.net/?p=1068</guid>

					<description><![CDATA[Since my last update, my branch for phase one of my Google Summer of Code project, unit refactoring, has been merged into the Inkscape trunk. I have now created a new branch for phase two, improvement of unit support. In &#8230; <a href="https://mpetroff.net/2013/08/analysis-of-svg-units/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap">S</span>ince my last update, my branch for phase one of my Google Summer of Code project, unit refactoring, has been merged into the Inkscape trunk. I have now created <a href="https://code.launchpad.net/~matthewpetroff/inkscape/gsoc-2013-unit-improvement">a new branch</a> for phase two, improvement of unit support. In order to improve unit support, one must first start with how units are defined in the <a href="http://www.w3.org/TR/SVG/coords.html">SVG specification</a>. In SVG, there are two types of coordinates, those defined in user space and those defined in real world units. If no unit is specified, it is assumed to be in user space units. By defining the document size in real world units and applying an equivalent <code>viewBox</code> attribute, one can define the user space unit to be a real world unit, e.g. millimeters.</p>
<div class="highlighted-source default xml">
<pre><span></span><span class="cp">&lt;?xml version=&quot;1.0&quot; standalone=&quot;no&quot;?&gt;</span>
<span class="cp">&lt;!DOCTYPE svg PUBLIC &quot;-//W3C//DTD SVG 1.1//EN&quot; </span>
<span class="cp">  &quot;http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd&quot;&gt;</span>
<span class="nt">&lt;svg</span> <span class="na">width=</span><span class="s">&quot;74mm&quot;</span> <span class="na">height=</span><span class="s">&quot;52mm&quot;</span> <span class="na">version=</span><span class="s">&quot;1.1&quot;</span>
     <span class="na">viewBox=</span><span class="s">&quot;0 0 74 52&quot;</span> <span class="na">xmlns=</span><span class="s">&quot;http://www.w3.org/2000/svg&quot;</span><span class="nt">&gt;</span>
  <span class="cm">&lt;!-- The dimensions for this rectange are given in user space, but</span>
<span class="cm">       due to the viewBox attribute having the same values as the</span>
<span class="cm">       document size specified in millimeters, the user units are</span>
<span class="cm">       millimeters. --&gt;</span>
  <span class="nt">&lt;rect</span> <span class="na">x=</span><span class="s">&quot;10&quot;</span> <span class="na">y=</span><span class="s">&quot;5&quot;</span> <span class="na">width=</span><span class="s">&quot;30&quot;</span> <span class="na">height=</span><span class="s">&quot;20&quot;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/svg&gt;</span>
</pre>
</div>
<p><span style="border-style:solid;border-width:1px;display:inline-block"><br />
<img decoding="async" src="https://cdn0.mpetroff.net/wp-content/uploads/2013/08/viewbox.svg" alt="Viewbox diagram"></img><br />
</span></p>
<p>As the width and height of the document are 74mm and 52mm respectively and the <code>viewBox</code> stretches the user space width from 0 to 74 and the user space height from 0 to 52, the user space unit is equivalent to millimeters.<br />
<span id="more-1068"></span><br />
The other method for representing units is using real world units.</p>
<div class="highlighted-source default xml">
<pre><span></span><span class="cp">&lt;?xml version=&quot;1.0&quot; standalone=&quot;no&quot;?&gt;</span>
<span class="cp">&lt;!DOCTYPE svg PUBLIC &quot;-//W3C//DTD SVG 1.1//EN&quot; </span>
<span class="cp">  &quot;http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd&quot;&gt;</span>
<span class="nt">&lt;svg</span> <span class="na">width=</span><span class="s">&quot;74mm&quot;</span> <span class="na">height=</span><span class="s">&quot;52mm&quot;</span> <span class="na">version=</span><span class="s">&quot;1.1&quot;</span>
     <span class="na">xmlns=</span><span class="s">&quot;http://www.w3.org/2000/svg&quot;</span><span class="nt">&gt;</span>
  <span class="cm">&lt;!-- The dimensions for this rectange are given in real</span>
<span class="cm">       world units. --&gt;</span>
  <span class="nt">&lt;rect</span> <span class="na">x=</span><span class="s">&quot;10mm&quot;</span> <span class="na">y=</span><span class="s">&quot;5mm&quot;</span> <span class="na">width=</span><span class="s">&quot;30mm&quot;</span> <span class="na">height=</span><span class="s">&quot;20mm&quot;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/svg&gt;</span>
</pre>
</div>
<p><span style="border-style:solid;border-width:1px;display:inline-block"><br />
<img decoding="async" src="https://cdn0.mpetroff.net/wp-content/uploads/2013/08/realworld.svg" alt="Real world units diagram"></img><br />
</span></p>
<p>The dimensions of the rectangle are specifically specified in millimeters, giving the same result as the first example.</p>
<p>Unit handling becomes more troublesome when the two are combined, however.</p>
<div class="highlighted-source default xml">
<pre><span></span><span class="cp">&lt;?xml version=&quot;1.0&quot; standalone=&quot;no&quot;?&gt;</span>
<span class="cp">&lt;!DOCTYPE svg PUBLIC &quot;-//W3C//DTD SVG 1.1//EN&quot; </span>
<span class="cp">  &quot;http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd&quot;&gt;</span>
<span class="nt">&lt;svg</span> <span class="na">width=</span><span class="s">&quot;74mm&quot;</span> <span class="na">height=</span><span class="s">&quot;52mm&quot;</span> <span class="na">version=</span><span class="s">&quot;1.1&quot;</span>
     <span class="na">viewBox=</span><span class="s">&quot;0 0 74 52&quot;</span> <span class="na">xmlns=</span><span class="s">&quot;http://www.w3.org/2000/svg&quot;</span><span class="nt">&gt;</span>
  <span class="cm">&lt;!-- The dimensions for this rectange are given in real world</span>
<span class="cm">       units when the user space units are equivalent to real</span>
<span class="cm">       world units. --&gt;</span>
  <span class="nt">&lt;rect</span> <span class="na">x=</span><span class="s">&quot;10mm&quot;</span> <span class="na">y=</span><span class="s">&quot;5mm&quot;</span> <span class="na">width=</span><span class="s">&quot;30mm&quot;</span> <span class="na">height=</span><span class="s">&quot;20mm&quot;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/svg&gt;</span>
</pre>
</div>
<p><span style="border-style:solid;border-width:1px;display:inline-block"><br />
<img decoding="async" src="https://cdn0.mpetroff.net/wp-content/uploads/2013/08/combined.svg" alt="Combined units diagram"></img><br />
</span></p>
<p>While one might expect this example to be the same as the previous two, it is not due to the way units are handled in SVG. When no unit is specified, the unit is implicitly a <code>px</code>, e.g. <code>10</code> and <code>10px</code> are equivalent. Real world units are then defined in the specification as an exact number of pixels, e.g. <code>1mm</code> would be <code>3.543307px</code> and therefore <code>3.543307</code> user units at 90 pixels per inch resolution. Hence, the last example is scaled by a factor of <code>3.543307</code>. Also, if any sort of scaling transformations are applied, the size of real world units are scaled by an equivalent amount.</p>
<p>For implementation of document-wide default units, I plan on using the method illustrated in the first example, defining the page size in real world units and applying an appropriate <code>viewBox</code> attribute in addition to the current <code>inkscape:document-units</code> attribute. When other units are specified for individual objects, the unit will be specified on the dimensions, after first applying the appropriate transformation for user space units. Although this method, as well as transformations, will result in a similar loss of precision as the current method of specifying everything in <code>px</code>, I don&#8217;t see a better way and the appropriate unit will still be shown each time the object is selected.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mpetroff.net/2013/08/analysis-of-svg-units/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Completion of Phase One</title>
		<link>https://mpetroff.net/2013/08/completion-of-phase-one/</link>
					<comments>https://mpetroff.net/2013/08/completion-of-phase-one/#respond</comments>
		
		<dc:creator><![CDATA[Matthew Petroff]]></dc:creator>
		<pubDate>Thu, 01 Aug 2013 18:39:46 +0000</pubDate>
				<category><![CDATA[GSoC]]></category>
		<category><![CDATA[Google Summer of Code]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[units]]></category>
		<guid isPermaLink="false">http://www.mpetroff.net/?p=1055</guid>

					<description><![CDATA[When I began working on phase one of my Google Summer of Code project, Inkscape&#8217;s unit handling code was scattered between multiple implementations with different files using different, incompatible implementations. I since consolidated this code into one implementation, residing in &#8230; <a href="https://mpetroff.net/2013/08/completion-of-phase-one/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap">W</span>hen I began working on phase one of my Google Summer of Code project, Inkscape&#8217;s unit handling code was scattered between multiple implementations with different files using different, incompatible implementations. I since consolidated this code into one implementation, residing in <code>util/units.*</code>, eliminating <code>SPUnit</code>, <code>SPMetric</code>, and <code>unit-constants.h</code>.</p>
<p>I also started to replace the <code>SVGLength</code> class but then changed my mind about doing so as the class is specific to the SVG specification, not general units. For example, common units, e.g. feet, are not part of the specification. I still may make it a child class of <code>Util::Unit</code> during phase two, depending on how I end up implementing things, but will leave it alone for now.</p>
<p>With these changes, I have consolidated Inkscape&#8217;s unit handling code, completing phase one of my Google Summer of Code project. Although there are only some minor user-facing changes, mostly bug fixes, the internal changes will facilitate the addition of user-facing changes both in phase two and beyond. As an example, pixels per inch are no longer hard-coded, so I plan on adding an option both in Inkscape preferences and document properties to configure the relationship between pixels and physical units early on in phase two. To begin phase two, I plan on hand-crafting SVG files with various types of unit configurations and then implementing support for them starting with a default document-wide unit.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mpetroff.net/2013/08/completion-of-phase-one/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: cdn0.mpetroff.net
Minified using Disk

Served from: mpetroff.net @ 2026-03-28 17:08:11 by W3 Total Cache
-->