Flamingo & Dodo workbench(s) discussion thread

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
oddtopus
Posts: 142
Joined: Tue Sep 20, 2016 6:17 pm

Re: Flamingo (Workbench) discussion thread

Post by oddtopus »

GlouGlou wrote: Sun Jan 13, 2019 3:52 pm I found out a bug with this file: Can't make a full path, the first leg is missing.
mmh.. In the comments of my code I found that I patched that part some time ago: file pipeCmd.py, lines 362-369.
I'll review it. It may deal with the orientation of selected edges when the procedure try to find the first point.

ByTheWay: see that you're using flamingo with FC0.18. Do you notice troubles with dialogs? I fear there will be some issues with Qt5...

Meanwhile I added few new tools from my last post:
  • a dialog for quick setup of rectangular tanks
  • a dialog to attach nozzles to a sketch (mainly, on the shells of the tanks)
  • flanges with Raised Face and Welding Neck
  • pipe routes attached to nozzles or to branch from existing lines
You can see it at work in the tutorial section of the forum.
hatari
Posts: 114
Joined: Fri Jul 22, 2016 10:56 am

Re: Flamingo (Workbench) discussion thread

Post by hatari »

Hi oddtopus,

first of all thanks a lot for this great Workbench. In FC0.18 I played around mainly with the frame tools and here are my thoughts and remarks:
  • Qt-issue: FC crashes when FrameManager is open and you first select an existing structure created along a sketch and then click in "the void" i.e. somewhere in the graphic window and don't hit another structure element.
    It generates the following log in the terminal:

    Code: Select all

    Program received signal SIGSEGV, Segmentation fault.
    #0  /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f325b5bdf20]
    #1  0x7f325adcb4c5 in SoAction::traverse(SoNode*) from /usr/lib/x86_64-linux-gnu/libCoin.so.80c+0x25
    #2  0x7f325af6b008 in SoChildList::traverse(SoAction*, int, int) from /usr/lib/x86_64-linux-gnu/libCoin.so.80c+0xd8
    #3  0x7f325afba4e6 in SoGroup::doAction(SoAction*) from /usr/lib/x86_64-linux-gnu/libCoin.so.80c+0x56
    #4  0x7f325afd4967 in SoSeparator::doAction(SoAction*) from /usr/lib/x86_64-linux-gnu/libCoin.so.80c+0x27
    #5  0x7f325e27273c in Gui::SoFCUnifiedSelection::handleEvent(SoHandleEventAction*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x9c
    #6  0x7f325adcb504 in SoAction::traverse(SoNode*) from /usr/lib/x86_64-linux-gnu/libCoin.so.80c+0x64
    #7  0x7f325af6b008 in SoChildList::traverse(SoAction*, int, int) from /usr/lib/x86_64-linux-gnu/libCoin.so.80c+0xd8
    #8  0x7f325afba4e6 in SoGroup::doAction(SoAction*) from /usr/lib/x86_64-linux-gnu/libCoin.so.80c+0x56
    #9  0x7f325afd4967 in SoSeparator::doAction(SoAction*) from /usr/lib/x86_64-linux-gnu/libCoin.so.80c+0x27
    #10  0x7f325adcb504 in SoAction::traverse(SoNode*) from /usr/lib/x86_64-linux-gnu/libCoin.so.80c+0x64
    #11  0x7f325add4e48 in SoHandleEventAction::beginTraversal(SoNode*) from /usr/lib/x86_64-linux-gnu/libCoin.so.80c+0x68
    #12  0x7f325adcba82 in SoAction::apply(SoNode*) from /usr/lib/x86_64-linux-gnu/libCoin.so.80c+0x372
    #13  0x7f325af878a0 in SoEventManager::actuallyProcessEvent(SoEvent const*) from /usr/lib/x86_64-linux-gnu/libCoin.so.80c+0x60
    #14  0x7f325e2e57ce in SIM::Coin3D::Quarter::QuarterWidget::processSoEvent(SoEvent const*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x1e
    #15  0x7f325e2ee496 in SIM::Coin3D::Quarter::SoQTQuarterAdaptor::processSoEvent(SoEvent const*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x56
    #16  0x7f325e318009 in Gui::View3DInventorViewer::processSoEventBase(SoEvent const*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x9
    #17  0x7f325e2fb71b in Gui::CADNavigationStyle::processSoEvent(SoEvent const*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x30b
    #18  0x7f325e2f8328 in Gui::NavigationStyle::processEvent(SoEvent const*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0xf8
    #19  0x7f325e317f83 in Gui::View3DInventorViewer::processSoEvent(SoEvent const*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x63
    #20  0x7f325e2dcc05 in SIM::Coin3D::Quarter::EventFilter::eventFilter(QObject*, QEvent*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x185
    #21  0x7f325c19b68c in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x7c
    #22  0x7f325c7b0805 in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x75
    #23  0x7f325c7b864f in QApplication::notify(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x7ff
    #24  0x7f325e0bd6c8 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x88
    #25  0x7f325c19b9a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x118
    #26  0x7f325c7b7622 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x1d2
    #27  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x1ae14b) [0x7f325c80a14b]
    #28  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5(+0x1b07ba) [0x7f325c80c7ba]
    #29  0x7f325c7b082c in QApplicationPrivate::notify_helper(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x9c
    #30  0x7f325c7b80f4 in QApplication::notify(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5+0x2a4
    #31  0x7f325e0bd6c8 in Gui::GUIApplication::notify(QObject*, QEvent*) from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x88
    #32  0x7f325c19b9a8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x118
    #33  0x7f32580c5523 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5+0x6f3
    #34  0x7f32580c6ff5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5+0x135
    #35  0x7f325809e2eb in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5+0xab
    #36  /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5(+0x9d1c0) [0x7f324bbda1c0]
    #37  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x2e7) [0x7f325664e387]
    #38  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x4c5c0) [0x7f325664e5c0]
    #39  /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x2c) [0x7f325664e64c]
    #40  0x7f325c1f48ef in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x5f
    #41  0x7f325c1999ea in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x13a
    #42  0x7f325c1a2a84 in QCoreApplication::exec() from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5+0x94
    #43  0x7f325e0433c7 in Gui::Application::runApplication() from /usr/lib/freecad-daily/lib/libFreeCADGui.so+0x1437
    #44  freecad-daily(main+0x695) [0x560e0e2324c5]
    #45  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f325b5a0b97]
    #46  freecad-daily(_start+0x2a) [0x560e0e23318a]
    
    I can't reproduce exactly when, I think it is usually when saving the file it works but I get:

    Code: Select all

    Traceback (most recent call last):
      File "/usr/lib/python2.7/json/__init__.py", line 244, in dumps
        return _default_encoder.encode(obj)
      File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
        chunks = self.iterencode(o, _one_shot=True)
      File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
        return _iterencode(o, 0)
      File "/usr/lib/python2.7/json/encoder.py", line 184, in default
        raise TypeError(repr(o) + " is not JSON serializable")
    <type 'exceptions.TypeError'>: <method 'changeAttacherType' of 'Part.AttachExtension' objects> is not JSON serializable
    
  • Sketch based Profile: if I use a custom sketch and draw a closed hollow profile to use for my structure, it is filled also in the inside.
    filled-profile.png
    filled-profile.png (7.47 KiB) Viewed 3884 times
  • Sometimes, if the direction of your custom profile sketch is orientated in the wrong way, the "reverse orientation" command is reset after you make changes to the path geometry. Is there a way to prevent this or is it due to topological naming?
  • If you change the profile from a custom sketch to some other profile, the original profile sketch is deleted, while sometimes it might be useful to keep and reuse it later.
  • If you join edges in order to position structures and then trim/extend them, after this operation the position of the profiles is reset. Bug or feature?
  • Nice to haves/Feature requests
    Have you ever thought about a tool that lets you choose how your profile will be aligned to the structure path like common commercial Frame Managers have? (for example like shown here: https://www.youtube.com/watch?v=QfDS_gCP_s0). Would that be even possible?
    screenshot9.png
    screenshot9.png (116.38 KiB) Viewed 3879 times
  • Is there a way to make parametric miter corners with a bisect plane in situations like this?
    miter.png
    miter.png (9.84 KiB) Viewed 3884 times
I'm looking forward to hear your opinion. Unfortunately I'm not familiar enough with python and the FreeCad python modules yet and furthermore have only little spare time at the moment, but in the future this would be a project which I would gladly help to improve ;)

cheers, hatari

OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16079 (Git)
Build type: Release
Branch: master
Hash: 6363c90a20b296ab69d7b52230009928199d90df
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
engdham
Posts: 47
Joined: Sun Jul 15, 2018 2:08 am
Location: Rondonópolis - MT - Brazil
Contact:

Re: Flamingo (Workbench) discussion thread

Post by engdham »

You could take a look on Frame's Workbench, it does have mitter cut and shape cut tools.

Maybe you could merge some of that code.
oddtopus
Posts: 142
Joined: Tue Sep 20, 2016 6:17 pm

Re: Flamingo (Workbench) discussion thread

Post by oddtopus »

Thank You @hatari for your kind advice.
Herebelow some explanation of some of the points. I'll work on the others as soon as the stable release 0.18 will be issued.
hatari wrote: Mon Mar 11, 2019 3:01 pm Qt-issue: FC crashes when FrameManager is open and you first select an existing structure created along a sketch and then click in "the void" i.e. somewhere in the graphic window and don't hit another structure element.
That is the most work for next months because I have to change some syntax when calling PySide function.
I just wait to get the 0.18 official release.
hatari wrote: Mon Mar 11, 2019 3:01 pm I can't reproduce exactly when, I think it is usually when saving the file it works but I get:

Code: Select all

Traceback (most recent call last):
  File "/usr/lib/python2.7/json/__init__.py", line 244, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python2.7/json/encoder.py", line 184, in default
    raise TypeError(repr(o) + " is not JSON serializable")
<type 'exceptions.TypeError'>: <method 'changeAttacherType' of 'Part.AttachExtension' objects> is not JSON serializable
I also noticed that when reopening a file with a PypeBranch in it. I guess it's something related how the PythonFeatures are saved inside .FcStd: something outside my horizon.
Anyway this won't produce any issue while working, at least in my experience till now. So you can ignore that alert.
hatari wrote: Mon Mar 11, 2019 3:01 pm [*] Sketch based Profile: if I use a custom sketch and draw a closed hollow profile to use for my structure, it is filled also in the inside.
[*] Sometimes, if the direction of your custom profile sketch is orientated in the wrong way, the "reverse orientation" command is reset after you make changes to the path geometry. Is there a way to prevent this or is it due to topological naming?
Up to now, the problem with hollow sections must be solved by using Draft objects instead of sketches. Draw two rectangles and subtract one from the other.. and also pay attention to the "direction" of drawing because if you use DWires you must draw the lines in the counter-clockwise direction! As you already pointed out, that seems strange but it's actually how the geometry used in FreeCAD affects the features. The workaround could be to add some "if" clauses to check the orientation of one surface before extruding, but it's a bit cumbersome in the code and I'm lazy :)
In previous versions of flamingo I used the function "makeProfile" from Arch workbench also to create hollow tubes but lately I found that it do not work because it subtract the outer rectangle from the inner. (@yorik, did you notice?)
hatari wrote: Mon Mar 11, 2019 3:01 pm [*] If you join edges in order to position structures and then trim/extend them, after this operation the position of the profiles is reset. Bug or feature?
maybe because you use the trim button in the toolbar to modify a beam belonging to a "framebranch": like "pypebranches" they are hard-linked to the .Base underneath (DWires or Sketches) so they are always recomputed according the length of the edges. That won't happen if you have a loose "Structure" object or if it is included in a "frameline" group, instead.
To trim the beams belonging to a framebranch it's necessary to use the buttons in the relevant dialog: [Get targets] (to select the cutting edges: also with multiple selection to perform the action at both ends) and [Trim/Extend]
hatari wrote: Mon Mar 11, 2019 3:01 pm [*] Nice to haves/Feature requests
Have you ever thought about a tool that lets you choose how your profile will be aligned to the structure path like common commercial Frame Managers have? (for example like shown here: https://www.youtube.com/watch?v=QfDS_gCP_s0). Would that be even possible?
screenshot9.png
yes. Making a dialog to create customized sections is in the TODO list for long and I think now it's time to implement.
hatari wrote: Mon Mar 11, 2019 3:01 pm [*] Is there a way to make parametric miter corners with a bisect plane in situations like this?
miter.png
[/list]
as @engdham says, I looked inside the Frame workbench but I still did not found a good solution to integrate: the matter is that all commands in flamingo are suited to work with object that have some specific properties in their class definition, similar to Arch.Structure, while that workbench defines a new FeaturePython to make the head and tail ends "trimmable". Maybe in future I could find a good strategy to include also the objects of Frame wb.
oddtopus
Posts: 142
Joined: Tue Sep 20, 2016 6:17 pm

Re: Flamingo (Workbench) discussion thread

Post by oddtopus »

Finally I had the chance to patch flamingo for the py3qt5 issues and found it was not too far from compatibility.
Except some forgotten "print" statement and few syntax change, almost all commands are working fine, at least using the appimage version FreeCAD_0.19.16121_Conda_Py3Qt5_glibc2.12-x86_64.AppImage

OS: Linux Mint 19
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16121 (Git) AppImage
Build type: Release
Branch: master
Hash: a7919b63dea4bb1f1107c80ed44758479eec3d8d
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)

I guess I have to thank the PySide module is still there, so I didn't need to deal with "PyQt5.QWidgets" syntax changes, which I feared at the beginning.

The only upsetting drawback is that I had to remove the shortcuts handled with callback functions from dialogs, which seems to generate a kind of SIGSEGV error. Also this error happens frequently when I close a dialog with the ESC key instead the pushbutton "Cancel". I still don't understand why that was not an issue with previous versions! Can anyone give an hint?

Also, please, if you notice any misbehaviour inform if there is any issue with other installations.

thx
oddtopus
Posts: 142
Joined: Tue Sep 20, 2016 6:17 pm

Re: Flamingo (Workbench) discussion thread

Post by oddtopus »

Few questions for programmers:
  1. in versions with py3, when I import PySide, am I actually importing PySide2?
  2. I mean, is it an alias created under the hood just to save compatibility with older code?
The reason is that I got an error while using the method QInputDialog.getInteger() and realized that in Qt5 QInputDialog has moved to QtWidgets class and that method has changed syntax to QInputDialog.getInt().
So, at the end,
  • is it correct for "dodo", which is aimed to work only with py3qt5, to import directly PySide2 in the code?
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Flamingo (Workbench) discussion thread

Post by Jee-Bee »

oddtopus wrote: Sun Apr 14, 2019 8:08 am Few questions for programmers:
  1. in versions with py3, when I import PySide, am I actually importing PySide2?
  2. I mean, is it an alias created under the hood just to save compatibility with older code?
See: https://forum.freecadweb.org/viewtopic.php?t=32947
oddtopus
Posts: 142
Joined: Tue Sep 20, 2016 6:17 pm

Re: Flamingo (Workbench) discussion thread

Post by oddtopus »

Thx. :)
oddtopus
Posts: 142
Joined: Tue Sep 20, 2016 6:17 pm

Re: Flamingo + dodo wb discussion thread

Post by oddtopus »

Finally dodo is committed: https://github.com/oddtopus/dodo
That is the workbench intended to replace flamingo for releases >= 0.18 of FreeCAD.
At present time, except the basic adaptations to py3 and qt5 syntax, it's just been introduced a new input method of pype elements based on PieMenu (preliminary shortcut: Ctrl+Q). Thanks to @triplus, @looo and @microelly for developing that.
In this regard I wish to further elaborate on that subject in order to make the drafting of pipelines and frames faster. Actually the main targets of starting a new wb, rather than continue to develop flamingo, are
  • re-think the interface and working process
  • eliminate unused or unstable features
  • achieve compatibility with py3 syntax and qt5 widgets
  • general cleanup of the code
  • redefine FeaturePython containers, namely PypeLine and FrameLine, to be based on Parts of PartDesign so that they can be moved rigidly with their origin
  • insert dialog to build customized sections [BTW: now the standard square-tube sections are working again with the new release of Arch!)
Also this is the opportunity to optimize few things left behind. For example now the "insert pipe" dialog recognize which part of a reduction is selected, thus adapting automatically the size of the pipe according to which port is selected.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Flamingo (Workbench) discussion thread

Post by Kunda1 »

Dodo WB added to FreeCAD-addons and is now available through the Addon Manager

Edit: We need to add a blurb to https://github.com/FreeCAD/FreeCAD-addo ... Details.md and also move the flamingo wb to the py2/qt4 list. Also a wiki page should be made for dodo.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply