Progress thread of New Design456 Workbench - FreeCAD's Direct Modeling workbench

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
chennes
Veteran
Posts: 3881
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Progress thread of New Design456 Workbench - FreeCAD's Direct Modeling workbench

Post by chennes »

adrianinsaval wrote: Tue Oct 12, 2021 11:22 am could you check it out? I think you've been working with the addon manager lately? sorry to bother if that's not the case.
Yes, I can look into it.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: Progress thread of New Design456 Workbench - FreeCAD's Direct Modeling workbench

Post by doia »

It seems I have the same problem with updating the Design 456 WB Add-on. I get the following message within the Add-on manager:

Code: Select all

On branch main
Your branch and 'origin/main' have diverged,
and have 779 and 816 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

You have unmerged paths.
  (fix conflicts and run "git commit")
  (use "git merge --abort" to abort the merge)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both added:      Design456_2Ddrawing.py
	both added:      DirectModeling/Design456_SmartExtrudeRotate.py
	both modified:   FACE_D.py
	both modified:   InitGui.py
	both added:      ThreeDWidgets/fr_degreewheel_widget.py
	both added:      plane.py

no changes added to commit (use "git add" and/or "git commit -a")
Design456 was previously installed and working. On opening the Add-on manager and selecting the D456 WB there is a message that an update is available (blue banner on top). On pressing "Install/Update selected" the above mentioned message appears. After restart of FC the D456 WB is not listed in Preferences->Workbenches, but the Add-on manager shows D456 as installed.

FreeCAD version:
OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.25997 (Git)
Build type: Release
Branch: master
Hash: 77b198048a63f1e9ca15eef64c8042d599a14cf3
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: C/Default (C)

Edit:
Going into the install folder under ~/Library/Preferences/FreeCAD/Mod and using a manual git pull command did not resolve the error.
I manually deleted the D456 folder from ~/Library/Preferences/FreeCAD/Mod, restarted FC and reinstalled D456 from the Add-on manager. Now it works again. But I'm puzzled why there were messed up git commits, as I did not tinkered with the Mod folder directly before.
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Progress thread of New Design456 Workbench - FreeCAD's Direct Modeling workbench

Post by mariwan »

Remove the folder totally and reinstall it from Addonmanager.
It seems that your files are changed (why don't know) and git cannot update it as there is a conflict between them. So, remove the directory totally and reinstall it please.
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Progress thread of New Design456 Workbench - FreeCAD's Direct Modeling workbench

Post by mariwan »

A note regarding a behavior you might find in my WB.
As I discussed this issue before, I would like to make it clear for everyone. This is not a bug. Or it is a bug but there is no solution than what I suggest for you now.

Problem Description:
Any movement, extrusion ..etc of COIN3D drawings I have, uses the mouse movement. First click is counted as selection/give focus if not mouse movement detects. But as soon as you click and move the mouse without having a release, mouse-DRAG will activates. It will not finish that before getting a release event.
This is an issue if you want to select a face, edge ..etc after you started a tool. Even if you make mouse release, but you have the mouse over the 3D object (FreeCAD - not my COIN3D drawing), my widget cannot detect the mouse release since FreeCAD uses the events and doesn't forward any event to my widget.

Solution or workaround the issue:
I introduced before the availability of Enter (both Keypad and Enter) and letter key "E" as a replacement for the mouse-release event.

I am afraid there will be no other solution for this problem. At least if this workbench not gets all events from FreeCAD core. That will not be achieved if this workbench dosen't become as a part of FreeCAD, I am afraid.
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Progress thread of New Design456 Workbench - FreeCAD's Direct Modeling workbench

Post by mariwan »

After a looooong period of developing the Smart_ExtrudeRotate tool, I finally released it today. It was hard (for me) to implement this tools as there were many difficult questions to answer.
The tool is not perfect, and not really totally finished. But it is working and might be helpful for someone. I will come back to it when I know more and come with other solutions. But for now , I need to start new tools development.

Known problems:
-Difficult to rotate accurately the wheel.
-Not all directions is allowed to rotate
-Sometimes the wheel is rotating totally wrong. Due to the face-property.

But, at any time you can go to the revolve and manually change the angle. This will help you to make more accurate angle. The tool will help you to create a rotation for a face which is quite nice IMHO.

Please look at my videos while I was trying to implement this tool to get more idea about the difficulties.

Note:
Fl_Dial in FLTK uses this technique to translate mouse x,y direction to angle of rotation. I tried to use the same technique but it failed .. don't know why. I put the code

Code: Select all

    int mx = (Fl::event_x()-X-W/2)*H;
    int my = (Fl::event_y()-Y-H/2)*W;
    if (!mx && !my) return 1;
    double angle = 270-atan2((float)-my, (float)mx)*180/M_PI;
You might be able to implement that in python.. if so, please share it with me.
phpBB [video]
Attachments
extruderotate.jpg
extruderotate.jpg (189.12 KiB) Viewed 3281 times
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Progress thread of New Design456 Workbench - FreeCAD's Direct Modeling workbench

Post by mariwan »

Bug fix:
I discovered when I changed a function in the FACE_D.py for some times ago to make it more useful for the last tool (ExtrudeRotate), that change causes a failure. The bug affected Chamfer and fillet.

Code: Select all

def getDirectionAxis():
    """[summary]

    Raises:
        Exception: [description]
        NotImplementedError: [description]
        Exception: [description]

    Returns:
        [str]: [Returns +x,-x,+y,-y,+z,-z]
    """
    try:
        if s is None:
            s = Gui.Selection.getSelectionEx()
        
This was changed to

Code: Select all

def getDirectionAxis(s=Gui.Selection.getSelectionEx()):
But this was failing and s was getting nothing.
This must be an issue with python. Don't know why.
Anyway, the bug is fixed. Sorry for that.
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Progress thread of New Design456 Workbench - FreeCAD's Direct Modeling workbench

Post by mariwan »

Design456_Paint Released: :D

I am happy to announce that one of the funniest tool is released. There will be updates for this tool. But At the moment it is in a good shape.

1-You can draw the shapes listed in the list-box and change their sizes.
2-You move the shapes with the mouse
3-You can limit the axis by pressing X,Y,Z and press A for free movements on all directions.
4-Depending on the plane you choose, the shape will be placed. You can continue drawing by just pressing the plane (TOP, BOTTOM, LEFT, RIGHT, FRONT & BACK)
5-You need to have the shapes intersecting to allow fusion to work. But you can place shapes even if they are not intersecting. But that will be somehow weird. You can click OK each time you draw something that you don't need to merge it.
6-Shapes are with an extrusion of 0.1mm . If there are requests of making the shape just 2D I can add that. But at the moment I leave it like that.
7-Usign my Design456_Extrude or Design456_SmartExtrude you should be able to extrude the objects (or the final object).

Please notice that even Primitive parts could get that kind of help in limiting the axis by pressing X,Y and Z .. But there is no A there yet.

I hope you find it useful, funny :lol:

Other things:
There were some small bugs that are fixed. Notice that some of the bugs I have, I don't know how to solve them. I didn't forget them but I need to make and release other tools that might help user and learn more how to fix the old problem.
I ask you all, please due to my limited time, I am not able to make tutorials and write down the documentations for these tools. I will appreciate any one wish to write that for my WB. Please let me know.
Thanks
phpBB [video]
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Progress thread of New Design456 Workbench - FreeCAD's Direct Modeling workbench

Post by mariwan »

Design456_Hole is released:

Known issues:
1-Difficult to take care of all kind of objects in FreeCAD.
2-Group will fail since they don't have Object.Shape
3-Some other objects might fail if they are 3D objects and they have only one face. Torus works since I have an "if" for that. Needs to get all similar objects to make if statement for them.. at the moment I don't know!
hope you find it useful.
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Progress thread of New Design456 Workbench - FreeCAD's Direct Modeling workbench

Post by mariwan »

Bug fixed for Design456_SmartExtrude:

I discovered that when you draw on a surface of any 3D object using Draft and make a cut of that shape on the 3D object, a(Fusion) object was created which was wrong.

User could delete that object and should work. but was not correct :oops:
This bug now is fixed and should work.

You can draw any 2D object on any surface using draft and extrude that face with Subtract to create a cut (hole) inside on that shape. This is a basic requirement for DirectModeling.
Hope you find it useful.
User avatar
mariwan
Posts: 469
Joined: Wed Jan 06, 2021 2:00 pm

Re: Progress thread of New Design456 Workbench - FreeCAD's Direct Modeling workbench

Post by mariwan »

Due to the complexity of the objects, Smart Extrude had/has some bugs. I could find some of them, but there are more.
This is because the combinations you get when you are NOT simplifying the objects after manipulations.
In the video you see that everything went OK to the time I tried to make a hole in the bottom side of the box. First Draft failed to draw on the surface, second the Base and tool became wrong.

Kind of combinations you get for the tool to think about:
1-You have a 2D you use it to cut one or multiple 3D objects.
2-You have 3D object, you use a face of it to cut one or multiple objects.
3-You have a 2D you use extrude making contact to none, one or multiple 3D objects.
4-You have 3D object, you use a face of it to making contact to none, one or multiple 3D objects.
5- or you just leave it as it is.

The difficulties come when you need to find the objects surrounding the new extruded object for merge or for cut. And they might have complex shapes and dependencies.
For sure it should work but I need more time to test all these possibilities. a long I wouldn't capture all problems/failure. I hope when I have more complete tool set, people start to use the WB and report things to me.
Please feel free to report, make PR, .etc.
Thanks for reading.

phpBB [video]
Post Reply