Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add the ability to have a slicing plane for one structure only#390

Open
Thibaulltt wants to merge 4 commits into
nmwsharp:master from
Thibaulltt:more-slicing-plane-options
Open

Add the ability to have a slicing plane for one structure only #390
Thibaulltt wants to merge 4 commits into
nmwsharp:master from
Thibaulltt:more-slicing-plane-options

Conversation

@Thibaulltt

@Thibaulltt Thibaulltt commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

I end up uploading tons of structures grouped into groups to polyscope at once, and analyze them later. When I want to hide a certain part of one structure, I can create a slicing plane and manually disable its effect on all structures I want to see whole, but this is time-consuming.

This PR adds the ability to add a slicing plane for one structure only, through that structure's Options > Slice planes menu in the Structures window. It does not change anything about the "global" slicing plane controls in View > Slice Planes.

Additionally, the buttons to add slice planes (both globally and per-structure) are now always visible in that structure's menu. I can thus quickly add structure-specific slicing planes at will even when some are already enabled.

Copy link
Copy Markdown
Contributor Author

As with my other PR, this is directly available to the polyscope-py library if its dependency to polyscope is bumped :)

Copy link
Copy Markdown
Contributor Author

Edit: by trying to have "fancy names" for the slicing planes (Slice plane of <structure name>), it ends up being more complicated/stateful with no real benefit. 9f340c1 removes the supplied name to addSlicePlane().

Copy link
Copy Markdown
Owner

I think this is a good change, I'm happy to merge it. I see some traffic on the PR here, let me know when it is good to go on your end.

Copy link
Copy Markdown
Contributor Author

Let me ponder on it 'till Friday!

Copy link
Copy Markdown
Contributor Author

I noticed MSVC does not define the 'and' and 'or' operators unless some compiler flags are enabled [1] (which is why the windows build fails). I have a patch ready for it, I'll send it on Friday if I don't find anything more in the meantime, to avoid restarting a full CI run :)

[1]: https://learn.microsoft.com/en-us/cpp/cpp/keywords-cpp?view=msvc-170 , note (b)

Copy link
Copy Markdown
Contributor Author

Hey! Sorry to get back to you a bit later than anticipated, things should be good w.r.t. the CI errors from previously.

I added the ability to keep the menu open for interaction with the slice plane menu of a single structure, as I found out while using it that I tended to add multiple slice planes and toggle on/off certain ones regularly. I push the ImGuiItemFlags_AutoClosePopups flag when opening the menu and pop it when going out of the menu. Feel free to accept the PR with or without it :)

Copy link
Copy Markdown
Contributor Author

Hey @nmwsharp, just a friendly ping to remind this PR is still waiting for a quick review :)

CI passed, only needs your approval on whether you want to keep the menu open, see my last comment for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /