Library and Structure WB

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
fdomateu
Posts: 7
Joined: Thu May 17, 2018 7:14 am

Re: Library and Structure WB

Postby fdomateu » Sun Jun 17, 2018 6:21 pm

I have been reading and learning FreeCAD and I also have checked, not in deep, the flamingo workbench. As emills2 has mentioned, the CSW is a nice idea but has the problem of flexibility. Would be nice if the complete sketch from the profile is defined at the file and not only some geometrical parameters from a pre-defined sketch.

I have been cheking the difference between part and body in FreeCAD. I am still not 100% sure about the difference, any help will be appreciated. The best explanation that I have found is at the following discussion:

https://forum.freecadweb.org/viewtopic.php?f=9&t=15269

According the explanation from ickby, body is part of PartDesign workbench and the features from this WB can be used with Body. The Library WB should include solids with some standard geometrical dimesnions and after the users should be able to make cuts, holes, bend operations, etc. For this reason, I think that all standard parts should derive from body.

After a few work, I have define a propose of class structure on the Library WB. The diagram shows the object (classes) that I want to define at the library WB and the end structure of the standard components at the library. I will be very happy if the developers from the different WB propose their ideas and show interes on this Workbench.

To define the structure showed at the picture, I have use as base the Autodesk Inventor library structure and the spanish uBIM guide from the BuildingSMART web.

My next step is to learn a littel of C++ and analyze in deep the PartDesign Workbench to define tha classes. At my actual status, I think that the additive primitive comands from PardDesign WB are a good base to create the code of the libary WB. For the moment I think to use C++ for the WB and python for the sketches files, the equivalence of CSW at flamingo WB. if someone thinks that this is a good base to start a WB I would like that some poeple with knoleg on C++ and FreeCAD development helps.
Attachments
LibraryParts.jpeg
LibraryParts.jpeg (197.34 KiB) Viewed 172 times
fdomateu
Posts: 7
Joined: Thu May 17, 2018 7:14 am

Re: Library and Structure WB

Postby fdomateu » Sun Jun 17, 2018 6:46 pm

Regarding the geenration of each body, actually i think that the library WB should allow the creation from python scripts or from the different CAd formats that are compatible with FreeCAD.

The step models do not save the properties from the original model, for this reason, at the case that the user wants to create a new standard component from a step model, the user should should combine the python scripts with step model. at this fistr propose, the step model will have the geometry and the python script will have the properties from the parts.

At the case that the users wants to use IFC files, the classes from the BIM or MEP family shoudl be defined accorfing the IFC standard to be able to create a body without any problem and withour lossing information. Bellow there is a picture about how should appear each standard part at the tree from FreeCAD. At the moment, I have not found any aditional WB that is working according the features from the version 0.17. If there is any I will apreciate the comment to check the code and try to use as a base.
Attachments
CapturaFreeCAD.PNG
CapturaFreeCAD.PNG (9.19 KiB) Viewed 167 times
fdomateu
Posts: 7
Joined: Thu May 17, 2018 7:14 am

Re: Library and Structure WB

Postby fdomateu » Tue Jun 26, 2018 9:19 pm

I am playing with FreeCAD to understand the code and be able to go forwards with my propose of WB. I still not have the knowlege to be able to start the workbench, I need to discover how can I create an object that derives from Part or Body. Can someone explain me how can I create a standard object class where the parent is the part or Body object? Does someone recomend a new class different to Part or Body tat also derive from BodyBase?

For the moment I have discover a way to get the end result mentioned at the previous post using python. I have created the encapsulate function to be used inside the scripted objects like all the primitive object to get them as a Part with the origin. Has someone a different idea about this issue to get the same ressult in a more efficient way?
Attachments
EncapsulateObject.PNG
EncapsulateObject.PNG (24.1 KiB) Viewed 115 times
fdomateu
Posts: 7
Joined: Thu May 17, 2018 7:14 am

Re: Library and Structure WB

Postby fdomateu » Mon Jul 09, 2018 8:40 pm

Hi,

I have made a few tests to continue with the evolution of the library workbench that I proposed. Actually I am able to make some test with the encapsulate function for round and rectangulars bars and tubes, with this function I am able to make the following:
  • Python object
  • Part: Python feature inside a part
  • Body: Python feature that is introduced at a new body using the bolean operation
  • Body inside part: Python feature that is introduced at a new body using the bolean operation, and this body is incuded at a part
I have also start to work on the definition of the clases from the diagram attached some weeks ago. During this work I have arrived to the conclusion that the best option is to define two object for each standard part, the geometrical object and the information object. I have attached a first version of the standard washer ISO 7092. The info objects are still not defined but you can see some information that I want to include at the future.

Actually I am not making anything new, I only extract the code from fasteners and Arch Workbench and I write tehm on a diferent way. My actual intention is not to make something completly new, I only introduce the option of type of object that I create (Body, part, etc.). For other side, I also make a modular library of "standard parts"/ Scripted parts. For example, the power users cannot add or delate any new profile to arch WB making only a copy of one python file at one directory without taking care about the WB code, same issue at the fasteners WB. The new workbench will import all the python scripts that can be found at the library directory, the user will not need to change any line of code insisde any WB, he will only need to download the scripted file and copy it at the directory. The user that can write python will aslo be able to create a new standard part following some rules and without any modification of the WB code.

Finally I also have started to create the IDE for the library workebch. I have started to define the IDE following the standards from AutoDesk, I know solidworks but I am user from Inventor. You will find my progress at the picture attached bellow. My intention is to continue with the design according Inventor but prepare the software to have an end version where the user can decide at the preferences if they want something silimar to Inventor or if they prefer something similar to the actuar Arch WB.

If you have any comment, please do not be hesitate to post your ideas and comments.
Attachments
ISO 7092 test.PNG
ISO 7092 test.PNG (31.27 KiB) Viewed 68 times
ISO_7092-test.py
(4.18 KiB) Downloaded 2 times
triplus
Posts: 7037
Joined: Mon Dec 12, 2011 4:45 pm

Re: Library and Structure WB

Postby triplus » Wed Jul 11, 2018 7:24 pm

Hi @fdomateu.

I don't have much time ATM to do any testing. But your approach sounds good and hopefully you will get some feedback from potential users soon.
User avatar
Kunda1
Posts: 2474
Joined: Thu Jan 05, 2017 9:03 pm

Re: Library and Structure WB

Postby Kunda1 » Wed Jul 11, 2018 7:44 pm

I agree, people are keeping an eye on this..there is also a lot going on the FC world right now with the influx of a lot of participation and community growth (this project included) but please don't despair if you aren't seeing much participation ATM). Keep going!
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features