Draft Edit improvements

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

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.
follow my experiments on BIM modelling for architecture design
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

Hi, with looots of sweat i have a roughly woriking prototype of the node editing tool.
v0ODfsN9nY.gif
v0ODfsN9nY.gif (571.28 KiB) Viewed 2416 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 83 times
DraftTrackers.py
added some code to let the tracker remember it's position in the trackers list
(41.45 KiB) Downloaded 77 times
DraftTools.py
Should not be necessary to substitute it. But i dont remember if i changed something.
(285.11 KiB) Downloaded 79 times
DraftAutoEdit.py
This is a new file
(22.47 KiB) Downloaded 75 times
follow my experiments on BIM modelling for architecture design
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Draft Edit improvements

Post by triplus »

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
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

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.
follow my experiments on BIM modelling for architecture design
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Draft Edit improvements

Post by triplus »

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: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Draft Edit improvements

Post by Moult »

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
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Draft Edit improvements

Post by triplus »

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

Re: Draft Edit improvements

Post by Moult »

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
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

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.
follow my experiments on BIM modelling for architecture design
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft Edit improvements

Post by Roy_043 »

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)
Post Reply