{"action":"created","issue":{"url":"https://api.github.com/repos/openscad/openscad/issues/2355","repository_url":"https://api.github.com/repos/openscad/openscad","labels_url":"https://api.github.com/repos/openscad/openscad/issues/2355/labels{/name}","comments_url":"https://api.github.com/repos/openscad/openscad/issues/2355/comments","events_url":"https://api.github.com/repos/openscad/openscad/issues/2355/events","html_url":"https://github.com/openscad/openscad/pull/2355","id":308983257,"number":2355,"title":"Limit number of frames painted ","user":{"login":"thehans","id":252233,"avatar_url":"https://avatars3.githubusercontent.com/u/252233?v=4","gravatar_id":"","url":"https://api.github.com/users/thehans","html_url":"https://github.com/thehans","followers_url":"https://api.github.com/users/thehans/followers","following_url":"https://api.github.com/users/thehans/following{/other_user}","gists_url":"https://api.github.com/users/thehans/gists{/gist_id}","starred_url":"https://api.github.com/users/thehans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thehans/subscriptions","organizations_url":"https://api.github.com/users/thehans/orgs","repos_url":"https://api.github.com/users/thehans/repos","events_url":"https://api.github.com/users/thehans/events{/privacy}","received_events_url":"https://api.github.com/users/thehans/received_events","type":"User","site_admin":false},"labels":[{"id":535540432,"url":"https://api.github.com/repos/openscad/openscad/labels/DO%20NOT%20MERGE","name":"DO NOT MERGE","color":"d93f0b","default":false},{"id":535540510,"url":"https://api.github.com/repos/openscad/openscad/labels/Work%20In%20Progress","name":"Work In Progress","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-27T14:03:44Z","updated_at":"2018-04-01T22:57:44Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/openscad/openscad/pulls/2355","html_url":"https://github.com/openscad/openscad/pull/2355","diff_url":"https://github.com/openscad/openscad/pull/2355.diff","patch_url":"https://github.com/openscad/openscad/pull/2355.patch"},"body":"This change is intended to workaround redundant calls to `QGLView::paintGL()`.  There are many possible events and function that result in a paint call.  \r\n\r\nBelow is an example script for manually testing the responsiveness of orbiting the camera view (left click drag).  I get about 1fps with these settings on the nightly OBS build, and about 2fps with my build; feels 2x faster.\r\n```\r\n$fn = 100;\r\nfor(x=[1:10],y=[1:10],z=[1:10])\r\n  translate((1+$t)*[x,y,z])\r\n    sphere(d=1);\r\n```\r\n\r\nOne issue I've noticed (why I've set \"DO NOT MERGE\" for now) is that these changes don't seem to play nicely with the animation toolbar.  For example setting FPS 100 ans steps 100, it flickers through a lot of frames that only show background.  This may only be a problem when Animation toolbar FPS is greater than the `MAX_FPS` define in `QGLView.h`.  Should the Animation toolbar FPS have an upper limit imposed?\r\n\r\nAnd another side effect is that the using Alt-Up/Down arrow repeatedly on the value in this script seems to add about almost a second delay to the last frame: \r\n```\r\ncube(1);\r\n```\r\n\r\nBesides these two regressions which I'm still trying to understand, I think overall that viewing complex geometries is about twice as fast.\r\n "},"comment":{"url":"https://api.github.com/repos/openscad/openscad/issues/comments/377823281","html_url":"https://github.com/openscad/openscad/pull/2355#issuecomment-377823281","issue_url":"https://api.github.com/repos/openscad/openscad/issues/2355","id":377823281,"user":{"login":"thehans","id":252233,"avatar_url":"https://avatars3.githubusercontent.com/u/252233?v=4","gravatar_id":"","url":"https://api.github.com/users/thehans","html_url":"https://github.com/thehans","followers_url":"https://api.github.com/users/thehans/followers","following_url":"https://api.github.com/users/thehans/following{/other_user}","gists_url":"https://api.github.com/users/thehans/gists{/gist_id}","starred_url":"https://api.github.com/users/thehans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thehans/subscriptions","organizations_url":"https://api.github.com/users/thehans/orgs","repos_url":"https://api.github.com/users/thehans/repos","events_url":"https://api.github.com/users/thehans/events{/privacy}","received_events_url":"https://api.github.com/users/thehans/received_events","type":"User","site_admin":false},"created_at":"2018-04-01T22:57:44Z","updated_at":"2018-04-01T22:57:44Z","author_association":"CONTRIBUTOR","body":"The problem is that I need to transfer the OpenGL context to the thread that is doing the rendering.  \r\nIts still a little unclear but I guess that `QOpenGLWidget` is automatically creating the context internally.\r\n\r\nThe Qt example of multithreaded rendering does something like this to move the context from `QOpenGLWidget` to another thread:\r\n```C++\r\nthis->context()->moveToThread(renderthread)\r\n```\r\n\r\nThis would require me to `#include <QOpenGLContext>`, but doing so gives a compiler warning from Qt that its not compatible with GLEW:\r\n```\r\nIn file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/QOpenGLContext:1:0,\r\n                 from /home/hans/projects/openscad/src/QGLView.h:12,\r\n                 from /home/hans/projects/openscad/src/QGLView.cc:28:\r\n/usr/include/x86_64-linux-gnu/qt5/QtGui/qopenglcontext.h:49:2: warning: #warning qopenglfunctions.h is not compatible\r\n with GLEW, GLEW defines will be undefined [-Wcpp]\r\n #warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined\r\n  ^\r\n/usr/include/x86_64-linux-gnu/qt5/QtGui/qopenglcontext.h:50:2: warning: #warning To use GLEW with Qt, do not include \r\n<qopengl.h> or <QOpenGLFunctions> after glew.h [-Wcpp]\r\n #warning To use GLEW with Qt, do not include <qopengl.h> or <QOpenGLFunctions> after glew.h\r\n  ^\r\n```"}}
{"actor":{"display_login":"thehans"}}