Pivy_trackers 2D geometry library
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Pivy_trackers 2D geometry library
I've been reworking the tracker code that I've developed as a part of my Trails workbench and have created a separate repo with just that code. It includes one example, designed to be incorporated into a workbench, that gives a basic idea of how it works.
I've also begun writing the wiki documentation on github. At the moment, the Scenegraph Structure page is mostly complete.
Links:
pivy_trackers repo: https://github.com/joelgraff/pivy_trackers
documentation wiki: https://github.com/joelgraff/pivy_trackers/wiki
original forum reference: https://forum.freecadweb.org/viewtopic. ... &start=810
There's still some features that haven't been implemented (like linking trackers together and dragging), but basic node picking is functioning, at least.
I've also begun writing the wiki documentation on github. At the moment, the Scenegraph Structure page is mostly complete.
Links:
pivy_trackers repo: https://github.com/joelgraff/pivy_trackers
documentation wiki: https://github.com/joelgraff/pivy_trackers/wiki
original forum reference: https://forum.freecadweb.org/viewtopic. ... &start=810
There's still some features that haven't been implemented (like linking trackers together and dragging), but basic node picking is functioning, at least.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
Re: Pivy_trackers 2D geometry library
That's really interesting to me: you know I was playing with looo's pivy graphics and draft trackers... I'm keeping track so when I'll have again some time I'll check it out carefully!
follow my experiments on BIM modelling for architecture design
Re: Pivy_trackers 2D geometry library
nice to see this brought to the next level!
I worked on a similar tool some time ago and ended up with something like this (which adds a draggable marker - to drag press "g")
So while this might miss some documentation, the work was directly added to pivy which in my eyes makes the most sense for such a library (as it is not really dependent on FreeCAD). Anyway, I think your work is a great addition and I will for sure test the examples.
I worked on a similar tool some time ago and ended up with something like this (which adds a draggable marker - to drag press "g")
Code: Select all
import pivy
view = Gui.ActiveDocument.ActiveView
sg = view.getSceneGraph()
rm = view.getSoRenderManager()
interaction = pivy.graphics.InteractionSeparator(rm)
marker = pivy.graphics.Marker([[0,0,0]], dynamic=True)
interaction += marker
sg += interaction
interaction.register()
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Pivy_trackers 2D geometry library
That's not a bad way to look at it.looo wrote: ↑Tue Oct 08, 2019 9:38 pm So while this might miss some documentation, the work was directly added to pivy which in my eyes makes the most sense for such a library (as it is not really dependent on FreeCAD). Anyway, I think your work is a great addition and I will for sure test the examples.
I'll have to look at your code - I admit my grasp of what Coin3D has to offer is probably a bit limited, as I don't recognize some of the references in it.
Unfortunately, in order to offer a more fully-featured system, I had to include some dependencies - like the DraftGui.todo class (which depends on QTimer), as well as the need to reference a 3DInventorViewer object, which is entirely a FreeCAD class. There may be a way to better abstract the view state code to help eliminate that dependency. There's also a dependency on SoFcSelection...
Anyway, I'm sure there's a lot of things I could do better. Nevertheless, I've sort of developed an arbitrary rule that each class / file will have no more than 200 lines (and preferrably less than 100), which seems to help me break things down and keep the code more manageable.
I'll be working on it over the next couple of weeks. Hopefully will have drag functionality added soon as well as more examples.
Right now, the example only allows you to do simple single-select and multi-selection of elements (as well as mouseover highlighting).
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Pivy_trackers 2D geometry library
Just a quick update: I've provided some general overview as well as more specific documentation on the github wiki. There's some 29 pages currently created, most of them are empty. But, clicking on the "Module API" and "Scenegraph" links in the sidebar will bring up most of the documentation that has been written thus far.
It provides (I think) a good description of how things work. At least, it'll make understanding the code a bit easier.
Hopefully will get more done next week.
https://github.com/joelgraff/pivy_trackers/wiki
It provides (I think) a good description of how things work. At least, it'll make understanding the code a bit easier.
Hopefully will get more done next week.
https://github.com/joelgraff/pivy_trackers/wiki
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
Re: Pivy_trackers 2D geometry library
Fantastic work!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Pivy_trackers 2D geometry library
Awesome job Joel!! I need to have a better look at it...
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Pivy_trackers 2D geometry library
Just an update. Documentation is nearing 50% complete, though the worst is yet to come.
I've written docs for the lower-level support classes and a couple of the 'traits'. Trying to include examples as I go, though I don't actually have time to test them.
That said, it's also helping me discover a bunch of useless functions / code that I forgot about, so it's certainly a good exercise.
I've written docs for the lower-level support classes and a couple of the 'traits'. Trying to include examples as I go, though I don't actually have time to test them.
That said, it's also helping me discover a bunch of useless functions / code that I forgot about, so it's certainly a good exercise.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Pivy_trackers 2D geometry library
Documentation is (mostly) complete for the classes which currently exist in pivy_trackers. I've also created some example code which can be viewed in the examples section.
Example code is intended to be incorporated as a command in a workbench, or may alternately be instanced directly from the Python console.
I will post updates here and update the documentation accordingly as new features / bug fixes are made.
https://github.com/joelgraff/pivy_trackers/wiki
Example code is intended to be incorporated as a command in a workbench, or may alternately be instanced directly from the Python console.
I will post updates here and update the documentation accordingly as new features / bug fixes are made.
https://github.com/joelgraff/pivy_trackers/wiki
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
Re: Pivy_trackers 2D geometry library
Will there be screencasts ? :
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs