microsoft / microsoft/maker.js

Horizontal and vertical are not able to parse correctly

Open
#605 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2k
Forks
302
Avg merge
21h 28m
Merged PRs (30d)
5

Description

Req svg path

image

const x="M302.574 300.259H343.717C354.115 300.259 362.12 298.538 367.656 295.059 373.228 291.619 375.996 285.372 375.996 276.283 375.996 269.027 373.715 263.305 369.114 259.115 367.02 257.245 364.626 255.861 361.9697 254.925 359.837 254.178 357.481 253.617 354.8259 253.243 352.506 252.943 350.1509 252.832 347.794 252.832H347.794 302.574 302.574V300.259Z"
let baseModel: IModel = {};
baseModel.models = {}
baseModel.models[`x`]=importer.fromSVGPathData(path);
const chains = model.findChains() as IChain[];
const response = chainToSVGPathData(chains[0], [0, 0]);

response is as below
image

M302.574 300.259 L 343.717 300.259 A 75.5473785 75.5473785 0 0 0 352.6573831 299.7662396 A 47.2568676 47.2568676 0 0 0 360.5601638 298.182895 A 28.7335701 28.7335701 0 0 0 367.656 295.0590001 A 16.317001 16.317001 0 0 0 374.623102 285.9554424 A 27.6662737 27.6662737 0 0 0 375.8845043 279.3273737 A 40.1308876 40.1308876 0 0 0 375.9960002 276.2829999 A 27.8225639 27.8225639 0 0 0 375.0714504 268.9104358 A 20.1783028 20.1783028 0 0 0 369.114 259.115 A 21.1811901 21.1811901 0 0 0 361.97 254.925 A 33.8195518 33.8195518 0 0 0 358.1460987 253.84117 A 42.3360022 42.3360022 0 0 0 354.826 253.243 A 54.88622 54.88622 0 0 0 347.794 252.832 L 347.794 300.259 L 302.574 300.259 Z

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the case using importer.fromSVGPathData(path), model.findChains(), and chainToSVGPathData(chains[0], [0, 0]) with the SVG path shown. Compare the resulting path with the source, focusing on the horizontal H and vertical V commands. Done means those commands are parsed and emitted without changing the geometry.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.