-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add clipping plane support for X/Y/Z dimensions. #391
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #391 +/- ##
==========================================
- Coverage 88.93% 88.67% -0.27%
==========================================
Files 19 20 +1
Lines 1537 1616 +79
Branches 185 189 +4
==========================================
+ Hits 1367 1433 +66
- Misses 137 152 +15
+ Partials 33 31 -2
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Thanks, I will definitely merge this.
Maybe use the part color + hatch?
See above
Sounds fine
Would part color be a possibility? I did not look into the OCCT API for this.
Hm, maybe add the planes as helpers and control their properties via the existing property editor? |
🎉
So, I tried to just use the hatch API, and it failed to hatch. Some quick googling showed that some GL implementations don't actually support this, and the suggestion was just to use a texture map instead.
Yeah. This was my next thing to investigate. I will investigate if I can hook into the object added signal and then add a custom clipping plane to each part with a matching color.
That's an interesting idea... Let me explore the helpers and property editor to see if I can make this work. I could see that being more consistent. |
It is possible to just use the object material it seems. See: and |
So... tried to tweak things to implement per-object colors for the clipping plane... but assemblies get added to the viewer and the color I get out of it ends up being... the default color, even though it's an object composed of other objects with distinct colors: I need to see if I can "break up" the assembly that comes in and add clipping planes to each. |
Yeah, I'm not seeing any easy way to add a different clipping plane to the portions of the |
I don't understand what you mean here. AFAICT this is supported by OCCT already, no need to implement. Did you try setting e.g. https://dev.opencascade.org/doc/refman/html/class_graphic3d___clip_plane.html#a836e6040401113f600a419edef323831 |
I tried hooking into the Does that make sense? |
Yes and no. My claim (based on quickly inspecting OCCT code) is that this will be solved by using the SetUseObjectMaterial method. Did you try it? Does your experience confirm or contradict this claim? |
Playing a bit more, it seems that using that method, it uses the color of the first item added to the assembly as the material... So, not horrible as an experience? And for non-assemblies, it is properly picking up the color/material for each of those. Pushing the minor tweaks to use that for others to weigh in on. Still need to work changing this to put objects in and use the existing property editor for changing the settings for each clipping plane. |
* New widget for viewing the clipping plane settings. * Update the viewer to add clipping planes.
b111555
to
e55569b
Compare
Yes, it looks good enough. |
Adding this as a draft to get some feedback on the approach/direction. This would close #311 when completed.
Outstanding questions:
I also know the GUI for the clipping plane widget is lame, I will clean it up, but wanted some early feedback first.
Thanks for the great project!