notalfredo / OpenKittenCAD

A free as in freedom CodeCad app
GNU Lesser General Public License v2.1
6 stars 0 forks source link

Switch to OpenCascade viewer #55

Closed notalfredo closed 6 months ago

notalfredo commented 7 months ago

Currently we are just using VTK, since it made things easy to bootstrap but we need a "Native" Cad experience.

Whatever way I decide to display objects I just need to be able to do a couple things.

notalfredo commented 7 months ago

A couple things have been discovered. You can use VTK with with AIS which is OCCT way of interacting with objects but its a bit janky.

I managed to build the web assembly example from the occt website.

We could go the web route but this would require me to build flex and bison with web assembly which im currently trying and is such a pain. I had to go trough a journey to use web asm with OCCT which im glad I managed to do but Im not sure if I have the energy to do it.

I could go down the route with QT or some other c++UI library but im not sure if I want to. Ill have to think about it.

notalfredo commented 7 months ago

imgui looks like a possible candidate if we decide to use a c++ library.

I would really like to use web assembly but using Emscripten is such a pain. I learned a lot about how gcc and g++ works just trying to build the web assembly for the OCCT webGl example but it was just a pain in the ass to get it to run, I cant imagine having to do it for flex and bison which by them selves are not simply to build from source. I cant imagine having that as a requirement for the project it would suck for anybody else trying to compile the project them selves.

notalfredo commented 7 months ago

Since I know I can build the occt webGl example if I dont want to have to do the same thing for flex or bison I could just create my own lexer and parser. Which I dont think will be hard but it would make it harder to just add things to the language or delete things. Especially since a lot of the grammar and lexemes are not set in stone.

This would remove the dependencies of using flex and bison

notalfredo commented 7 months ago

Okay I think im going to play around with imgui to see if I can bootstrap and example. Now that I now that im capable of building the webgl example for occt

notalfredo commented 7 months ago

I found this repo that does imgui and OCCT together ImGui OCCT

While I could not get the example to run I did find out that they built of the glfw sample folder for OCCT which I was able to get running. My next step is to try and get imgui plugged into with this example.

notalfredo commented 7 months ago

Was able to get imgui + OCCT working together but I had to display them in separate windows. image

Ill have to play around with multi text editor. And I want to see if I can get them displayed in the same window.

notalfredo commented 7 months ago

image

This is sorta what I envision if it was all under one window. Not sure if prefer this or one window

notalfredo commented 7 months ago

image

Using my qt might be a more viable option. Since we can keep everything in the same window. We would have to see if I can make this project with CMAKE

notalfredo commented 7 months ago

If I can get the QT scene to match up the GLFW scene. I also have to see if I can edit the text in sample code. By that I mean I can programmatically change it just via code.

notalfredo commented 7 months ago

If I can get the QT scene to match up the GLFW scene. I also have to see if I can edit the text in sample code. By that I mean I can programmatically change it just via code.

Got it to looks 10x better

image

Crazy how much the application changed with just that lol. Now ill have to play around with the Sample code box. Also maybe worth taking a look if I can change how the rotation works for the camera as I dont like it.

notalfredo commented 7 months ago

Okay so I got to play around with it more. I think im going to go with QT mainly because how everything is in the same window. And now I have a better idea of how to modify things. Ill have to throw away a lot of useless code as a lot of the code provided I dont think is applicable to what I need it for.

notalfredo commented 7 months ago

The main thing left is building the program with CMake. The reason that is bc we build are project with CMake.

notalfredo commented 7 months ago

Good news. I got Cmake to build the project. Time to integrate it into my application. I will try and get rid of anything thats not needed.

notalfredo commented 7 months ago

Got it to compile in the OpenKittenCad repo. Going to plug in code -> cad into the application then going to start purging not needed files etc...

notalfredo commented 6 months ago

Got Code -> cad plugged in. Now im going to remove as much as not needed files as possible.

notalfredo commented 6 months ago

Just pushed a big commit that got rid of a lot of not needed files. Its coming together. Still need to clean up more.

notalfredo commented 6 months ago

66