3D tooth chart under linux
3D tooth chart under linux
I have got Open Dental working under Ubuntu linux using mono 2.4. But my problem is that I cant enable the 3D tooth chart, yes I know it doesn't work on Linux but wouldnt it be nice just to try it out at least? see if new versions of mono that have been released such as 2.4 which was released only a few months ago have resolved the problem? I see that mono has OpenGl support http://mono-project.com/Tao but Im not a coder so maybe I am missing a vital point but to me it seems that with Tao the 3D tooth chart should be able to function on linux/mac.
Thanks
Matt Clarke
Thanks
Matt Clarke
- jordansparks
- Site Admin
- Posts: 5742
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: 3D tooth chart under linux
We have used Tao since the beginning and continue to use it in order to make OpenGL work with Windows. But that's not the same as making OpenGL work with Winforms on Linux. There's a hardware interface here and nobody has been willing to go to the effort to make OpenGL work with Winforms. It won't work. I'm 99% sure. So I don't have time to turn on that feature to let you try. Sorry.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
Re: 3D tooth chart under linux
If only we could get it working under linux...the days of rebuilding my windows boxes every year would be over....
Re: 3D tooth chart under linux
Did some further searching not sure if this addresses your problem but perhaps it does ...again Im not a programer lol
http://go-mono.com/forums/#nabble-td20831321
http://go-mono.com/forums/#nabble-td20831321
- jordansparks
- Site Admin
- Posts: 5742
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: 3D tooth chart under linux
OpenTK seems to be a new development since I last looked. But I'm not going to bother with something that still has a major version number of 0. Not worth my time.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
Re: 3D tooth chart under linux
seems to be pretty close to hitting the 1.0 mile stone to me 0.9.9-0 seems very close to a major release and there seems to be talk about compatibility of this version with the 1.0 release. Seems worthwhile
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: 3D tooth chart under linux
So it looks like we need to switch from using GraphicalToothChartControl:CodeBase.OpenGLWinFormsControl{//.SimpleOpenGlControl
I notice SimpleOpenGLControl is written only for Windows with GetDC and AutoFinish, etc... So we need to switch to OpenTK.GLControl....
I would say its stable in its 1.X version but I dont know... Maybe "The Fiddler" would like to rewrite SimpleOpenGLControl for X11.. =)
And then.. would this work in OSX? Would we need X11 or could we use OpenTK.Platform.OSX?
I notice SimpleOpenGLControl is written only for Windows with GetDC and AutoFinish, etc... So we need to switch to OpenTK.GLControl....
I would say its stable in its 1.X version but I dont know... Maybe "The Fiddler" would like to rewrite SimpleOpenGLControl for X11.. =)
And then.. would this work in OSX? Would we need X11 or could we use OpenTK.Platform.OSX?
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: 3D tooth chart under linux
Awesome! I will try it!
http://www.opentk.com/node/424
Re: Existing OpenGL program
Posted Sunday, 10 October, 2010 - 07:07 by the Fiddler (new) .Use the SimpleOpenGLControl and Tao.OpenGL found in OpenTK.Compatibility.dll. The first is a clone of Tao's SimpleOpenGLControl layered on top of OpenTK.GLControl (so it supports Windows, Linux, Mac OS X), while the latter is a full copy of Tao's OpenGL bindings that work well with OpenTK.
You will need to get rid of Tao.Platform.Windows, obviously, but that should be possible if you are using SimpleOpenGLControl.
Edit: It is possible to modify OpenGLWinFormsControl to run on either Tao.SimpleOpenGlControl or OpenTK.GLControl. You will need to modify it to inherit from those (instead of plain Control) and remove all references to GDI and WGL (these are handled by OpenTK internally). The rest of the public API should work with little or no modification.
http://www.opentk.com/node/424
Re: Existing OpenGL program
Posted Sunday, 10 October, 2010 - 07:07 by the Fiddler (new) .Use the SimpleOpenGLControl and Tao.OpenGL found in OpenTK.Compatibility.dll. The first is a clone of Tao's SimpleOpenGLControl layered on top of OpenTK.GLControl (so it supports Windows, Linux, Mac OS X), while the latter is a full copy of Tao's OpenGL bindings that work well with OpenTK.
You will need to get rid of Tao.Platform.Windows, obviously, but that should be possible if you are using SimpleOpenGLControl.
Edit: It is possible to modify OpenGLWinFormsControl to run on either Tao.SimpleOpenGlControl or OpenTK.GLControl. You will need to modify it to inherit from those (instead of plain Control) and remove all references to GDI and WGL (these are handled by OpenTK internally). The rest of the public API should work with little or no modification.
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: 3D tooth chart under linux
Pretty sure I just got this working without VMWare, etc... I am testing in VMWare and right now I am in linux and Open Dental detects my DirectX and OpenGL... give you a hint.. not using Mono..... Time to take this out of VMWare..
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: 3D tooth chart under linux
Got the Tooth Chart working for DirectX in Linux! =) Thanks Jordan!
It works PERFECTLY. I think.. Dont use it in vmware though or its slow...
I didnt have to do much to make this work. But I will get back to you guys.. I am comparing running this with wine and dotnet20 or wine and mono26
Oh yeah if you do want to compile EDIT: (with monodevelop), use Visual Studio 2008 in Windows and dont forget to install Adobe Acrobat Reader 8.. or thats what I used.. And I think you may need DirectX SDK.
=)
![Image](http://www.onsitedentalsystems.com/Screenshot.jpg)
It works PERFECTLY. I think.. Dont use it in vmware though or its slow...
I didnt have to do much to make this work. But I will get back to you guys.. I am comparing running this with wine and dotnet20 or wine and mono26
Oh yeah if you do want to compile EDIT: (with monodevelop), use Visual Studio 2008 in Windows and dont forget to install Adobe Acrobat Reader 8.. or thats what I used.. And I think you may need DirectX SDK.
=)
![Image](http://www.onsitedentalsystems.com/Screenshot.jpg)
Last edited by Justin Shafer on Thu Oct 28, 2010 10:45 am, edited 3 times in total.
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: 3D tooth chart under linux
Okay Here is a rough draft on how to get it working in Wine. You dont need to compile anything as of 7.2.46 Havent tried anything below that and I am not going too.
1. Install Wine.
2. get winetricks and install dotnet20 d3dx9 gdiplus glut vcrun2008 ddr=opengl
3. Run the program in a path wine can recognize.. .wine/drive_c/ or set it up in winecfg
edit: 4. if you get an SDCard\SmartCard error anywhere you may have to look at winsdcard.dll (I think thats what its called) but last I tried I didnt have too.. I think.
Ummmm thats it..
My family will be soooo happy.
4. Get winscard.dll from xp sp2 or sp3 and throw it in system32 for wine and run winecfg and tell it in libraries that winscard.dll is native.
![Laughing :lol:](./images/smilies/icon_lol.gif)
1. Install Wine.
2. get winetricks and install dotnet20 d3dx9 gdiplus glut vcrun2008 ddr=opengl
3. Run the program in a path wine can recognize.. .wine/drive_c/ or set it up in winecfg
edit: 4. if you get an SDCard\SmartCard error anywhere you may have to look at winsdcard.dll (I think thats what its called) but last I tried I didnt have too.. I think.
Ummmm thats it..
![Mr. Green :mrgreen:](./images/smilies/icon_mrgreen.gif)
4. Get winscard.dll from xp sp2 or sp3 and throw it in system32 for wine and run winecfg and tell it in libraries that winscard.dll is native.
Last edited by Justin Shafer on Thu Oct 28, 2010 11:06 am, edited 1 time in total.
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: 3D tooth chart under linux
Got 7.4.4 to run under wine...
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Re: 3D tooth chart under linux
WOW!!!!! Thanks all
steve
steve
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: 3D tooth chart under linux
Yes but I didnt tell you guys how to get 7.4.4 to run... but its still in beta so I will wait for it to be stable... You shouldnt be running 7.4.4.. be sure you have direct rendering enabled with opengl and linux... glxinfo is the command..
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: 3D tooth chart under linux
Dang! I almost forgot who I got that working. You have to install the DirectXSDK in winetricks for it too work! Its a large download from Microsoft.
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Re: 3D tooth chart under linux
I like your style Justin, persistance in gettin OD to work in linux. I am looking at helping my mothers office run as a linux only shop......hope you don't mind me picking your brain when I get to that point!
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: 3D tooth chart under linux
Well I decided to play with this some more... I used PlayOnMac... Good wine program..
OpenDental draws slowly because of gdiplus. Wine needs gdiplus builtin to wine, is not good enough for dotnet and opendental. The gdiplus native option are the files from windows which works, but its slow.
As soon as wine does more work on gdiplus, then open dental will be faster in wine...
Very fast with virtualbox, vmware, etc.. of course.![Very Happy :D](./images/smilies/icon_biggrin.gif)
OpenDental draws slowly because of gdiplus. Wine needs gdiplus builtin to wine, is not good enough for dotnet and opendental. The gdiplus native option are the files from windows which works, but its slow.
As soon as wine does more work on gdiplus, then open dental will be faster in wine...
Very fast with virtualbox, vmware, etc.. of course.
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: 3D tooth chart under linux
Let's see if OD can be compiled under Mono... Just for fun. No 3d Tooth Chart. I want to remove the libraries that won't work on arm.. and see if it will run.
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: 3D tooth chart under linux
This works pretty well on 17.2...
WINEPREFIX="$HOME/.wine" WINEARCH=win32 winetricks dotnet45 d3dx9 gdiplus glut vcrun2015 ddr=opengl
Once you get OpenDentImages mounted over smb.. etc..
Toothchart worked.
WINEPREFIX="$HOME/.wine" WINEARCH=win32 winetricks dotnet45 d3dx9 gdiplus glut vcrun2015 ddr=opengl
Once you get OpenDentImages mounted over smb.. etc..
Toothchart worked.
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
Re: 3D tooth chart under linux
For 17.3 I got a black box at the choose database window... So... SharpDX issue.
WINEPREFIX="$HOME/.wine" WINEARCH=win32 winetricks dotnet45 win10
Setting the windows version to Windows 10 fixes that...
WINEPREFIX="$HOME/.wine" WINEARCH=win32 winetricks dotnet45 win10
Setting the windows version to Windows 10 fixes that...
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
-
- Posts: 3
- Joined: Tue Feb 21, 2023 12:09 pm
Re: 3D tooth chart under linux
Resurrecting this topic -- have been doing some experimentation with getting OD to run in Linux (not specifically the 3d tooth chart, but just in general).
It seems like using the latest stable Wine (8.0.2) with mono, it *kind of* works. In a 64bit prefix it will load, but the UI is not great... fonts render kind of oddly and the tooth chart isn't shaded/colored right. It also seems to be burning a lot of CPU (60-80% of the system at idle), and throwing a lot of FIXMEs about wine d2d libraries. Even setting the renderer to gl doesn't seem to make a big difference.
I switched to using a 32 bit prefix like Justin had suggested here, but that had much less success -- it throws an error:
System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'.
Which is dismissible, but then I get a bunch of errors about not being able to find system DLLs. I'm assuming this is some disagreement with the dotnet libraries?
Curious if anyone else has tried this in the past few years.
It seems like using the latest stable Wine (8.0.2) with mono, it *kind of* works. In a 64bit prefix it will load, but the UI is not great... fonts render kind of oddly and the tooth chart isn't shaded/colored right. It also seems to be burning a lot of CPU (60-80% of the system at idle), and throwing a lot of FIXMEs about wine d2d libraries. Even setting the renderer to gl doesn't seem to make a big difference.
I switched to using a 32 bit prefix like Justin had suggested here, but that had much less success -- it throws an error:
System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'.
Which is dismissible, but then I get a bunch of errors about not being able to find system DLLs. I'm assuming this is some disagreement with the dotnet libraries?
Curious if anyone else has tried this in the past few years.
- jordansparks
- Site Admin
- Posts: 5742
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: 3D tooth chart under linux
As we move to WPF, issues like the fonts should get better. We've already been able to reduce the number of calls to the Windows API, and I can see us being able to get rid of those completely some day. We're still on 32 bit because of all the bridges we have with other software. We'll have to build some sort of intermediate layer before we can switch the main program over to 64 bit. I expect within 5 years that we will start pushing to convert from .net framework to modern .net 8+. Mono was merged into .net, so that should make it run fine on Linux, Mac, and ARM tablets. We'll see. I haven't quite seen a migration strategy that would let us migrate one window at a time, which is what we will really need. I have some ideas how this might work, but it's going to take a lot of creativity and tooling.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
-
- Posts: 3
- Joined: Tue Feb 21, 2023 12:09 pm
Re: 3D tooth chart under linux
Good info! Getting to .NET Core would certainly open a lot of possibilities for running cross platform.
I was able to get this working quite a bit better by tinkering with a lot of various Wine settings. Interestingly it seems to draw better using the Direct3D libraries in Wine than it goes using OpenGL, which isn't what I would have expected.
The fonts are still a little weird but not terrible. I suspect that's fixable with some better font pages in Wine.
The main hangup I'm still having is high CPU usage which is causing some input lag when typing or clicking around the UI. I turned on the Mono debug logs and it seems like it's spending a lot of cycles constantly redrawing the ToolBarOD. I see that has a timer in it to redraw (I assume in case another machine edits the toolbar config?), but it seems to be disposing and recreating the toolbar components more or less non-stop.
I was able to get this working quite a bit better by tinkering with a lot of various Wine settings. Interestingly it seems to draw better using the Direct3D libraries in Wine than it goes using OpenGL, which isn't what I would have expected.
The fonts are still a little weird but not terrible. I suspect that's fixable with some better font pages in Wine.
The main hangup I'm still having is high CPU usage which is causing some input lag when typing or clicking around the UI. I turned on the Mono debug logs and it seems like it's spending a lot of cycles constantly redrawing the ToolBarOD. I see that has a timer in it to redraw (I assume in case another machine edits the toolbar config?), but it seems to be disposing and recreating the toolbar components more or less non-stop.
- jordansparks
- Site Admin
- Posts: 5742
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: 3D tooth chart under linux
I would expect it to draw better in DirectX than in OpenGL. We switched away from OpenGL about 10 years ago after a good solid attempt. Since we're using MS, DirectX is just a better fit.
Thank you so much for tracking down that CPU usage in the ToolBar. I have a little down time at the moment, and I've been meaning to look at that, so I'll see what I can do. It just needs a little love. I think someone added the timer as a bug fix instead of fixing the underlying issue. The main issue that I want to work on is the SwallowAnyException in the OnPaint. The painting code should simply be robust enough that it never crashes, but we also don't want it running very often.
Thank you so much for tracking down that CPU usage in the ToolBar. I have a little down time at the moment, and I've been meaning to look at that, so I'll see what I can do. It just needs a little love. I think someone added the timer as a bug fix instead of fixing the underlying issue. The main issue that I want to work on is the SwallowAnyException in the OnPaint. The painting code should simply be robust enough that it never crashes, but we also don't want it running very often.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
- jordansparks
- Site Admin
- Posts: 5742
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: 3D tooth chart under linux
I looked into it. The ToolBarOD is pretty solid. I verified that it only repainted when it needed to, like if the mouse is moved to a new hover button. It doesn't repaint if you just move the mouse around on the same button. So that was my main concern. The timer seems harmless, since it's a pretty long interval. The new WPF toolbar doesn't use anything like that. Even the SwallowAnyException seems harmless since I can't make it hit, and it would just skip drawing for that time. I suspect someone might have added another thread someplace that calls the ToolBar somehow, but I can't find it. We've been removing quite a few threads to improve maintenance. So I shouldn't touch the ToolBarOD or I will break it. If I could verify that it was running something it a loop and misbehaving, then it might be worth it to swap all toolbars out for the new WPF, but that would be a lot of work.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
-
- Posts: 3
- Joined: Tue Feb 21, 2023 12:09 pm
Re: 3D tooth chart under linux
Thanks for taking some time to look at that -- I think you're right, this may just be a place where the Mono debug logging is super chatty, to the point the log output itself is causing performance issues.
I'm narrowing down on a combo that performs well... so far this combination seems to be showing promise:
I'm narrowing down on a combo that performs well... so far this combination seems to be showing promise:
- wine 8.0.02
- mono version that wine auto-installs
- run in WINEARCH=win32
- Use dxvk 2.3 to hand off d3d to GPU
- Use official nvidia drivers, not the linux open source versions (assuming nvidia GPU of course)