FreeCAD icon indicating copy to clipboard operation
FreeCAD copied to clipboard

per view clipping plane

Open nmschulte opened this issue 1 year ago • 12 comments

This isn't perfect ... fixes #18086 ...

  • ~~the custom clip/view direction vector component logic is wrong~~
  • ~~the four value's single-step and min-decimal values are not restored~~
  • ~~the CommandView updateView/MDIView->View3DInventor pipe can probably be cleaned up~~
  • there's no easy way to reset [a view's] clipping planes, or otherwise manage or investigate them

nmschulte avatar Nov 23 '24 12:11 nmschulte

Here is a video demonstrating the solution here.

https://github.com/user-attachments/assets/75930c4e-a106-4ef2-8e80-8e2f7f06e9f6

Some things to note, that I don't believe are introduced by this changeset:

  1. Undocked Views will be unable to have their clipping plane configuration altered, because focusing the clipping plane dialog in the main application window causes the focus to shift back to the docked View.
  2. Docking or undocking a View seems to actually create a new Window/View, and so clipping plane configuration is effectively lost.

Some things to note:

  1. Clipping will hold on to private references for each View it sees while it's open, even closed ones, and until it's closed.

nmschulte avatar Nov 26 '24 10:11 nmschulte

This looks like it is still a work-in-progress, so I'm going to switch it into Draft mode. When you feel like it's ready to go, please switch it back. Thanks!

chennes avatar Dec 02 '24 17:12 chennes

When you feel like it's ready to go, please switch it back. Thanks!

I've addressed the last of things now, I believe.

nmschulte avatar Dec 02 '24 19:12 nmschulte

@nmschulte FYI

maxwxyz avatar Dec 06 '24 07:12 maxwxyz

@nmschulte waiting for feedback

maxwxyz avatar Dec 08 '24 19:12 maxwxyz

@maxwxyz, heard.

@kadet1090: the idea then would be to have a Clipping QDialog per-view, each with its own Ui_Clipping, and then StdCmdToggleClipPlane would manage their lifecycles and showing/hiding depending the currently active view?

I'm not familiar with the Qt API, and such a rewrite is more of a task than I am willing to take on at the moment, especially given that there are ambitions to completely overhaul the clipping [plane] feature set of FreeCAD.

nmschulte avatar Dec 08 '24 20:12 nmschulte

I'd probably make Private into ClippingDialog class or something like that and load UI directly into it (just like we do for other panels. This widget should get all information that is necessary for it to work, so 3D view etc. See for example: https://github.com/FreeCAD/FreeCAD/blob/cb7d66e67c6dae232bc9e82b74118a095e4119cb/src/Gui/TaskCSysDragger.h#L48-L139

Clipping the would be responsible for managing (creating and destroying) ClippingDialogs based on various factors. This way the UI will be kept in memory only when it is actually needed and Qt will manage connections etc.

kadet1090 avatar Dec 08 '24 22:12 kadet1090

@nmschulte Ubuntu CI failed

maxwxyz avatar Dec 13 '24 09:12 maxwxyz

@nmschulte Ubuntu CI failed

@maxwxyz, the failure is unrelated to my changes; is it possible to re-run it? Perhaps the workflow should attempt a retry at this depth, assuming it's within control?

conda.exceptions.CondaHTTPError: HTTP 503 SERVICE UNAVAILABLE for url <https://conda.anaconda.org/conda-forge/label/pivy_rc/linux-64/repodata.json>
Elapsed: 00:06.466014
CF-RAY: 8eef3caa0dcb2323-ORD

A remote server error occurred when trying to retrieve this URL.

A 500-type error (e.g. 500, 501, 502, 503, etc.) indicates the server failed to
fulfill a valid request.  The problem may be spurious, and will resolve itself if you
try your request again.  If the problem persists, consider notifying the maintainer
of the remote server.
Collecting package metadata (repodata.json): ...working... failed
Traceback (most recent call last):
  File "/home/runner/work/FreeCAD/FreeCAD/.conda/freecad/lib/python3.12/site-packages/conda/gateways/repodata/__init__.py", line 203, in conda_http_errors
    yield
  File "/home/runner/work/FreeCAD/FreeCAD/.conda/freecad/lib/python3.12/site-packages/conda/gateways/repodata/jlap/interface.py", line 87, in repodata_parsed
    repodata_json_or_none = fetch.request_url_jlap_state(
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/FreeCAD/FreeCAD/.conda/freecad/lib/python3.12/site-packages/conda/gateways/repodata/jlap/fetch.py", line 309, in request_url_jlap_state
    response = download_and_hash(
               ^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/FreeCAD/FreeCAD/.conda/freecad/lib/python3.12/site-packages/conda/gateways/repodata/jlap/fetch.py", line 245, in download_and_hash
    response.raise_for_status()
  File "/home/runner/work/FreeCAD/FreeCAD/.conda/freecad/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: https://conda.anaconda.org/conda-forge/label/pivy_rc/linux-64/repodata.json.zst

nmschulte avatar Dec 13 '24 13:12 nmschulte

@kadet1090 is this good from your side?

maxwxyz avatar Dec 16 '24 16:12 maxwxyz

No, it feels hacky with the static and I am afraid that it will stay that way if not changed before merging.

kadet1090 avatar Dec 16 '24 16:12 kadet1090

@nmschulte could you address these issues?

maxwxyz avatar Dec 16 '24 16:12 maxwxyz

Thanks for helping improve FreeCAD! This pull request hasn’t seen activity in a while. We automatically check each PR after 120 days without activity to keep the repository tidy.

If the PR is still relevant, let us know by adding a comment. Otherwise, we’ll close this PR automatically in 60 days.

If you would like to keep working on this pull request, we advice to rebase it on current main branch, ask feedback from users or maintainers and engage with the community to get it forward.

github-actions[bot] avatar Jul 07 '25 00:07 github-actions[bot]

ping @nmschulte

luzpaz avatar Jul 07 '25 14:07 luzpaz

This isn't high on my list; I have no intention at the moment to rework this as requested. Will close in favor of a new PR if there's further interest.

nmschulte avatar Jul 07 '25 14:07 nmschulte