Why Coin3D and not OpenSceneGraph

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
nazal
Posts: 14
Joined: Fri May 20, 2016 7:45 am
Location: Nizhny Novgorod, Russia

Why Coin3D and not OpenSceneGraph

Post by nazal »

Hello all!

Coin3D is a death project. No docs, no maintainers.

OSG is under LGPL. New versions are released. There are documentation and books.
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Why Coin3D and not OpenSceneGraph

Post by wmayer »

Coin3D is a death project. No docs, no maintainers.
When FreeCAD started around 15 years ago Coin3D was well supported. And OpenInventor at this time already was a mature system and well-known. About OpenSceneGraph I don't know how usable it was at this time since it was a very young project there.

And that there are no docs is wrong. There is an on-line documentation and there are the books Inventor Toolmaker and Inventor Mentor which gives many great tips how to extend the library with user-defined classes.

Besides this what are the big advantages of OpenSceneGraph over Coin3D?
User avatar
nazal
Posts: 14
Joined: Fri May 20, 2016 7:45 am
Location: Nizhny Novgorod, Russia

Re: Why Coin3D and not OpenSceneGraph

Post by nazal »

I look from present situation, but you are right. The best is the enemy of the good.
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: Why Coin3D and not OpenSceneGraph

Post by tanderson69 »

wmayer wrote:Besides this what are the big advantages of OpenSceneGraph over Coin3D?
openscenegraph and its kdtree implementation are giving me better selection performance over coin3d. Here are some videos with side by side windows of freecad and an openscenegraph selection window. This isn't a very rigorous comparison, but I think the video shows better performance.
https://www.datafilehost.com/d/0353807c
https://www.datafilehost.com/d/9089fd79
https://www.datafilehost.com/d/c094f0b0


Openscenegraph is a more modern c++ api and isn't held together by dozens of obscure macros like coin3d. Keep in mind I am not suggesting freecad or anybody change, just relaying my personal experience.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Why Coin3D and not OpenSceneGraph

Post by yorik »

interesting tests! Indeed the freecad window is more or less what I have too with large models. But is it the fault of Coin? Or is it the way we use it?

in any case it is true that coin is progressively being abandoned (we must be the biggest opensource project that uses it today) and that openscenegraph is increasingly used everywhere, even for games (openMW and Flightgear).

at some point in time it could be interesting to have a deeper look at it, what would it imply to switch, etc. It's certainly no small task, but we're switching so many things recently, we're getting good at it, no? :D
wmayer
Founder
Posts: 20317
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Why Coin3D and not OpenSceneGraph

Post by wmayer »

at some point in time it could be interesting to have a deeper look at it, what would it imply to switch, etc. It's certainly no small task, but we're switching so many things recently, we're getting good at it, no?
That would be the most challenging change. I imagine it would be roughly the same amount of work as the Qt3-to-Qt4 port which took us more than 2 years. However, for the Qt4 port we could use the Qt3 support library so that it was possible to do the movement step-by-step but with replacing Coin3d such a smooth movement isn't possible.

And when thinking about a change to another rendering library we should think about which one to use. At the moment I see three candidates:
  • OpenSceneGraph: like Coin3d this a scene-graph library and I would imagine that many concepts are similar so that it probably won't cause a complete redesign of our view providers
  • VTK: is the de-facto standard for complex FEM renderings and since it's already used in the FEM module one could also think about using it everywhere in FreeCAD. However, this is not a scene-graph based library and would cause a redesign of the view providers, I guess.
    But of course it's still possible to use two rendering systems.
  • Qt 3D: is rather new and if am not totally wrong it's not a scene-graph based system, either. The benefit is that it's part of Qt and many thing will work out of the box.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Why Coin3D and not OpenSceneGraph

Post by yorik »

Maybe some stuff could be done step-by-step, for ex. building a kind of abstraction layer that the view providers would use?
Anyway, you are right of course, this is not something to be undertaken tomorrow. Specially because at the moment, there is no problem with coin at all. But who knows in the future, it's always good to keep an eye on alternatives...
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Why Coin3D and not OpenSceneGraph

Post by NormandC »

As an end user, I'm mostly interested in the way models are displayed. FreeCAD is currently lacking in the way it can for example represent shapes in wireframe mode. Hidden and visible edges are displayed the same, when it should be possible to set hidden edges to either dotted lines or dimmed lines (my personal preference). Would switching to a different rendering library make it easier, or is it irrelevant?
User avatar
nazal
Posts: 14
Joined: Fri May 20, 2016 7:45 am
Location: Nizhny Novgorod, Russia

Re: Why Coin3D and not OpenSceneGraph

Post by nazal »

According to discussion about WebGL support (viewtopic.php?f=10&t=2397) it seems to be good idea to implement visualization under OpenSceneGraph.
It will be easy to implement WebGL via OSG.js (same data structures as OpenSceneGraph).

What can be started creation by the abstraction vizualisation layer? How interfaces can be extracted? Or is this issue can be resolve only by founding fathers of FreeCAD?
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Why Coin3D and not OpenSceneGraph

Post by ickby »

nazal wrote:What can be started creation by the abstraction vizualisation layer? How interfaces can be extracted? Or is this issue can be resolve only by founding fathers of FreeCAD?
The things to do are rather easy (well, at least doable but we won't scare anyone ;)) and could be done by anybody with a good c++/python/freecad knowledge. It just is a tremendous amount of work involved to get this going. And I mean really a lot! If you think the benefits outweight the work needed you could start imediately :)
Post Reply