Draft Edit improvements

A forum dedicated to the Draft, Arch and BIM workbenches development.
carlopav
Posts: 357
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Thu Feb 28, 2019 1:44 pm

yorik wrote:
Tue Feb 26, 2019 6:43 pm
So I think we should simply encapsulate the edit tracker points inside a SoAnnotation, hopefully that will be enough to solve the problem.
looks like the edittracker is already set to use SoAnnotation, and in fact is always displayed in front. Just the mouse click don't always return it when the view is orthogonal (top, front, side)... I didnt describe it correctly. Think i have to try with this
- take the point returned by getObjectInfo, no matter which object was clicked
- take the view direction (ortho cameras) or a vector from the point to the camera position (perspective cameras)
- take another vector from the clicked point to all our edit points
- for each of these, get the angle between it and the view direction vector
- if they are aligned (angle is 0° or 180°), then this edit point is exactly in the line of our clicked point. Then we can consider it was clicked.
carlopav
Posts: 357
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Sun Mar 03, 2019 11:42 am

Hi, with looots of sweat i have a roughly woriking prototype of the node editing tool.
v0ODfsN9nY.gif
v0ODfsN9nY.gif (571.28 KiB) Viewed 645 times
Still lacks in many feature the old tool had, but i think the right time to consider if it's the right way to keep working on it or if that implementation could cause slowdown of the drawing process. I hope yes, but i leave you the judgement.
I attach the 4 files to substitute in the draft module to try it. Should i make a PR or is it ok like this for the very first considerations?

PS no need to be activated because it sets itself up by default for the moment.
Attachments
InitGui.py
just added the call to the tool setup
(9.01 KiB) Downloaded 22 times
DraftTrackers.py
added some code to let the tracker remember it's position in the trackers list
(41.45 KiB) Downloaded 21 times
DraftTools.py
Should not be necessary to substitute it. But i dont remember if i changed something.
(285.11 KiB) Downloaded 19 times
DraftAutoEdit.py
This is a new file
(22.47 KiB) Downloaded 25 times
triplus
Posts: 8799
Joined: Mon Dec 12, 2011 4:45 pm

Re: Draft Edit improvements

Postby triplus » Sun Mar 03, 2019 12:20 pm

You might be interested in utilizing high level graphics API Pivy provides, for implementing such support:

https://forum.freecadweb.org/viewtopic.php?f=22&t=21808
carlopav
Posts: 357
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Sun Mar 03, 2019 1:10 pm

triplus wrote:
Sun Mar 03, 2019 12:20 pm
You might be interested in utilizing high level graphics API Pivy provides, for implementing such support:
wow thx! no idea that existed. Please can you be more precise on how that could help? At the moment i'm using the Draft "edittracker" in the Draft Trackers module to display edit nodes on objects, but not exactly happy about it (even if i still dont have any idea (read skill) on how to improve it). So i'm interested to understand if there is a better way.
triplus
Posts: 8799
Joined: Mon Dec 12, 2011 4:45 pm

Re: Draft Edit improvements

Postby triplus » Sun Mar 03, 2019 1:23 pm

carlopav wrote:
Sun Mar 03, 2019 1:10 pm
wow thx! no idea that existed.
You're welcome.
Please can you be more precise on how that could help? At the moment i'm using the Draft "edittracker" in the Draft Trackers module to display edit nodes on objects, but not exactly happy about it (even if i still dont have any idea (read skill) on how to improve it). So i'm interested to understand if there is a better way.
Likely best if you ask directly in the mentioned thread. Providing short description on what you have already done and an additional question if using high level graphics API Pivy provides could make more sense. ATM @looo will likely know best to answer such question.
User avatar
Moult
Posts: 223
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Draft Edit improvements

Postby Moult » Sun Mar 03, 2019 9:01 pm

Hey carlopav if you check out my PR (both for BIM workbench and for FreeCAD) I have two things which might interest you:

- For the tab-cycle-select it applies a SoAnnotation node so that the draft object displays above the others to give an x-ray view (seen in my screen recording)
- I have modified the regular ghostTracker to be able to track vertices (previously it wasn't able to), which may also give you some hints
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
triplus
Posts: 8799
Joined: Mon Dec 12, 2011 4:45 pm

Re: Draft Edit improvements

Postby triplus » Sun Mar 03, 2019 9:31 pm

User avatar
Moult
Posts: 223
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Draft Edit improvements

Postby Moult » Sun Mar 03, 2019 9:47 pm

triplus wrote:
Sun Mar 03, 2019 9:31 pm
As for tab behavior:

https://forum.freecadweb.org/viewtopic. ... 00#p290718
I think I broke something ... :)
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
carlopav
Posts: 357
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft Edit improvements

Postby carlopav » Sun Mar 03, 2019 9:54 pm

Thx @Moult, I'll check it out. Especially the ghost tracker, since it was on my to-do list for the tool. I think the edit mode is already wrapped inside a soannotation. As it is correctly always displayed on top. But if the user is not in orthographic view the getobjectinfo returns the object and not the edit tracker... It's odd. Also the getobjectsinfo ignore it. I think Yorik hint is the only thing that remain to try.
Ps if u find some time to try the code I'll really appreciate your comments. :)

@triplus thx for the hint. I'll write to them as soon as come to a point with the overall fix of the tool.
Roy_043
Posts: 545
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft Edit improvements

Postby Roy_043 » Mon Mar 04, 2019 2:03 pm

I have to admit that I have not kept up with this discussion. So maybe this has already been mentioned:

I have a number of draft object in the XY plane.
The current plane is XY (Top).
Node-editing the elements in the Top view seems to work fine.
But doing the same in the Iso view is problematic. Half the time I am unable to 'grab' the point.

I realize this is a new feature under active development, but Is this a known issue?

Code: Select all

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16028 (Git)
Build type: Release
Branch: master
Hash: 9079de7516eca945587e18f6076ec74eb7bd043c
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Dutch/Netherlands (nl_NL)