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!
Post Reply
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 »

DriectScale is merged to the main branch.

Known issues:
1- Resizing X,Y and trying to resize Z might fail. I cannot understand why COIN3D cannot find the drawing under the mouse. The same widget I use for all 3 arrows, but sometime it doesn't respond. By clicking OK and re-running the tool and trying to drag the blue arrow (Z direction) will/should work .. why? don't know why it didn't work when you moved the other arrows.
2-Scaling is not exactly equal to the arrows movement. This could cause some issues.
3-This tool might not be suitable for complex shapes as it requires to recompute many times. I can make it less demanding , but it meas also that the 3D object will not be resealed before releasing the mouse button.. only the arrow will be moved.

Please feel free to use it, leave notes or suggestions.
Thanks.
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 »

Edited and Updated:
Design456_Fillet
The tool is merged to the main branch.

I have some issues:
Link to the video - it is not embedded otherwise it will not be shown here.
https://youtu.be/PNDm3OGNGoU
Updated video
https://youtu.be/pZpTKBRN6Wk

Known issue :
1-Unsuitable fillet radius might crash FreeCAD.
2-I cannot rotate the arrow As I want. The angels doesn't seems to work correctly. Don't know why. (Help will be appreciated)

https://github.com/MariwanJ/Design456

Feel free to use it, help in fixing the issues, report bugs.
Attachments
smartfillet.jpg
smartfillet.jpg (123.11 KiB) Viewed 4344 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 »

New "Fr_Widget" s published at my github.
Look at the video please :

https://youtu.be/-b1-dYvEeZw

More of them will be added. All kind of useful drawing will be added.

You have NurbsFace and SquareFace, SquareFrame ..etc included now.
Other useful drawing in COIN3D will be added.
These objects are with callback system. You need to write your callback function to take benefit of the callbacks.
Warning:
Please notice that the widget system is under heavy development. They are not on their final shape or code.
Here is the source code for the drawing shown in the video .. simple :

Code: Select all


import fr_coinwindow as wn
import fr_square_widget as square
import FreeCAD as App
g=[]
p1=App.Vector(2,2,5)
p2=App.Vector(22,2,5)
p3=App.Vector(22,22,5)
p4=App.Vector(2,22,5)
g.append(p1)
g.append(p2)
wny=wn.Fr_CoinWindow("MyWindow")
g.clear()

g.append(p1)
g.append(p2)
g.append(p3)
g.append(p4)
col=(0,0,0)

square_ =square.Fr_SquareFace_Widget(g,'square',2)
wny.addWidget(square_)
wny.show()

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 demonstration about how you can use the Fr_Widget(s).
In this video I show you how you can make a multiple sided pyramid base using simple code in the coin3d world. This function could be used to draw any kind of multi-sided shapes.
There are other functions in the fr_draw that you can use to draw more complex shapes.
By creating special class, you can combine several drawings to achieve other 2D/3D drawings.
More drawing functions will be added to the fr_draw.py

https://www.youtube.com/watch?v=D8128XSDMNc

source code of the script:

Code: Select all

from pivy import coin
import math
import fr_draw as d 
import time
from PySide import QtCore,QtGui
sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
for i in range( 3, 25):
    f=d.draw_polygonBase(i,10,0,App.Vector(0,0,0), (0,1,1))
    root=f.draw()
    sg.addChild(root)
    QtGui.QApplication.processEvents()
    FreeCADGui.updateGui()
    time.sleep(0.5)
    sg.removeChild(root)
    QtGui.QApplication.processEvents()

arange=range(3,25)
revrange=reversed(arange)
for i in revrange:
    f=d.draw_polygonBase(i,10,0,App.Vector(0,0,0), (0,1,1))
    root=f.draw()
    sg.addChild(root)
    QtGui.QApplication.processEvents()
    FreeCADGui.updateGui()
    time.sleep(0.5)
    sg.removeChild(root)
    QtGui.QApplication.processEvents()


Attachments
coin3d.jpg
coin3d.jpg (372.76 KiB) Viewed 3833 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 »

More drawing with examples:
Box:
https://www.youtube.com/watch?v=sgponRFhjWo

Four Sided Shape - with or without texture:
https://www.youtube.com/watch?v=ei0OBUMVKWo

Note:
These can be adapted to be as a widget and can get events. At the moment they are only drawings.
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 »

FYI:
Any one wish to learn/use the Fr_Widget toolkit: I started to write some documentations with examples. This will help you to understand how you can use the toolkit, or help in developing further the toolkit.
At someday, I hope this will be a part of the FreeCAD. Specially if I can provide as many as I can base drawings for creating widgets.

I made several tutorials explaining the COIN drawing. Hope there will be other developers willing to help in creating new widgets.
Nice drawing, nice tools: that is what I am trying to achieve.

Link:
https://wiki.freecadweb.org/FreeCAD_GUI_Widgets_toolkit
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 »

Development is on going Intensively. While I am still understanding both Coin, FreeCAD, but I learned much of the mechanism to draw in coin and to do things in FreeCAD.
There are still toooo much more to learn :cry: .
ROADMAP:
When I implement any tool , I might face difficulties. From school I learned to not waste all the time with one question while there are many other questions remained to answer. That is why I might leave some bugs not fixed (since I don't have a solution) and I go further to understand and implement other tools. So please be aware of that. Sure I come back to solve that issue as soon as I have an understanding

Now for this post:
-Smart Chamfer and fillet: bug fixed . But still Please be aware that these tools are dangerous. I have no idea hot to prevent FreeCAD crash if the radius is not suitable.
-Extrusion is some how working. But I need to implement the subtraction/merge mechanism. I am working on that.
-I appreciate any help. Any kind of help in developing, making tutorial ..etc.
-Please notice that I write also some WIKI about the FR_WIDGET toolkit. Try it, test it and you might develop some widgets also. I hope you use it when you want to draw in coin. It is much easier and you get the ability to interact with the tools using callbacks.

Thanks. :D
User avatar
Pauvres_honteux
Posts: 728
Joined: Sun Feb 16, 2014 12:05 am
Location: Far side of the moon

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

Post by Pauvres_honteux »

marja1 wrote:
How about adding your youtube channel to your signature?
And make a screen cast on how to install your works of wonder?
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 »

The following video is about how you can install the Workbench from FreeCAD

https://www.youtube.com/watch?v=RomaDFQ1WoA
User avatar
Pauvres_honteux
Posts: 728
Joined: Sun Feb 16, 2014 12:05 am
Location: Far side of the moon

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

Post by Pauvres_honteux »

A big thumbs up!
Post Reply