Skip to content
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

Add flow rate to simulation view #9410

Closed
wants to merge 2 commits into from
Closed

Conversation

khani3s
Copy link
Contributor

@khani3s khani3s commented Mar 17, 2021

WIP

Add Flow rate to simulation view

Flow Rate (AKA volumetric flow rate, volume flow rate, rate of fluid flow, volume velocity or volumetric speed) is used defined on 3dp as line width * thickness * feedrate. The unit is mm³/s

Is useful to check if your printing inside your hot end/extruder limits.

This implementation is based on #9289 and does not take into account (I think) material_flow.

TODO

  • Define the name of the view (currently is just Flow)
  • Add to I18n
  • Build
  • CI test pass

I need some guide of how to test this on my machine (Ubuntu 18.04.5 LTS).
I tried the "docker way" and after reading all the doc multiple times (cura-build-enviroment, cura-build, cura, wiki) I can't figure out how to build it and generate the AppImage.
I follow the CI build steps and got the same build output but I couldn't find out a way to get the binary for testing on my local machine.
I already invested +8 hours on the "build" :finnadie:

@khani3s khani3s force-pushed the master branch 2 times, most recently from d9c7a93 to 986a54f Compare March 17, 2021 02:18
@nallath
Copy link
Member

nallath commented Mar 17, 2021

Oh, you don't need to make the actual appimage. I just test Cura when running it from source. In 99% of the cases running it from source is the same as the appimage / binary.

In the few cases that it isn't, we have a automatic build system that spits out nightlies and which gets used & tested by our QA engineers.

@jellespijker
Copy link
Member

Hi @khani3s I was wondering if you're still stuck and if that is the case how I could help you. I kinda like what you're doing here, sot it would be great if we could merge it.

@jellespijker jellespijker self-requested a review April 29, 2021 13:01
Copy link
Member

@jellespijker jellespijker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're almost there. If you implement the following fixes in the code, you should have something working. See the image below.

I would suggest that you name it Flow rate instead of Flow and it might be a good idea to merge master into your own branch again since there were many changes in between your PR and now.

Don't worry about setting up the complete build environment, if it runs from source it will most likely run in our builds as well and we have the automatic tests to catch errors as well.

image

Btw it looks like something is a bit off with the max flow rate calculation. A flow of 26 mm3/s is very high

plugins/SimulationView/SimulationView.py Outdated Show resolved Hide resolved
plugins/SimulationView/SimulationView.py Outdated Show resolved Hide resolved
plugins/SimulationView/layers3d.shader Outdated Show resolved Hide resolved
plugins/SimulationView/layers3d.shader Outdated Show resolved Hide resolved
plugins/SimulationView/layers3d.shader Outdated Show resolved Hide resolved
plugins/SimulationView/layers3d.shader Outdated Show resolved Hide resolved
@jellespijker jellespijker added the Status: Needs Info Needs more information before action can be taken. label Apr 29, 2021
@khani3s
Copy link
Contributor Author

khani3s commented May 9, 2021

I finally managed to run the code.

https://github.com/Ultimaker/Cura/wiki/Running-Cura-from-Source-on-Ubuntu

python3 cura_app.py
(...)
QQmlApplicationEngine failed to load component
file:///media/felipe/Backup/backup/3dp/cura2/Cura/resources/qml/Cura.qml:388 Type Cura.PrintSetupSelector unavailable
file:///media/felipe/Backup/backup/3dp/cura2/Cura/cura/../resources/qml/PrintSetupSelector/PrintSetupSelector.qml:33 Type PrintSetupSelectorContents unavailable
file:///media/felipe/Backup/backup/3dp/cura2/Cura/cura/../resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml:74 Type CustomPrintSetup unavailable
file:///media/felipe/Backup/backup/3dp/cura2/Cura/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml:285 Type Cura.SettingView unavailable
file:///media/felipe/Backup/backup/3dp/cura2/Cura/cura/../resources/qml/Settings/SettingView.qml:157 Type SettingVisibilityPresetsMenu unavailable
file:///media/felipe/Backup/backup/3dp/cura2/Cura/resources/qml/Menus/SettingVisibilityPresetsMenu.qml:5 module "QtQuick.Controls" version 2.11 is not installed
(...)

For documentation purposes:

The version of PyQT listed on the wiki was wrong.
I solved the problem by editing requirements.txt and removing pywin32 and installing the dependencies with:

sudo pip3 install -r requirements.txt

@fieldOfView
Copy link
Collaborator

What version of PyQt and Qt have you installed?

@fieldOfView
Copy link
Collaborator

I think you stumbled across a "typo" or mistake. According to the qtquick documentation, module "QtQuick.Controls" version 2.11 does not exist yet, and the file should actually be using module "QtQuick.Controls" version 2.4. It is interesting though that you are the first to stumble into this as something that stops Cura from loading.

@fieldOfView
Copy link
Collaborator

I have created #9799 to fix the version issue.

@khani3s
Copy link
Contributor Author

khani3s commented May 9, 2021

I was using the Qt recommended here:

https://github.com/Ultimaker/Cura/wiki/Running-Cura-from-Source-on-Ubuntu

PyQt5==5.10

The requirements.txt version solved the problem:

PyQt5==5.15.2

@khani3s
Copy link
Contributor Author

khani3s commented May 10, 2021

Btw it looks like something is a bit off with the max flow rate calculation. A flow of 26 mm3/s is very high

I notice that too. And after debugging I think that is related to the "Fill Gaps lines".
If you set "Fill Gaps Between Walls" to "Nowhere" the flow goes it a normal range.
On another model I found a single point with a high value on the gaps.

@khani3s
Copy link
Contributor Author

khani3s commented May 10, 2021

Screenshot from 2021-05-10 00-34-04

@nallath
Copy link
Member

nallath commented May 10, 2021

I was using the Qt recommended here:

https://github.com/Ultimaker/Cura/wiki/Running-Cura-from-Source-on-Ubuntu

PyQt5==5.10

The requirements.txt version solved the problem:

PyQt5==5.15.2

Whoops. I've updated the documentation.

@nallath
Copy link
Member

nallath commented May 10, 2021

I've managed to get a bit of a weird result

image

My guess is that it's caused by the min & the max being the same.

@khani3s
Copy link
Contributor Author

khani3s commented May 10, 2021

@nallath could you send me that project?

@nallath
Copy link
Member

nallath commented May 10, 2021

UMS3_tetrahedron.zip

The issue only occurs if you only show the helpers.

Copy link
Collaborator

@Ghostkeeper Ghostkeeper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think that visualisation bug is because of this recently merged pull request: #9498

plugins/SimulationView/layers3d.shader Outdated Show resolved Hide resolved
@nallath
Copy link
Member

nallath commented May 17, 2021

The fix suggested by @Ghostkeeper fixes it, so i've merged this!

Github is however not quite understanding that :S ( But fear not; it is in the next release!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Info Needs more information before action can be taken.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants