Fasteners workbench based on screw-maker

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!
leocadle
Posts: 6
Joined: Thu Sep 24, 2020 12:03 am

Re: Fasteners workbench based on screw-maker

Post by leocadle »

Thanks for your work on Fasteners WB. I have a couple of questions and maybe a suggestion.

I have to click on a face to add a tap or rod, if I select a hole edge instead I cannot create the Boolean. I am using Windows with FC 0.19 22756 I added Fasteners WB via the add-on manager

I was wondering if it might be better to move the 3D Printing Compatible threads to the Parameters area, it would make it more intuitive for people unfamiliar with FC, rather than go to Preferences. Also that could mean you might have one part to be 3D Printed and one to be manufactured differently.

Cheers,
Leo.
aldoz
Posts: 11
Joined: Fri Oct 30, 2020 12:05 pm

Re: Fasteners workbench based on screw-maker

Post by aldoz »

It would be usefull if we could choose the thread pitch, at least between the official values stated for each diameter.
For instance I'm designig a 3/4 inch nut in 12 thread for inch style but the provided nuts give me always 10 threads per inch.

The same apply to most ISO thread that are available in more pith values for each diam.

Sorry if this question has been already posted.

Aldo.
bowcoastie
Posts: 17
Joined: Tue Sep 10, 2019 2:04 am

Re: Fasteners workbench based on screw-maker

Post by bowcoastie »

Hello everyone, I am using the Fasteners WB to print 3-d holes that I need to adjust. I see in the settings the A and B parameters and have started to adjust them but it would be helpful to know what they represent; can anyone tell me what they actually adjust?

Thank you all.
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: Fasteners workbench based on screw-maker

Post by shaise »

a is a multiplying factor over the thickness of the fastener
b is a fixed factor added to the thickness.

So, say a thread is M5, its usual thickness is about 5mm, If a is 0.98 and b is -0.1 then the new thickness will be 5 x 0.98 - 0.1 = ~4.8 mm
bowcoastie
Posts: 17
Joined: Tue Sep 10, 2019 2:04 am

Re: Fasteners workbench based on screw-maker

Post by bowcoastie »

Thank you so very much for your response and the great work bench! :D
steve123
Posts: 149
Joined: Fri Sep 04, 2015 8:58 pm

Re: Fasteners workbench based on screw-maker

Post by steve123 »

I see that using Ulrich's macro is problematic because the origins of the macro were intended to address very specific thread requirements and not generic thread generation. As such, the macro evolved over time to generate a very defined range of threads with no ability to generate a custom thread.

I googled around and found some OpenSCAD libraries and since FreeCAD has support for OpenSCAD, I wonder if it would be possible to create a wrapper for one of these?

https://github.com/adrianschlatter/threadlib
https://dkprojects.net/openscad-threads/
https://www.thingiverse.com/thing:3131126

Probably beyond my ability to do so because I have very little knowledge of writing FreeCAD modules. But, maybe worth a discussion to see if there is any merit to the idea.
User avatar
alex_55
Posts: 63
Joined: Mon May 11, 2020 1:50 am

Re: Fasteners workbench based on screw-maker

Post by alex_55 »

steve123 wrote: Wed Feb 10, 2021 5:11 pm I googled around and found some OpenSCAD libraries and since FreeCAD has support for OpenSCAD, I wonder if it would be possible to create a wrapper for one of these?
A reasonable suggestion that I've looked into a bit in the past. The trouble is that OpenSCAD has -ZERO- support for helices and path sweeps, which are what we normally use for thread generation in FreeCAD. The OpenSCAD threading libraries approximate helical sweeps using translated polyhedra. Using one of them in FreeCAD's SCAD WB results in a thread that has many flat segments and takes ages to compute.

We are in a tough spot with FastenersWB I think. It (as well as Ulrich's Macro) are intended to create representations of standardized fasteners. However, the FreeCAD community clearly has a need for a more generalized 'threading toolkit' that is likely somewhat out of this WB's scope.

One way to take matters into your own hands is to access the FastenersWB thread geometry generating code directly:

Code: Select all

import ScrewMaker, Part, FreeCAD
# variables (units are mm):
Dia = 10
Pitch = 1.0
Length = 10
InnerThread = False
# make the thread:
rots = round(Length/Pitch)
hrots = rots*2
generator = ScrewMaker.FSScrewMaker()
if InnerThread:
  # tap object to cut internal thread
	obj = generator.makeInnerThread_2(Dia,Pitch,rots,None,Dia)
else:
  # external thread
  # the function returns a shell object, but we can cap it 
  # and make it solid with a single circular face
  cap = Part.makeFace(Part.makeCircle(5,FreeCAD.Vector(0,0,2*Pitch)),"Part::FaceMakerSimple")
  shellthread = generator.makeShellthread(Dia,Pitch,hrots,True,0)
  obj = Part.makeSolid(Part.Shell(cap.Faces+shellthread.Faces))
Part.show(obj)
This code will get you any 60 degree screw thread, which is everything that the FastenersWB has code to create. For any one of the -MANY- other common thread profiles, it's currently best to just use the Part WB to model it yourself.
Attachments
customthread.FCMacro
(701 Bytes) Downloaded 66 times
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: Fasteners workbench based on screw-maker

Post by chrisb »

Thanks for the macro. I have added a newline so it can be pasted directly in the Python console without showing a syntax error:

Code: Select all

import ScrewMaker, Part, FreeCAD
# variables (units are mm):
Dia = 10
Pitch = 1.0
Length = 10
InnerThread = False
# make the thread:
rots = round(Length/Pitch)
hrots = rots*2
generator = ScrewMaker.FSScrewMaker()
if InnerThread:
  # tap object to cut internal thread
	obj = generator.makeInnerThread_2(Dia,Pitch,rots,None,Dia)
else:
  # external thread
  # the function returns a shell object, but we can cap it 
  # and make it solid with a single circular face
  cap = Part.makeFace(Part.makeCircle(5,FreeCAD.Vector(0,0,2*Pitch)),"Part::FaceMakerSimple")
  shellthread = generator.makeShellthread(Dia,Pitch,hrots,True,0)
  obj = Part.makeSolid(Part.Shell(cap.Faces+shellthread.Faces))

Part.show(obj)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Fasteners workbench based on screw-maker

Post by Kunda1 »

Is it time we translate Fasteners workbench? ref: https://forum.freecadweb.org/viewtopic. ... 20#p395235
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
steve123
Posts: 149
Joined: Fri Sep 04, 2015 8:58 pm

Re: Fasteners workbench based on screw-maker

Post by steve123 »

@alex_55 Thank you for the feedback. I did not realize OpenSCAD could not sweep a helix. That is most unfortunate.

Thank you for the macro.
Post Reply