<?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=Njh</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=Njh"/>
	<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/Special:Contributions/Njh"/>
	<updated>2026-05-02T06:17:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=SpecFilletChamfer&amp;diff=49384</id>
		<title>SpecFilletChamfer</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=SpecFilletChamfer&amp;diff=49384"/>
		<updated>2009-04-02T05:59:20Z</updated>

		<summary type="html">&lt;p&gt;Njh: /* Existing Code? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Launchpad Entry:&lt;br /&gt;
https://blueprints.launchpad.net/inkscape/+spec/fillet-tool&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
The filleting tool will allow the user to replace the cusp of a corner on a path, with a rounding arc of specified radius. This is rather simple to the way we can round off the corners rectangles, but for arbitrary geometry.&lt;br /&gt;
&lt;br /&gt;
Note that this proposed tool will only work on corners in individual paths - not on the intersections of the strokes of separate objects.&lt;br /&gt;
&lt;br /&gt;
== Release Note ==&lt;br /&gt;
&lt;br /&gt;
== Rationale ==&lt;br /&gt;
A fillet/chamfer tool is useful for technical drawings where fillets and chamfers are needed often, and smoothing corners in artwork.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
=== User Interface ===&lt;br /&gt;
In terms of implementation, the filleting tool must be implemented as a sub-feature within the node edit tool. With the node tool selected, the user will select a series of points in a path that they would like to fillet. The user will then click the fillet button in the node context toolbar.&lt;br /&gt;
&lt;br /&gt;
With this fillet-tool-button clicked, and the an interactive fillet mode is activated. The node edit context toolbar will change to a fillet context toolbar. The fillet-tool-button will remain present on this new toolbar, but will be shown depressed to indicate that the filleting mode is activated. An edit box with spinner will be placed in the bar so that the user can choose the radius  numerically. At the same time handles will be shown on the canvas to allow the user to edit the radius interactively. Helper circles will give a preview of the end result.&lt;br /&gt;
&lt;br /&gt;
Once the user is happy with the fillet, the result can be committed by selecting a different tool or clicking the fillet-tool-button on toolbar (so as to un-depress it). To cancel, the user can press Esc, or can apply the change then Undo.&lt;br /&gt;
&lt;br /&gt;
It might be helpful to give the choice between placing a full circle object into the corner, a tangential arc object of the fillet, or actually filleting the corner with an arc which will modify the parent path to replace the cusp.&lt;br /&gt;
&lt;br /&gt;
This tool will give the option to chamfer the corner - where instead smoothing the corner with an arc, the corner is smoothed with a straight line - simply snipping the tip off.&lt;br /&gt;
&lt;br /&gt;
=== Back End ===&lt;br /&gt;
The illustration below shows the steps involved in filleting the corner of a path:&lt;br /&gt;
&lt;br /&gt;
[[Image:Fillet.png]]&lt;br /&gt;
&lt;br /&gt;
Filleting a corner is a 3-step process. First, the centre point for the arc must be calculated (X and Y in fig 1 and fig 2a). Second, the arc's sweep must be calculated so that it merges with the parent path at the tagents (fig 2b). Third, the point of the corner must be snipped off, and the arc welded on (fig 2c).&lt;br /&gt;
&lt;br /&gt;
All shapes must be converted to paths before filleting can occur.&lt;br /&gt;
&lt;br /&gt;
Finding point X is mathematically trivial. Finding Y is very much harder, and will require a numerical solution to a set of simultaneous equations. Note that there could potentially be more than one possible solution (as shown in fig 2a), so the closest solution to the cusp along the the length of bezier should be selected.&lt;br /&gt;
&lt;br /&gt;
=== More ideas ===&lt;br /&gt;
See [http://www.oberonplace.com/products/curveworks/index.htm]&lt;br /&gt;
&lt;br /&gt;
Cale Gibbard proposed another technique [https://bugs.launchpad.net/inkscape/+bug/202751 here], with an excellent [http://launchpadlibrarian.net/12692602/rcp.svg diagram] to explain it.&lt;br /&gt;
I think it's a very good solution, relatively easy to code and more &amp;quot;stable&amp;quot; under deformations of the original curve (in particular, there is always one and only one solution...). The output arc is not a perfect circle however, and it's radius is not explicitly controlled (depends on tangent angle at the corner). Maybe both option should be tested/implemented.&lt;br /&gt;
--[[User:Jfb|jfb]] 22:35, 17 March 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
&lt;br /&gt;
== Discussion ==&lt;br /&gt;
===Existing Code?===&lt;br /&gt;
* Q: Does anyone know of any existing code in the codebase that makes these sorts of calculations? So as to avoid reinventing the wheel and duplicating code?&lt;br /&gt;
&lt;br /&gt;
* A: These kind of calculations is being widely used in CAD applications, eg. in Qcad  (see: http://www.ribbonsoft.com/qcad.html ).&lt;br /&gt;
&lt;br /&gt;
* A: 2geom's filet-minion toy demonstrates how to implement this to compute 'Y'.  A nice emergent property of using self-intersections on the offset curves is that you can remove all tight spots, not just those on control handles.  However, the results aren't very visually pleasing to me.  There are no obvious numerical problems, but some difficulty in detecting loops.  If a student were to take on this project we could discuss techniques for accurately detecting the bad cases.&lt;/div&gt;</summary>
		<author><name>Njh</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Working_with_2Geom_FAQ&amp;diff=16652</id>
		<title>Working with 2Geom FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Working_with_2Geom_FAQ&amp;diff=16652"/>
		<updated>2007-10-31T17:11:33Z</updated>

		<summary type="html">&lt;p&gt;Njh: /* What does &amp;quot;compose&amp;quot; do? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Questions that arise during coding with 2geom are put here. To see other 2geom related questions go to the general [[lib2geom FAQ]].&lt;br /&gt;
&lt;br /&gt;
== Questions ==&lt;br /&gt;
&lt;br /&gt;
===How to create a straight line (for types: Path, pwd2, d2pw)?===&lt;br /&gt;
    Path p;&lt;br /&gt;
    p.appendNew&amp;lt;LineSegment&amp;gt;(a, b);&lt;br /&gt;
    &lt;br /&gt;
    Piecewise&amp;lt;D2&amp;lt;SBasis&amp;gt; &amp;gt; pwd2 = Piecewise&amp;lt;D2&amp;lt;SBasis&amp;gt; &amp;gt;(D2&amp;lt;SBasis&amp;gt;(Linear(a[X], b[X]), Linear(a[Y], b[Y])));&lt;br /&gt;
&lt;br /&gt;
===How to convert from Path to pwd2 to d2pw to path and back?===&lt;br /&gt;
&lt;br /&gt;
    D2&amp;lt;Piecewise&amp;lt;SBasis&amp;gt; &amp;gt; y = make_cuts_independant(x);&lt;br /&gt;
    x = sectionize(y);&lt;br /&gt;
&lt;br /&gt;
===How do I calculate the bounding box of a path?===&lt;br /&gt;
&lt;br /&gt;
    Rect r = path.boundsFast(); &lt;br /&gt;
or&lt;br /&gt;
    Rect r = path.boundsExact();&lt;br /&gt;
&lt;br /&gt;
===How do I convert 2geom to svgd and back?===&lt;br /&gt;
inkscape has code for this somewhere :p  (Johan knows this)&lt;br /&gt;
&lt;br /&gt;
===What does &amp;quot;compose&amp;quot; do?===&lt;br /&gt;
[http://en.wikipedia.org/wiki/Function_composition Compose] is the mathematical operation f(?) o g(?) = f(g(?)).  Any transformation, be it translation or mesh distort, can be considered a composition of the original path P(t)-&amp;gt;(u,v) and a function T(u,v)-&amp;gt;(x,y) which takes each point in the plane to a new point.  We write this transformation as compose(T, P).  For examples of such composition at work look at the toys&lt;br /&gt;
&lt;br /&gt;
* '2dsb2d', which composes the path with a polynomial mesh function called a coons patch&lt;br /&gt;
* 'plane3d', which composes the path with a 3d projection onto a plane surface&lt;br /&gt;
* 'center-warp', which shows how repeated composition produces the tweak tool effect&lt;br /&gt;
* 'path-along-path' which shows how composition allows mapping a shape along a path&lt;br /&gt;
&lt;br /&gt;
2Geom provides various compose operations for functions representable using piecewise sbasis functions, as well the ability to compose arbitrary functions defined directly in code.  All the mathematics is performed in sbasis space.&lt;/div&gt;</summary>
		<author><name>Njh</name></author>
	</entry>
</feed>