Repository navigation
fix bug where make_compound_path kept all STOPs #16822
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,6 +330,7 @@ def make_compound_path(cls, *args): | |
| if not args: | ||
| return Path(np.empty([0, 2], dtype=np.float32)) | ||
|
|
||
| # concatenate paths | ||
| vertices = np.concatenate([x.vertices for x in args]) | ||
| codes = np.empty(len(vertices), dtype=cls.code_type) | ||
| i = 0 | ||
|
|
@@ -341,6 +342,16 @@ def make_compound_path(cls, *args): | |
| codes[i:i + len(path.codes)] = path.codes | ||
| i += len(path.vertices) | ||
|
|
||
| # remove internal STOP's, replace kinal stop if present | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo: final
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would also not bother with restoring the final STOP given that it doesn't matter and we may deprecate STOPs.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If that is acceptable, then I will document it and go with ignoring all STOPs.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. at least for me, it seems ok. |
||
| last_vert = None | ||
| if codes.size > 0 and codes[-1] == cls.STOP: | ||
| last_vert = vertices[-1] | ||
| vertices = vertices[codes != cls.STOP, :] | ||
| codes = codes[codes != cls.STOP] | ||
|
brunobeltran marked this conversation as resolved.
Resolved
|
||
| if last_vert is not None: | ||
| vertices = np.append(vertices, [last_vert], axis=0) | ||
| codes = np.append(codes, cls.STOP) | ||
|
|
||
| return cls(vertices, codes) | ||
|
|
||
| def __repr__(self): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.