An example of d3.geom.concaveHull. It basically wraps the implementation by Gregor Aisch and Jason Davies with Ian Johnson's padding hull padding while providing some dynamic edge cutting.
xxxxxxxxxx
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Concave Hulls</title>
<style>
</style>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.16/d3.min.js" charset="utf-8" type="text/javascript"></script>
<script src="d3.geom.concaveHull.js" charset="utf-8" type="text/javascript"></script>
<script type="text/javascript">
vertices = [[162, 332], [182, 299], [141, 292], [158, 264], [141, 408], [160, 400], [177, 430], [151, 442], [155, 425], [134, 430], [126, 447], [139, 466], [160, 471], [167, 447], [182, 466], [192, 442], [187, 413], [173, 403], [168, 425], [153, 413], [179, 275], [163, 292], [134, 270], [143, 315], [177, 320], [163, 311], [162, 281], [182, 255], [141, 226], [156, 235], [173, 207], [187, 230], [204, 194], [165, 189], [145, 201], [158, 167], [190, 165], [206, 145], [179, 153], [204, 114], [221, 138], [243, 112], [248, 139], [177, 122], [179, 99], [196, 82], [219, 90], [240, 75], [218, 61], [228, 53], [211, 34], [197, 51], [179, 65], [155, 70], [165, 85], [134, 80], [124, 58], [153, 44], [173, 34], [192, 27], [156, 19], [119, 32], [128, 17], [138, 36], [100, 58], [112, 73], [100, 92], [78, 100], [83, 78], [61, 63], [80, 44], [100, 26], [60, 39], [43, 71], [34, 54], [32, 90], [53, 104], [60, 82], [66, 99], [247, 94], [187, 180], [221, 168]];
defaultHull = d3.geom.concaveHull();
fixedLengthHull = d3.geom.concaveHull().distance(50);
fixedLengthHull2 = d3.geom.concaveHull().distance(100);
colorRamp = d3.scale.linear().domain([0,100]).range(["red", "blue"])
svg = d3.select("body")
.append("svg")
.attr("width", 1000)
.attr("height", 1000);
svg.append("g")
.attr("transform", "translate(0,0)")
.selectAll("path")
.data(defaultHull(vertices))
.enter().append("path")
.attr("d", function(d) { return "M" + d.join("L") + "Z"; })
.style("fill-opacity", 0.5)
.style("fill", function (d,i) {return colorRamp(i * 50)})
.style("stroke", "pink")
.style("stroke-width", "1px");
svg.append("g")
.attr("transform", "translate(300,0)")
.selectAll("path")
.data(fixedLengthHull(vertices))
.enter().append("path")
.attr("d", function(d) { return "M" + d.join("L") + "Z"; })
.style("fill-opacity", 0.5)
.style("fill", function (d,i) {return colorRamp(i * 50)})
.style("stroke", "pink")
.style("stroke-width", "1px");
svg.append("g")
.attr("transform", "translate(600,0)")
.selectAll("path")
.data(fixedLengthHull2(vertices))
.enter().append("path")
.attr("d", function(d) { return "M" + d.join("L") + "Z"; })
.style("fill-opacity", 0.5)
.style("fill", function (d,i) {return colorRamp(i * 50)})
.style("stroke", "pink")
.style("stroke-width", "1px");
</script>
</body>
</html>
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.16/d3.min.js