--- title: Fillets ---
Fillets are round corners where two paths meet. Maker.js provides two types of fillets: traditional fillets and dogbone fillets.
Rounding a corner can add strength to your part, as well as make it faster to print. Using makerjs.path.fillet you can round a corner at the junction between two lines, two arcs, or a line and an arc. This function will clip the two paths that you pass it, and will return a new arc path which fits between the clipped ends. The paths must meet at one point, this is how it determines which ends of the paths to clip. You also provide a radius of the fillet. If the fillet cannot be created this function will return null.
{% highlight javascript %} //fillet between lines var makerjs = require('makerjs'); var model = { paths: { line1: new makerjs.paths.Line([0, 20], [30, 10]), line2: new makerjs.paths.Line([10, 0], [30, 10]) } }; //create a fillet var arc = makerjs.path.fillet(model.paths.line1, model.paths.line2, 2); //add the fillet to the model model.paths.arc = arc; var svg = makerjs.exporter.toSVG(model); document.write(svg); {% endhighlight %} {% highlight javascript %} //fillet between arcs var makerjs = require('makerjs'); var model = { paths: { arc1: new makerjs.paths.Arc([0, 50], 50, 270, 0), arc2: new makerjs.paths.Arc([100, 50], 50, 180, 270) } }; //create a fillet var arc = makerjs.path.fillet(model.paths.arc1, model.paths.arc2, 2); //add the fillet to the model model.paths.arc = arc; var svg = makerjs.exporter.toSVG(model); document.write(svg); {% endhighlight %} {% highlight javascript %} //fillet between line and arc (or arc and line!) var makerjs = require('makerjs'); var model = { paths: { arc: new makerjs.paths.Arc([0, 50], 50, 270, 0), line: new makerjs.paths.Line([50, 50], [50, 0]) } }; //create a fillet var arc2 = makerjs.path.fillet(model.paths.arc, model.paths.line, 2); //add the fillet to the model model.paths.arc2 = arc2; var svg = makerjs.exporter.toSVG(model); document.write(svg); {% endhighlight %}