Screw Maker
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Screw Maker
Thanks Ulrich, success!
Mike
Mike
Re: Screw Maker
Thanks again Ulrich for this great macro.
I needed to 3D print a nut for my tripod (1/4" UNC).
I managed to make a few by changing a M6 ISO4032 nut with the following parameters:
In the python script, I modified line 1403:
And added some tolerances in 4006 and 4306 like mr_cg suggested it: (0.6 instead of 0.4)
All in one, the nut is OK. It needs a little force but it can be done with 2 fingers only
For those interested, I have uploaded the design.
Let me know if you change it.
Thanks
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6706 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
I needed to 3D print a nut for my tripod (1/4" UNC).
I managed to make a few by changing a M6 ISO4032 nut with the following parameters:
In the python script, I modified line 1403:
Code: Select all
'M6': (1.27, 0.2, 6.75, 9.5, 12.1, 4.7, 3.9, 10.5),
Code: Select all
d = float(d) + 0.6
For those interested, I have uploaded the design.
Let me know if you change it.
Thanks
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6706 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
- Attachments
-
- nut_tripod.FCStd
- (483.17 KiB) Downloaded 149 times
Re: Screw Maker
I made an update to Screw Maker, in order to play together with Bodies and Parts. The screws do now observe the placement of a Body. If the Body is inside of a Part, the screw is added to the Part as well. I tried to improve the orientation of the screw-placement. So hopefully there are less cases with flipped screws inserted.
Ulrich
Ulrich
- Attachments
-
- screw_maker2_2.py.zip
- (36.05 KiB) Downloaded 719 times
Re: Screw Maker
Thanks for the update ulrich1a. Works as advertized!
This has been my go-to macro of all time.
This has been my go-to macro of all time.
"It is a poor workman who blames his tools..."
Re: Screw Maker
Thanks for the update. I think my git build is still got a few issues after the qt5 update. Anyway screwmaker isn't working.
Upon loading freecad I get the these lines, including them incase they are related
Cory
EDIT: I found this is a problem when migrating from qt4 to qt5 which I was forced into a few months back. https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5
== QCoreApplication::UnicodeUTF8 is deprecated ==
This enum type used to define the 8-bit encoding of character string arguments to translate(). This enum is now obsolete and UTF-8 will be used in all cases. So remove all instances of QCoreApplication::UnicodeUTF8. For example:
Cory
Upon loading freecad I get the these lines, including them incase they are related
When trying to execute the screwmaker macro I get thiscory@cory-laptop ~/buildfreecaddev $ ./bin/FreeCAD
FreeCAD 0.18, Libs: 0.18R13799 (Git)
�� Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2018
##### #### ### ####
# # # # # #
# ## #### #### # # # # #
#### # # # # # # # ##### # #
# # #### #### # # # # #
# # # # # # # # # ## ## ##
# # #### #### ### # # #### ## ## ##
Fasteners workbench Loaded
During initialization the error UI file does not exist occurred in /home/cory/buildfreecaddev/Mod/Draft/InitGui.py
Please look into the log file for further information
During initialization the error UI file does not exist occurred in /home/cory/buildfreecaddev/Mod/Arch/InitGui.py
Please look into the log file for further information
thanks againTraceback (most recent call last):
File "/home/cory/.FreeCAD/screw_maker2_2.py", line 5448, in <module>
class ScrewMacro(object):
File "/home/cory/.FreeCAD/screw_maker2_2.py", line 5451, in ScrewMacro
d.ui.setupUi(d)
File "/home/cory/.FreeCAD/screw_maker2_2.py", line 1771, in setupUi
self.retranslateUi(ScrewMaker)
File "/home/cory/.FreeCAD/screw_maker2_2.py", line 1781, in retranslateUi
ScrewMaker.setWindowTitle(QtGui.QApplication.translate("ScrewMaker", "Screw-Maker 2.2", None, QtGui.QApplication.UnicodeUTF8))
<type 'exceptions.AttributeError'>: type object 'PySide2.QtWidgets.QApplication' has no attribute 'UnicodeUTF8'
Cory
EDIT: I found this is a problem when migrating from qt4 to qt5 which I was forced into a few months back. https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5
== QCoreApplication::UnicodeUTF8 is deprecated ==
This enum type used to define the 8-bit encoding of character string arguments to translate(). This enum is now obsolete and UTF-8 will be used in all cases. So remove all instances of QCoreApplication::UnicodeUTF8. For example:
toHref_Gui->setWindowTitle(QApplication::translate("Href_Gui", "Url / www", 0, QApplication::UnicodeUTF8));
label->setText(QApplication::translate("Href_Gui", "Text:", 0, QApplication::UnicodeUTF8));
label_2->setText(QApplication::translate("Href_Gui", "Url:", 0, QApplication::UnicodeUTF8));
label_3->setText(QApplication::translate("Href_Gui", "Target / Name:", 0, QApplication::UnicodeUTF8));
Just FYIHref_Gui->setWindowTitle(QApplication::translate("Href_Gui", "Url / www", 0));
label->setText(QApplication::translate("Href_Gui", "Text:", 0));
label_2->setText(QApplication::translate("Href_Gui", "Url:", 0));
label_3->setText(QApplication::translate("Href_Gui", "Target / Name:", 0));
Cory
Re: Screw Maker
Thanks. I like this macro/module a lot.
One question: How can I make the screws solid internally?. They are hollow:
EDIT: Maybe they are not hollow and it is a trick of the clip plane, when exporting the STL and opening it in Slic3r infill is generated...
Re: Screw Maker
CheckGeometry tells it's solid and cutting someth e.g. with a boolean cut shows it as well. It must be the meshing which makes it a shell.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Screw Maker
Thanks for the two pointers. Why did not I think of it?
When using checkGeometry on a M6x30 screw I get this: The geometry is not valid. I am using:
OS: Ubuntu 16.04.4 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.13920 (Git)
Build type: None
Branch: master
Hash: 08910e71e423c02da46018c47e34002df4fde1f9
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
The screw I obtained it from the fasteners WB. I just updated it (is there an obvious way of getting the WB version?).
In my special screws, which have a thread pitch of 3mm, I get also an invalid solid, but it says unconnected shell: If I try to cut it with the cube, FreeCAD crashes.
I am not sure what you will load without my WB installed, by the file is this: When I load these in slic3r, I am getting this: I will review the code I am using, as maybe I am doing something really wrong....
Re: Screw Maker
I know how to cause/prevent the problem. If I use a pitch size of 3mm the problem is there as above. However if I use a pitch size of 2mm there is no problem. Perfect solid to checkGeometry. Perfect solid when cutting. Perfect Import to slic3r.
Any idea why the pitch size could be the problem?
Any idea why the pitch size could be the problem?
Re: Screw Maker
I have shared my experimental WB in here:
https://github.com/abdullahtahiriyo/ConstructionToy
I do not think it will be generally useful. It is just a toy...
BTW, it requires ScrewMaker 2.2...
https://github.com/abdullahtahiriyo/ConstructionToy
I do not think it will be generally useful. It is just a toy...
BTW, it requires ScrewMaker 2.2...