-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPPGUI: 3D Plater #19
Comments
I would love to help, but I would need instructions on how to run the C++ GUI on windows. |
https://github.com/lordofhyphens/Slic3r/blob/cppgui/src/windows-build.txt there's the basics (written by someone else). You also need to have wxWidgets development files built and installed somewhere; the variable that needs to be set is WXWIN (for findWxWidgets). It should pick up the shared libraries no problem. Whether or not you use VC++ (it needs to support c++11) is something that I currently don't care about. CMake should function with VC++ just fine and there's docs available online for that. https://blogs.msdn.microsoft.com/vcblog/2016/10/05/cmake-support-in-visual-studio/ I don't do any development on Windows at this time, so that's the best I've got right now; I haven't even gotten the build server set up for Windows. What I do know is that right now Slic3r is expecting the slic3r binary to live in the src dir and its var directory to be one directory level above it. Slic3r will just crash if it's anywhere else (this must be sorted out before this gets merged back to main branch). |
when i run CMake i get the error wx not found! |
https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.zip Download and build that to their instructions. Install to whatever directory. Set the environment variable WXWIN to the directory you installed to. |
I built wxWidgets with the following two lines:
I did build in a separate directory, wxWidgets-build when I ran these. I then set WXWIN=C:\dev\wxWidgets-3.1.1-shared (search online for how to set environment variables on windows) This assumes you built with MinGW-w64 and are using its make (I tend to use Powershell when I am on Windows). My current "issue" on Windows is the opposite of yours; I can build and find wx, but not boost. |
Update: I can build on Windows now. In the src subdirectory, I execute the following commands:
|
Where did you create folder wxWidgets-build |
I cannot, however, right now guarantee that Windows c++ gui works as intended. I was seeing some weird behavior with the 2d plater that currently doesn't happen on Linux (wxGTK). You can currently ignore the initial errors, those are caused by me doing something incorrectly and windows wxwidgets popping a dialog box (whereas they are just console spam on linux) |
Hop onto IRC #slic3r this will go quicker there. |
If your wxwidgets source folder is C:\dev\wxwidgets-src, then your wxwidgets-build dir would be C:\dev\wxwidgets-build The "..\wxWidgets-3.1.1" in the command-line is the hint as to where wxWidgets-Build is. |
I extracted the wxWidgets into "C:\dev\wxWidgets-3.1.1" I created and environment variable called WXWIN and set it to "C:\dev\wxWidgets-3.1.1" I then created a folder called wxWidgets-build in "C:\dev" I cd to "C:\dev\wxWidgets-build" and ran cmake --build . --target install -- -j4 I set enviroment variacle WXWIN to "C:/dev/wxWidgets-3.1.1-shared" I opened up CMake and set where is the Source Code to "C:/Users/Eitan/Desktop/Slic3r/src" I configured and selected MinGW Makefiles and used default native compilers. I get in red "Wx not found!" What am I doing wrong |
WXWIN needs to be the full path to where wxwidgets is installed, so |
That what I did |
I'll do a clean build in a different checkout dir later today to see what is going on. |
Thanks.Can you can you record how you got it to work. |
|
When running step 7 i get the error MSBUILD : error MSB1001: Unknown switch. |
Delete the wxwidgets-build directory and repeat the updated step 7. You're getting that error because you have MSVC installed and its version of |
Do I need to set SLIC3R_STATIC to 1 in environment variables |
No; I've recently changed the CMakeLists to take it on a -D command. |
Do I need to cd to /path/to/Slic3r and run |
No. You should never run the Perl build scripts with this branch. |
I made a slight mistake, delete the build directory, remake it, and start again from step 14. |
Do you need to set WXWIN to something before step 7 |
Do I need to add something from http://docs.wxwidgets.org/3.1/overview_cmake.html to /path/to/Slic3r/src/CMakeLists.txt |
I added |
When I run "cmake . --build -- -j4" I get the error CMake Error: The source directory "C:/Users/Eitan/Desktop/cppgui/build/-j4" does not exist. |
@EitanSomething No, you don't need to set WXWIN until right before step 14. The CMakeLists.txt file should build on Windows as-is (and it does on my system on a clean checkout of the software).
|
You can take over this part of the project. |
@EitanSomething could you continue your efforts building on Visual Studio
2017?
…On Thu, Jun 7, 2018, 8:28 AM EitanSomething ***@***.***> wrote:
You can take over the project
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB8CuvPym6O9jJbFypz615NVSCwXeMDks5t6Sp4gaJpZM4T0Xod>
.
|
I will continue working on getting it to work with visual studios in the summer. I think the best bet is to use the MinGW debugger in VS. |
As soon as I made Plate3D based on wxGLCanvas instead of wxPanel, it scaled automatically. Not sure why I couldn't get it to do that as a child. I played around with the mouse input, and didn't have any big problems. @lordofhyphens, design question, I was thinking of having a base class which is just a renderer with camera movement which all of the 3D windows would extend. Most of the input controls and additional features aren't shared between the plater, preview and dialogs. Thoughts? Additionally, would it be ok to only support rendering triangles; if so, it would make the base renderer quite concise.That would require the 3d preview to generate triangles instead of quads, but I don't think it would affect any other code. |
@TheThirdOne sounds like a good design. The 3D view gets reused a lot in Slic3r. |
Better part rotation is needed. |
No visible progress today. Made a base class and copied (as comments) most of the relevant perl code and started to to convert it. The lighting opengl calls aren't directly compatible, and I haven't ever used lighting without shaders, so I'm not sure exactly how to do that. I think its just a matter of making arrays to pass instead of having multiple arguments, but not sure. |
@TheThirdOne if the arguments are strongly related, you could pass tuples or POD structs. The nice thing about the POD structure is that you get an initializer list for it. |
The only visible progress I made today was the gradient background. I have have the main render method done now though; it just comes down to implementing sub routines like drawGround and drawVolumes. @lordofhyphens: I am not sure why the ground rendering is using buffers. I thought the main reason to use buffers was to minimize the transfer of data between the CPU and GPU; it mainly is an optimization to make objects that aren't modified much faster. If that understanding is correct, why is being deleted immediately after being used; deleting it immediately should get rid of most or all of the benefit? And if it doesn't offer a significant performance benefit, why bother with the additional code path? |
@TheThirdOne probably inexperience at the time of the developer. If you have what you believe is a better solution, go for it. |
I worked on getting the camera movement working, and hit an issue with the lateral movement. |
Still haven't figured out the issue with unprojecting. It should be possible to make a system that doesn't use it if only using the turntable system of rotation. The trackball system is turned off in the perl version, but I don't know if there are any forks that people use that have it enabled. I got bed rendering working, but the setting the bed shape isn't coded yet. @lordofhyphens, it probably makes sense to have a volume struct (or class) like what the perl version has. Do you think that should just be a part of the base class's header or should it be separate? Pretty much the only files that would need to access it would be descendants of the base class. |
Put it in the base class header
…On Fri, Jun 15, 2018, 3:57 AM Benjamin Landers ***@***.***> wrote:
Still haven't figured out the issue with unprojecting. It should be
possible to make a system that doesn't use it if only using the turntable
system of rotation. The trackball system is turned off in the perl version,
but I don't know if there are any forks that people use that have it
enabled.
I got bed rendering working, but the setting the bed shape isn't coded yet.
@lordofhyphens <https://github.com/lordofhyphens>, it probably makes
sense to have a volume struct (or class) like what the perl version has. Do
you think that should just be a part of the base class's header or should
it be separate? Pretty much the only files that would need to access it
would be descendants of the base class.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB8CvXKx-Oi8UWPGETj0-VG9mhJLq0Bks5t83bhgaJpZM4T0Xod>
.
|
I got volume loading working, though with a segmentation fault when full screened and without proper lighting. My next steps will be to debug both of those issues. It took me far longer than it should have to get GLVertexArray linking with the gui executable. @lordofhyphens: Also, I didn't see the update method you had already made so my question on IRC was worthless. |
I will figure out how to make a Doxygen target for building; hopefully it helps. |
Hover works now, but with some coloring issues. I believe that the Default colorscheme is incorrectly setup for part_color which makes the parts transparent; I just made it straight yellow in the meantime. Just a few minutes ago I realized that with multiple volumes, coloring for some of the volumes get's messed up. @lordofhyphens, I pushed the menu fix to menuquickfix and the rest of my changes are built on top of that at Scene3D. |
I did a little cleaning up of the code and looked into the Cut dialog and 3d preview to prepare for implementing one of them. I also spent some time looking for an stl with multiple volumes to make sure that my code matches the perl code for how multi volume objects are handled. I didn't find one though. I'll probably just create one, but I don't have software ready to that. |
Load 2 models in Slic3r and save the plate as stl.
…On Tue, Jun 26, 2018, 5:05 AM Benjamin Landers ***@***.***> wrote:
I did a little cleaning up of the code and looked into the Cut dialog and
3d preview to prepare for implementing one of them.
I also spent some time looking for an stl with multiple volumes to make
sure that my code matches the perl code for how multi volume objects are
handled. I didn't find one though. I'll probably just create one, but I
don't have software ready to that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB8CrfryuaMBEfPdrZuTbW7Daz6FHLcks5uAgdMgaJpZM4T0Xod>
.
|
Thanks, for the suggestion. I didn't think about just using Slic3r. It appears that my implementation does indeed treat multiple volumes correctly. Though as testing that I noticed a lag before auto arrange took place. Perl Slic3r has a similar lag, but on beginning to move a model rather than the end. I am not sure what is causing that. I continued cleanup a bit, then moved on to implementing the cut dialog. |
I did some detailed reading of the perl code trying to understand why each part is needed. This essentially came down to commenting out parts I thought were unnecessary and then seeing when it crashed. Only one piece that I thought was unnecessary actually was. I should have a good enough understanding of the system now to start non-blindly translating and hopefully get something on screen. |
@TheThirdOne that is an excellent approach. Something else you could do to augment it is to write down the desired behaviors of the system in the form of Given-When-Then https://g.co/kgs/6tZesH and use that to guide your development. |
@TheThirdOne by the way, if you need to print debug statements, make use of the methods in My primary use of it is to let me compose more complicated debug print statements. |
I made progress on translating ObjectCutDialog, but I don't have anything on-screen yet. @lordofhyphens, I saw logging used it in Plater and Plate2D. I used it to help me debug as I wrote Scene3D and Plate3D. I don't have any logging in it currently because I don't have a good idea of what should vs shouldn't be logged. Most of it would just be rendering specific except for selection and moving which I believe are logged later upon signalling the plater. On another unrelated note, should the code handle being built without OpenGL? There are a few references to |
When I opened up Sllic3r with a model to test the cut dialog, I ran into a weird bug where features from the back of a model can be see from the front. I didn't spend much time trying to figure this out, but I did confirm it does happen with an early version too. I think this must be due to differences in OpenGL implementations between my different machines. I worked on translating the cut dialog more and got it onscreen, though mostly empty. |
Code has been merged #35. Thank you! |
Port 3D Plater to C++ GUI.
The text was updated successfully, but these errors were encountered: