import svg curves with calculated point density based on length
This commit is contained in:
parent
42ef166830
commit
28cbc02dd2
1 changed files with 2 additions and 1 deletions
|
|
@ -37,7 +37,8 @@ function parse(text, opt = { soup: true }) {
|
||||||
let miter = path.userData?.style?.strokeMiterLimit;
|
let miter = path.userData?.style?.strokeMiterLimit;
|
||||||
if (fromSoup) {
|
if (fromSoup) {
|
||||||
for (let sub of path.subPaths) {
|
for (let sub of path.subPaths) {
|
||||||
let points = sub.getPoints();
|
let length = sub.getLength();
|
||||||
|
let points = sub.getPoints(sub.curves ? Math.max(length/2, 12) : undefined);
|
||||||
let poly = base.newPolygon().addPoints(points.map(p => base.newPoint(p.x, -p.y, 0)));
|
let poly = base.newPolygon().addPoints(points.map(p => base.newPoint(p.x, -p.y, 0)));
|
||||||
if (poly.appearsClosed()) poly.points.pop();
|
if (poly.appearsClosed()) poly.points.pop();
|
||||||
if (type === 'polyline') poly.setOpen(true);
|
if (type === 'polyline') poly.setOpen(true);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue