Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make segment size configurable when calculating path length & bbox #93

Merged
merged 1 commit into from
Aug 31, 2022

Conversation

xiaoiver
Copy link
Contributor

@xiaoiver xiaoiver commented Aug 31, 2022

以下方法增加了可选配置项 options,内部会跳过不需要的计算过程(bbox 或长度),目前支持参数有 sampleSize,越少的采样点计算越快,但会牺牲一些精度:

getTotalLength(pathInput: string | PathArray, options?: Partial<PathLengthFactoryOptions>): number;
getPathBBox(path: string | PathArray, options?: Partial<PathLengthFactoryOptions>): PathBBox;
getPathBBoxTotalLength(
  path: PathArray,
  options?: Partial<PathLengthFactoryOptions>,
): PathBBoxTotalLength;

#92

@xiaoiver xiaoiver self-assigned this Aug 31, 2022
@xiaoiver xiaoiver merged commit e028c64 into master Aug 31, 2022
@xiaoiver xiaoiver deleted the fix-path branch August 31, 2022 07:26
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.

1 participant