Skip to content

Conversation

@armano2
Copy link
Contributor

@armano2 armano2 commented Mar 17, 2025

Proposed changes

  • Adds new simplification transformer that removed collinear line segments

in theory i could be done differently by removing last point and updating previous one, but regular transformers can't modify previous items and thus it requires all commands

Code quality

  • I made some tests for my changes

License

To get your contribution merged, you must check the following.

  • I read the project license in the LICENSE file
  • I agree with publishing under this project license

'y' in cmd ? cmd.y + (isRelatve ? pYAbs : 0) : pYAbs,
];
}),
);
Copy link
Contributor Author

@armano2 armano2 Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was thinking about using TO_ABS instead but i would also need to normalize HV, and this is easier

technically i could do all of this in single loop, by skipping first 2 points and removing3ht one and updating 2nd one, and i'm not sure if SVGPathDataTransformer.INFO is even needed in here

@armano2 armano2 changed the title feat: add removeCollinear method to optimize SVG path data feat: add removeCollinear to optimize SVG path data Mar 20, 2025
@nfroidure nfroidure merged commit dc7e045 into nfroidure:main Jun 16, 2025
1 check passed
@armano2 armano2 deleted the feat/remove_colinear_transformer branch June 17, 2025 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants