<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.inkscape.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mk</id>
	<title>Inkscape Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.inkscape.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mk"/>
	<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/Special:Contributions/Mk"/>
	<updated>2026-04-10T13:43:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118538</id>
		<title>Path Library Improvement Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118538"/>
		<updated>2020-06-14T12:22:22Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page will hold all extra documentation that I intend to write as I progress in the project.&lt;br /&gt;
&lt;br /&gt;
The first functionality that I have succeeded to implement is Path Simplification.&lt;br /&gt;
&lt;br /&gt;
== Path Simplification ==&lt;br /&gt;
It is a two step process:&lt;br /&gt;
# Given a threshold value, break a path into line segments (we call this a polyline)&lt;br /&gt;
# Fit cubic bezier patches on the polyline such that the total error is controlled and the number of patches are kept minimum.&lt;br /&gt;
&lt;br /&gt;
=== Breaking up into line segments ===&lt;br /&gt;
While this process can be very simple if we simply use lib2geom's &amp;lt;code&amp;gt;Geom::Curve&amp;lt;/code&amp;gt; abstraction with a recursive path splitting algorithm. I think it's still better to use separate pieces of codes to deal with each type of curve separately. There are two advantages to doing this. Firstly, if you know the curve type, you can use a faster algorithm to do the splitting, secondly we can use the same path splitting algorithms as livarot does and have identical results.&lt;br /&gt;
&lt;br /&gt;
At the moment, I have custom code to deal with Cubic Bezier curves and Line Segments (&amp;lt;code&amp;gt;PathFlattener::breakLine&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PathFlattener::breakCubic&amp;lt;/code&amp;gt;) and for every other type a generalized function &amp;lt;code&amp;gt;PathFlattener::breakCurve&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Line Segments ====&lt;br /&gt;
Usually line segments aren't further broken at all. So only their endpoint is added to the sequence. However, if the flag &amp;lt;code&amp;gt;convertEvenLines&amp;lt;/code&amp;gt; is set, we break the line into smaller line segments such that each line segment has a length that's smaller than or equal to the threshold. This is useful in Path Simplification.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Cubic Beziers ====&lt;br /&gt;
[[File:Bezier-splitting.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
The algorithm that livarot uses to decide how/if to split a cubic curve is slightly complex to understand. Therefore, I decided it would be best to explain it with the help of a picture. The cubic bezier shown in the picture is defined by two endpoints $$\vec{P_{0}}$$ and $$\vec{P_{3}}$$ and two control points $$\vec{P_{1}}$$ and $$\vec{P_{1}}$$.&lt;br /&gt;
Now let us define three vectors:&lt;br /&gt;
\begin{align}\vec{sD} = \vec{P_{1}}-\vec{P_{0}}\end{align}&lt;br /&gt;
\begin{align}\vec{eD} = \vec{P_{3}}-\vec{P_{2}}\end{align}&lt;br /&gt;
\begin{align}\vec{se} = \vec{P_{3}}-\vec{P_{0}}\end{align}&lt;br /&gt;
Let us also define two scalar values:&lt;br /&gt;
\begin{align}Sy = |\vec{sD}|\sin\theta_{1}\end{align}&lt;br /&gt;
\begin{align}Ey = |\vec{eD}|\sin\theta_{2}\end{align}&lt;br /&gt;
$$\vec{sD}$$ is a vector from the first end point to the first control point, similarly, $$\vec{eD}$$ is a vector from second control point to the second end point, $$\vec{se}$$ is a vector from the first end point to the second end point. $$Sy$$ and $$Ey$$ are the projections of the vectors $$\vec{sD}$$ and $$\vec{eD}$$ on the the axis perpendicular to the vector $$\vec{se}$$.&lt;br /&gt;
&lt;br /&gt;
This cubic bezier can be approximated by a line segment through its endpoints if the following three conditions are true:&lt;br /&gt;
\begin{align}|\vec{se}| &amp;lt; 0.01\end{align}&lt;br /&gt;
\begin{align}|3\vec{sD}|^2 &amp;lt; threshold\end{align}&lt;br /&gt;
\begin{align}|3\vec{eD}|^2 &amp;lt; threshold\end{align}&lt;br /&gt;
&lt;br /&gt;
Or if the following four are true:&lt;br /&gt;
\begin{align}|\vec{se}| &amp;gt;= 0.01\end{align}&lt;br /&gt;
\begin{align}|3Sy| &amp;lt; threshold\end{align}&lt;br /&gt;
\begin{align}|3Ey| &amp;lt; threshold\end{align}&lt;br /&gt;
\begin{align}|\vec{se}| &amp;lt;= maxL\end{align}&lt;br /&gt;
&lt;br /&gt;
Otherwise, the bezier curve is split into two bezier curves as shown with colors magenta and green in the picture and then both are checked by the same conditions recursively. The center point (which is the common endpoint for both bezier curves) is added to the sequence of points.&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118537</id>
		<title>Path Library Improvement Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118537"/>
		<updated>2020-06-14T12:15:42Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page will hold all extra documentation that I intend to write as I progress in the project.&lt;br /&gt;
&lt;br /&gt;
The first functionality that I have succeeded to implement is Path Simplification.&lt;br /&gt;
&lt;br /&gt;
== Path Simplification ==&lt;br /&gt;
It is a two step process:&lt;br /&gt;
# Given a threshold value, break a path into line segments (we call this a polyline)&lt;br /&gt;
# Fit cubic bezier patches on the polyline such that the total error is controlled and the number of patches are kept minimum.&lt;br /&gt;
&lt;br /&gt;
=== Breaking up into line segments ===&lt;br /&gt;
While this process can be very simple if we simply use lib2geom's &amp;lt;code&amp;gt;Geom::Curve&amp;lt;/code&amp;gt; abstraction with a recursive path splitting algorithm. I think it's still better to use separate pieces of codes to deal with each type of curve separately. There are two advantages to doing this. Firstly, if you know the curve type, you can use a faster algorithm to do the splitting, secondly we can use the same path splitting algorithms as livarot does and have identical results.&lt;br /&gt;
&lt;br /&gt;
At the moment, I have custom code to deal with Cubic Bezier curves and Line Segments (&amp;lt;code&amp;gt;PathFlattener::breakLine&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PathFlattener::breakCubic&amp;lt;/code&amp;gt;) and for every other type a generalized function &amp;lt;code&amp;gt;PathFlattener::breakCurve&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Line Segments ====&lt;br /&gt;
Usually line segments aren't further broken at all. So only their endpoint is added to the sequence. However, if the flag &amp;lt;code&amp;gt;convertEvenLines&amp;lt;/code&amp;gt; is set, we break the line into smaller line segments such that each line segment has a length that's smaller than or equal to the threshold. This is useful in Path Simplification.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Cubic Beziers ====&lt;br /&gt;
[[File:Bezier-splitting.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
The algorithm that livarot uses to decide how/if to split a cubic curve is slightly complex to understand. Therefore, I decided it would be best to explain it with the help of a picture. The cubic bezier shown in the picture is defined by two endpoints $$\vec{P_{0}}$$ and $$\vec{P_{3}}$$ and two control points $$\vec{P_{1}}$$ and $$\vec{P_{1}}$$.&lt;br /&gt;
Now let us define three vectors:&lt;br /&gt;
\begin{align}\vec{sD} = \vec{P_{1}}-\vec{P_{0}}\end{align}&lt;br /&gt;
\begin{align}\vec{eD} = \vec{P_{3}}-\vec{P_{2}}\end{align}&lt;br /&gt;
\begin{align}\vec{se} = \vec{P_{3}}-\vec{P_{0}}\end{align}&lt;br /&gt;
Let us also define two scalar values:&lt;br /&gt;
\begin{align}Sy = |\vec{sD}|\sin\theta_{1}\end{align}&lt;br /&gt;
\begin{align}Ey = |\vec{eD}|\sin\theta_{2}\end{align}&lt;br /&gt;
$$\vec{sD}$$ is a vector from the first end point to the first control point, similarly, $$\vec{eD}$$ is a vector from second control point to the second end point, $$\vec{se}$$ is a vector from the first end point to the second end point. $$Sy$$ and $$Ey$$ are the projections of the vectors $$\vec{sD}$$ and $$\vec{eD}$$ on the vector $$\vec{se}$$.&lt;br /&gt;
&lt;br /&gt;
This cubic bezier can be approximated by a line segment through its endpoints if the following three conditions are true:&lt;br /&gt;
\begin{align}|\vec{se}| &amp;lt; 0.01\end{align}&lt;br /&gt;
\begin{align}|3\vec{sD}|^2 &amp;lt; threshold\end{align}&lt;br /&gt;
\begin{align}|3\vec{eD}|^2 &amp;lt; threshold\end{align}&lt;br /&gt;
&lt;br /&gt;
Or if the following four are true:&lt;br /&gt;
\begin{align}|\vec{se}| &amp;gt;= 0.01\end{align}&lt;br /&gt;
\begin{align}|3Sy| &amp;lt; threshold\end{align}&lt;br /&gt;
\begin{align}|3Ey| &amp;lt; threshold\end{align}&lt;br /&gt;
\begin{align}|\vec{se}| &amp;lt;= maxL\end{align}&lt;br /&gt;
&lt;br /&gt;
Otherwise, the bezier curve is split into two bezier curves as shown with colors magenta and green in the picture and then both are checked by the same conditions recursively. The center point (which is the common endpoint for both bezier curves) is added to the sequence of points.&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118536</id>
		<title>Path Library Improvement Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118536"/>
		<updated>2020-06-14T12:01:02Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page will hold all extra documentation that I intend to write as I progress in the project.&lt;br /&gt;
&lt;br /&gt;
The first functionality that I have succeeded to implement is Path Simplification.&lt;br /&gt;
&lt;br /&gt;
== Path Simplification ==&lt;br /&gt;
It is a two step process:&lt;br /&gt;
# Given a threshold value, break a path into line segments (we call this a polyline)&lt;br /&gt;
# Fit cubic bezier patches on the polyline such that the total error is controlled and the number of patches are kept minimum.&lt;br /&gt;
&lt;br /&gt;
=== Breaking up into line segments ===&lt;br /&gt;
While this process can be very simple if we simply use lib2geom's &amp;lt;code&amp;gt;Geom::Curve&amp;lt;/code&amp;gt; abstraction with a recursive path splitting algorithm. I think it's still better to use separate pieces of codes to deal with each type of curve separately. There are two advantages to doing this. Firstly, if you know the curve type, you can use a faster algorithm to do the splitting, secondly we can use the same path splitting algorithms as livarot does and have identical results.&lt;br /&gt;
&lt;br /&gt;
At the moment, I have custom code to deal with Cubic Bezier curves and Line Segments (&amp;lt;code&amp;gt;PathFlattener::breakLine&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PathFlattener::breakCubic&amp;lt;/code&amp;gt;) and for every other type a generalized function &amp;lt;code&amp;gt;PathFlattener::breakCurve&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Line Segments ====&lt;br /&gt;
Usually line segments aren't further broken at all. So only their endpoint is added to the sequence. However, if the flag &amp;lt;code&amp;gt;convertEvenLines&amp;lt;/code&amp;gt; is set, we break the line into smaller line segments such that each line segment has a length that's smaller than or equal to the threshold. This is useful in Path Simplification.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Cubic Beziers ====&lt;br /&gt;
[[File:Bezier-splitting.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
The algorithm that livarot uses to decide how/if to split a cubic curve is slightly complex to understand. Therefore, I decided it would be best to explain it with the help of a picture. The cubic bezier shown in the picture is defined by two endpoints $$\vec{P_{0}}$$ and $$\vec{P_{3}}$$ and two control points $$\vec{P_{1}}$$ and $$\vec{P_{1}}$$.&lt;br /&gt;
Now let us define three vectors:&lt;br /&gt;
\begin{align}\vec{sD} = \vec{P_{1}}-\vec{P_{0}}\end{align}&lt;br /&gt;
\begin{align}\vec{eD} = \vec{P_{3}}-\vec{P_{2}}\end{align}&lt;br /&gt;
\begin{align}\vec{se} = \vec{P_{3}}-\vec{P_{0}}\end{align}&lt;br /&gt;
Let us also define two scalar values:&lt;br /&gt;
\begin{align}Sy = |\vec{sD}|\sin\theta_{1}\end{align}&lt;br /&gt;
\begin{align}Ey = |\vec{eD}|\sin\theta_{2}\end{align}&lt;br /&gt;
$$\vec{sD}$$ is a vector from the first end point to the first control point, similarly, $$\vec{eD}$$ is a vector from second control point to the second end point, $$\vec{se}$$ is a vector from the first end point to the second end point. $$Sy$$ and $$Ey$$ are the projections of the vectors $$\vec{sD}$$ and $$\vec{eD}$$ on the vector $$\vec{se}$$.&lt;br /&gt;
&lt;br /&gt;
This cubic bezier can be approximated by a line segment through its endpoints if:&lt;br /&gt;
\begin{align}|\vec{se}| &amp;lt; 0.01 \&amp;amp; |3\vec{sD}|^2 &amp;lt; threshold \&amp;amp; |3\vec{eD}|^2 &amp;lt; threshold\end{align}&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118535</id>
		<title>Path Library Improvement Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118535"/>
		<updated>2020-06-14T11:46:49Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page will hold all extra documentation that I intend to write as I progress in the project.&lt;br /&gt;
&lt;br /&gt;
The first functionality that I have succeeded to implement is Path Simplification.&lt;br /&gt;
&lt;br /&gt;
== Path Simplification ==&lt;br /&gt;
It is a two step process:&lt;br /&gt;
# Given a threshold value, break a path into line segments (we call this a polyline)&lt;br /&gt;
# Fit cubic bezier patches on the polyline such that the total error is controlled and the number of patches are kept minimum.&lt;br /&gt;
&lt;br /&gt;
=== Breaking up into line segments ===&lt;br /&gt;
While this process can be very simple if we simply use lib2geom's &amp;lt;code&amp;gt;Geom::Curve&amp;lt;/code&amp;gt; abstraction with a recursive path splitting algorithm. I think it's still better to use separate pieces of codes to deal with each type of curve separately. There are two advantages to doing this. Firstly, if you know the curve type, you can use a faster algorithm to do the splitting, secondly we can use the same path splitting algorithms as livarot does and have identical results.&lt;br /&gt;
&lt;br /&gt;
At the moment, I have custom code to deal with Cubic Bezier curves and Line Segments (&amp;lt;code&amp;gt;PathFlattener::breakLine&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PathFlattener::breakCubic&amp;lt;/code&amp;gt;) and for every other type a generalized function &amp;lt;code&amp;gt;PathFlattener::breakCurve&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Line Segments ====&lt;br /&gt;
Usually line segments aren't further broken at all. So only their endpoint is added to the sequence. However, if the flag &amp;lt;code&amp;gt;convertEvenLines&amp;lt;/code&amp;gt; is set, we break the line into smaller line segments such that each line segment has a length that's smaller than or equal to the threshold. This is useful in Path Simplification.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Cubic Beziers ====&lt;br /&gt;
[[File:Bezier-splitting.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
The algorithm that livarot uses to decide how/if to split a cubic curve is slightly complex to understand. Therefore, I decided it would be best to explain it with the help of a picture. The cubic bezier shown in the picture is defined by two endpoints $$\vec{P_{0}}$$ and $$\vec{P_{3}}$$ and two control points $$\vec{P_{1}}$$ and $$\vec{P_{1}}$$.&lt;br /&gt;
Now let us define three vectors:&lt;br /&gt;
\begin{align}\vec{sD} = \vec{P_{1}}-\vec{P_{0}}\end{align}&lt;br /&gt;
\begin{align}\vec{eD} = \vec{P_{3}}-\vec{P_{2}}\end{align}&lt;br /&gt;
\begin{align}\vec{se} = \vec{P_{3}}-\vec{P_{0}}\end{align}&lt;br /&gt;
Let us also define two scalar values:&lt;br /&gt;
\begin{align}Sy = |\vec{sD}|\sin\theta_{1}\end{align}&lt;br /&gt;
\begin{align}Ey = |\vec{eD}|\sin\theta_{2}\end{align}&lt;br /&gt;
$$\vec{sD}$$ is a vector from the first end point to the first control point, similarly, $$\vec{eD}$$ is a vector from second control point to the second end point.&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118534</id>
		<title>Path Library Improvement Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118534"/>
		<updated>2020-06-14T11:30:30Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page will hold all extra documentation that I intend to write as I progress in the project.&lt;br /&gt;
&lt;br /&gt;
The first functionality that I have succeeded to implement is Path Simplification.&lt;br /&gt;
&lt;br /&gt;
== Path Simplification ==&lt;br /&gt;
It is a two step process:&lt;br /&gt;
# Given a threshold value, break a path into line segments (we call this a polyline)&lt;br /&gt;
# Fit cubic bezier patches on the polyline such that the total error is controlled and the number of patches are kept minimum.&lt;br /&gt;
&lt;br /&gt;
=== Breaking up into line segments ===&lt;br /&gt;
While this process can be very simple if we simply use lib2geom's &amp;lt;code&amp;gt;Geom::Curve&amp;lt;/code&amp;gt; abstraction with a recursive path splitting algorithm. I think it's still better to use separate pieces of codes to deal with each type of curve separately. There are two advantages to doing this. Firstly, if you know the curve type, you can use a faster algorithm to do the splitting, secondly we can use the same path splitting algorithms as livarot does and have identical results.&lt;br /&gt;
&lt;br /&gt;
At the moment, I have custom code to deal with Cubic Bezier curves and Line Segments (&amp;lt;code&amp;gt;PathFlattener::breakLine&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PathFlattener::breakCubic&amp;lt;/code&amp;gt;) and for every other type a generalized function &amp;lt;code&amp;gt;PathFlattener::breakCurve&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Line Segments ====&lt;br /&gt;
Usually line segments aren't further broken at all. So only their endpoint is added to the sequence. However, if the flag &amp;lt;code&amp;gt;convertEvenLines&amp;lt;/code&amp;gt; is set, we break the line into smaller line segments such that each line segment has a length that's smaller than or equal to the threshold. This is useful in Path Simplification.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Cubic Beziers ====&lt;br /&gt;
[[File:Bezier-splitting.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
The algorithm that livarot uses to decide how/if to split a cubic curve is slightly complex to understand. Therefore, I decided it would be best to explain it with the help of a picture. The cubic bezier shown in the picture is defined by two endpoints $\vec{P_{0}}$ and $\vec{P_{3}}$ and two control points $\vec{P_{1}}$ and $\vec{P_{1}}$.&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118533</id>
		<title>Path Library Improvement Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118533"/>
		<updated>2020-06-14T11:00:06Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page will hold all extra documentation that I intend to write as I progress in the project.&lt;br /&gt;
&lt;br /&gt;
The first functionality that I have succeeded to implement is Path Simplification.&lt;br /&gt;
&lt;br /&gt;
== Path Simplification ==&lt;br /&gt;
It is a two step process:&lt;br /&gt;
# Given a threshold value, break a path into line segments (we call this a polyline)&lt;br /&gt;
# Fit cubic bezier patches on the polyline such that the total error is controlled and the number of patches are kept minimum.&lt;br /&gt;
&lt;br /&gt;
=== Breaking up into line segments ===&lt;br /&gt;
While this process can be very simple if we simply use lib2geom's &amp;lt;code&amp;gt;Geom::Curve&amp;lt;/code&amp;gt; abstraction with a recursive path splitting algorithm. I think it's still better to use separate pieces of codes to deal with each type of curve separately. There are two advantages to doing this. Firstly, if you know the curve type, you can use a faster algorithm to do the splitting, secondly we can use the same path splitting algorithms as livarot does and have identical results.&lt;br /&gt;
&lt;br /&gt;
At the moment, I have custom code to deal with Cubic Bezier curves and Line Segments (&amp;lt;code&amp;gt;PathFlattener::breakLine&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PathFlattener::breakCubic&amp;lt;/code&amp;gt;) and for every other type a generalized function &amp;lt;code&amp;gt;PathFlattener::breakCurve&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Line Segments ====&lt;br /&gt;
Usually line segments aren't further broken at all. So only their endpoint is added to the sequence. However, if the flag &amp;lt;code&amp;gt;convertEvenLines&amp;lt;/code&amp;gt; is set, we break the line into smaller line segments such that each line segment has a length that's smaller than or equal to the threshold. This is useful in Path Simplification.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Cubic Beziers ====&lt;br /&gt;
[[File:Bezier-splitting.png|thumb]]&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=File:Bezier-splitting.png&amp;diff=118532</id>
		<title>File:Bezier-splitting.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=File:Bezier-splitting.png&amp;diff=118532"/>
		<updated>2020-06-14T10:59:42Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Splitting a cubic Bezier curve into two&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118531</id>
		<title>Path Library Improvement Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118531"/>
		<updated>2020-06-14T09:01:48Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page will hold all extra documentation that I intend to write as I progress in the project.&lt;br /&gt;
&lt;br /&gt;
The first functionality that I have succeeded to implement is Path Simplification.&lt;br /&gt;
&lt;br /&gt;
== Path Simplification ==&lt;br /&gt;
It is a two step process:&lt;br /&gt;
# Given a threshold value, break a path into line segments (we call this a polyline)&lt;br /&gt;
# Fit cubic bezier patches on the polyline such that the total error is controlled and the number of patches are kept minimum.&lt;br /&gt;
&lt;br /&gt;
=== Breaking up into line segments ===&lt;br /&gt;
While this process can be very simple if we simply use lib2geom's &amp;lt;code&amp;gt;Geom::Curve&amp;lt;/code&amp;gt; abstraction with a recursive path splitting algorithm. I think it's still better to use separate pieces of codes to deal with each type of curve separately. There are two advantages to doing this. Firstly, if you know the curve type, you can use a faster algorithm to do the splitting, secondly we can use the same path splitting algorithms as livarot does and have identical results.&lt;br /&gt;
&lt;br /&gt;
At the moment, I have custom code to deal with Cubic Bezier curves and Line Segments (&amp;lt;code&amp;gt;PathFlattener::breakLine&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PathFlattener::breakCubic&amp;lt;/code&amp;gt;) and for every other type a generalized function &amp;lt;code&amp;gt;PathFlattener::breakCurve&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Line Segments ====&lt;br /&gt;
Usually line segments aren't further broken at all. So only their endpoint is added to the sequence. However, if the flag &amp;lt;code&amp;gt;convertEvenLines&amp;lt;/code&amp;gt; is set, we break the line into smaller line segments such that each line segment has a length that's smaller than or equal to the threshold. This is useful in Path Simplification.&lt;br /&gt;
&lt;br /&gt;
==== Breaking Cubic Beziers ====&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118530</id>
		<title>Path Library Improvement Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118530"/>
		<updated>2020-06-14T08:56:47Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page will hold all extra documentation that I intend to write as I progress in the project.&lt;br /&gt;
&lt;br /&gt;
The first functionality that I have succeeded to implement is Path Simplification.&lt;br /&gt;
&lt;br /&gt;
== Path Simplification ==&lt;br /&gt;
It is a two step process:&lt;br /&gt;
# Given a threshold value, break a path into line segments (we call this a polyline)&lt;br /&gt;
# Fit cubic bezier patches on the polyline such that the total error is controlled and the number of patches are kept minimum.&lt;br /&gt;
&lt;br /&gt;
=== Breaking up into line segments ===&lt;br /&gt;
While this process can be very simple if we simply use lib2geom's &amp;lt;code&amp;gt;Geom::Curve&amp;lt;/code&amp;gt; abstraction with a recursive path splitting algorithm. I think it's still better to use separate pieces of codes to deal with each type of curve separately. There are two advantages to doing this. Firstly, if you know the curve type, you can use a faster algorithm to do the splitting, secondly we can use the same path splitting algorithms as livarot does and have identical results.&lt;br /&gt;
&lt;br /&gt;
At the moment, I have custom code to deal with Cubic Bezier curves and Line Segments (&amp;lt;code&amp;gt;PathFlattener::breakLine&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PathFlattener::breakCubic&amp;lt;/code&amp;gt;) and for every other type a generalized function &amp;lt;code&amp;gt;PathFlattener::breakCurve&amp;lt;/code&amp;gt; is used.&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118529</id>
		<title>Path Library Improvement Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118529"/>
		<updated>2020-06-14T08:50:59Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page will hold all extra documentation that I intend to write as I progress in the project.&lt;br /&gt;
&lt;br /&gt;
The first functionality that I have succeeded to implement is Path Simplification.&lt;br /&gt;
&lt;br /&gt;
== Path Simplification ==&lt;br /&gt;
It is a two step process:&lt;br /&gt;
# Given a threshold value, break a path into line segments (we call this a polyline)&lt;br /&gt;
# Fit cubic bezier patches on the polyline such that the total error is controlled and the number of patches are kept minimum.&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118528</id>
		<title>Path Library Improvement Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Path_Library_Improvement_Project&amp;diff=118528"/>
		<updated>2020-06-14T08:45:54Z</updated>

		<summary type="html">&lt;p&gt;Mk: Created page with &amp;quot;This wiki page will hold all extra documentation that I intend to write as I progress in the project.  The first functionality that I have succeeded to implement is Path Simpl...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page will hold all extra documentation that I intend to write as I progress in the project.&lt;br /&gt;
&lt;br /&gt;
The first functionality that I have succeeded to implement is Path Simplification.&lt;br /&gt;
&lt;br /&gt;
== Path Simplification ==&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Killing_Livarot&amp;diff=118527</id>
		<title>Killing Livarot</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Killing_Livarot&amp;diff=118527"/>
		<updated>2020-06-14T08:44:10Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details work items that need to be done to remove Livarot from the code base.&lt;br /&gt;
&lt;br /&gt;
==Work items==&lt;br /&gt;
&lt;br /&gt;
* Boolean operations&lt;br /&gt;
** Initial code in 2Geom, needs more work. MSc thesis subject of Krzysztof Kosiński&lt;br /&gt;
* Tweak tool&lt;br /&gt;
* Crazy libnrtype dependency&lt;br /&gt;
** libnrtype uses Livarot for line-breaking text in flow regions&lt;br /&gt;
* Offset tool&lt;br /&gt;
** Path outliner worked on by Liam will eventually be a direct replacement&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Exploring Livarot]]&lt;br /&gt;
* [[Path Library Improvement Project]]&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Exploring_Livarot&amp;diff=117600</id>
		<title>Exploring Livarot</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Exploring_Livarot&amp;diff=117600"/>
		<updated>2020-03-23T08:01:37Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Why is it being used?===&lt;br /&gt;
# Tweak Tool&lt;br /&gt;
# Path Offsetting&lt;br /&gt;
# Boolean Operations&lt;br /&gt;
# Flowing Text&lt;br /&gt;
# Path Simplification&lt;br /&gt;
# Path Flattening&lt;br /&gt;
&lt;br /&gt;
===How's it typically used?===&lt;br /&gt;
# Creating a livarot &amp;lt;code&amp;gt;Path&amp;lt;/code&amp;gt; object by using Inkscape’s functions such as &amp;lt;code&amp;gt;Path_for_item&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Path_for_pathvector&amp;lt;/code&amp;gt;. These functions just store path descriptions inside the &amp;lt;code&amp;gt;Path&amp;lt;/code&amp;gt; object. Such as &amp;lt;code&amp;gt;moveTo&amp;lt;/code&amp;gt;,&amp;lt;code&amp;gt;lineTo&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;cubicTo&amp;lt;/code&amp;gt;, etc. These are just instructions.&lt;br /&gt;
# Calling &amp;lt;code&amp;gt;path-&amp;amp;gt;Convert&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;path-&amp;amp;gt;ConvertWithBackData&amp;lt;/code&amp;gt;. Given a threshold value, these functions create a polygon that approximates the path descriptions given in step 1. The smaller the threshold value, the better the approximation. This approximation is the fundamental tool of livarot that gives it the ability to do things like path boolean operations.&lt;br /&gt;
# Calling &amp;lt;code&amp;gt;path-&amp;amp;gt;Fill(shape, ...)&amp;lt;/code&amp;gt; . This creates a directed graph structure from the approximated polygon. A directed graph just has points connected by edges.&lt;br /&gt;
# Calling &amp;lt;code&amp;gt;shape-&amp;amp;gt;ConvertToShape(shape_input, ...)&amp;lt;/code&amp;gt;. This function converts the graph created earlier, to a polygon without any self-intersections or duplicate points. It is one of the most important functions of livarot. It also takes a fill rule as the argument.&lt;br /&gt;
# Here whatever actual function you wanna perform is called. If you’re tweaking, you would call &amp;lt;code&amp;gt;shape-&amp;amp;gt;MakeTweak&amp;lt;/code&amp;gt;, if you’re performing outset/inset, you’d call &amp;lt;code&amp;gt;shape-&amp;amp;gt;MakeOffset&amp;lt;/code&amp;gt;. Similar functions exist for boolean operations.&lt;br /&gt;
# Calling &amp;lt;code&amp;gt;shape-&amp;amp;gt;ConvertToForme(path)&amp;lt;/code&amp;gt;. This converts the shape object back to a path whose SVG description you can grab and put in the XML tree.&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Exploring_Livarot&amp;diff=117599</id>
		<title>Exploring Livarot</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Exploring_Livarot&amp;diff=117599"/>
		<updated>2020-03-23T06:39:01Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Why is it being used?===&lt;br /&gt;
# Tweak Tool&lt;br /&gt;
# Path Offsetting&lt;br /&gt;
# Boolean Operations&lt;br /&gt;
# Flowing Text&lt;br /&gt;
# Path Simplification&lt;br /&gt;
# Path Flattening&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Exploring_Livarot&amp;diff=117598</id>
		<title>Exploring Livarot</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Exploring_Livarot&amp;diff=117598"/>
		<updated>2020-03-23T06:30:44Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Why is it being used?===&lt;br /&gt;
# Tweak Tool&lt;br /&gt;
# Path Offsetting&lt;br /&gt;
# Boolean Operations&lt;br /&gt;
# Flowing Text&lt;br /&gt;
# Path Simplification&lt;br /&gt;
&lt;br /&gt;
===Detailed List===&lt;br /&gt;
# Tweak Tool&lt;br /&gt;
#* &amp;lt;code&amp;gt;sp_tweak_dilate_recursive()&amp;lt;/code&amp;gt; in ''src/ui/tools/tweak-tool.cpp'' uses &amp;lt;code&amp;gt;shape-&amp;gt;MakeTweak&amp;lt;/code&amp;gt; for tweak modes such as &amp;lt;code&amp;gt;TWEAK_MODE_SHRINK_GROW&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TWEAK_MODE_ATTRACT_REPEL&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TWEAK_MODE_PUSH&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TWEAK_MODE_ROUGHEN&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Path Offsetting&lt;br /&gt;
#*&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Exploring_Livarot&amp;diff=117597</id>
		<title>Exploring Livarot</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Exploring_Livarot&amp;diff=117597"/>
		<updated>2020-03-23T06:13:19Z</updated>

		<summary type="html">&lt;p&gt;Mk: Created page with &amp;quot;===Why is it being used?=== # Path Offsetting # Tweak Tool # Boolean Operations # Flowing Text&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Why is it being used?===&lt;br /&gt;
# Path Offsetting&lt;br /&gt;
# Tweak Tool&lt;br /&gt;
# Boolean Operations&lt;br /&gt;
# Flowing Text&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Killing_Livarot&amp;diff=117589</id>
		<title>Killing Livarot</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Killing_Livarot&amp;diff=117589"/>
		<updated>2020-03-22T15:30:56Z</updated>

		<summary type="html">&lt;p&gt;Mk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details work items that need to be done to remove Livarot from the code base.&lt;br /&gt;
&lt;br /&gt;
==Work items==&lt;br /&gt;
&lt;br /&gt;
* Boolean operations&lt;br /&gt;
** Initial code in 2Geom, needs more work. MSc thesis subject of Krzysztof Kosiński&lt;br /&gt;
* Tweak tool&lt;br /&gt;
* Crazy libnrtype dependency&lt;br /&gt;
** libnrtype uses Livarot for line-breaking text in flow regions&lt;br /&gt;
* Offset tool&lt;br /&gt;
** Path outliner worked on by Liam will eventually be a direct replacement&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Exploring Livarot]]&lt;/div&gt;</summary>
		<author><name>Mk</name></author>
	</entry>
</feed>