[WIP] Joint Macro

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

[WIP] Joint Macro

Post by TheMarkster »

With this macro you can create different kinds of joints on a selected face. It is still a work in progress. There will likely be changes coming that will break existing models.

https://github.com/mwganson/joint
macro_joint_scr1.png
macro_joint_scr1.png (77.8 KiB) Viewed 3263 times
macro_joint_scr2.png
macro_joint_scr2.png (49.36 KiB) Viewed 3263 times
Snip macro screenshot-eb5992.png
Snip macro screenshot-eb5992.png (100.17 KiB) Viewed 3263 times
Some joint types are fairly easy to use, like mortise, tenon, box joint. The others are more complicated and will require some fiddling and experimentation. The Finger Joint is really a dovetail joint with some different property settings.

Usage: select a face and run the macro, select the type of joint. Then edit the joint object properties to your satisfaction. Symmetric is currently the default and will need to be set to false for most cases. Reversed can be toggled if the object points in the wrong direction.

None of these have been printed and tested. Do not rely upon the defaults to create usable mates. This is all "by guess and by gosh" at this point.
Attachments
Joint.FCMacro
(67.63 KiB) Downloaded 81 times
spanner888
Posts: 326
Joined: Tue May 28, 2019 10:51 am

Re: [WIP] Joint Macro

Post by spanner888 »

TheMarkster wrote: Sun Dec 05, 2021 9:33 pm With this macro you can create different kinds of joints on a selected face. It is still a work in progress. There will likely be changes coming that will break existing models.
Very nice work, especially the range of joints and even more especially being fully parametric AFTER joint creation. Looking forward to watching this evolve even further!
User avatar
Vincent B
Veteran
Posts: 4713
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: [WIP] Joint Macro

Post by Vincent B »

Trying to test your macro, I can't start it. Got message:

Code: Select all

22:47:04  Traceback (most recent call last):
  File "C:/Users/vince/AppData/Roaming/FreeCAD/Macro/joint.py", line 1110, in <module>
    FreeCAD.Console.PrintMessage("Please run "+BASENAME+".FCMacro rather than this file.\n")
<class 'NameError'>: name 'BASENAME' is not defined
...
OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.26761 (Git)
Build type: Release
Python version: 3.8.12
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: French/France (fr_FR)
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: [WIP] Joint Macro

Post by TheMarkster »

Thanks for the report. You need to run the Joint.FCMacro file, not the joint.py file.
User avatar
Vincent B
Veteran
Posts: 4713
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: [WIP] Joint Macro

Post by Vincent B »

OK for that. :D
...
I gave 4mm as width, got 5mm for length of the tenon.
and 1 mm as length got it for the width.
Could be swap, isn't it?
Attachments
Capture.JPG
Capture.JPG (59.47 KiB) Viewed 2779 times
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: [WIP] Joint Macro

Post by TheMarkster »

Try setting Angle to 90 degrees.

Scratch that. I misunderstood the question.

I had to look at the source code to refresh my memory. This is the width:
Snip macro screenshot-a8042f.png
Snip macro screenshot-a8042f.png (60.49 KiB) Viewed 2723 times
The Length distance determines the radius of the arcs, so the actual width is Width+Length.
User avatar
bntarc
Posts: 50
Joined: Thu Apr 12, 2018 4:30 pm
Location: Illinois USA
Contact:

Re: [WIP] Joint Macro

Post by bntarc »

Thank you very much for the macro to create joint, It's great!

Could it be possible to add the Bridle joint?
Attachments
Bridle joint.png
Bridle joint.png (7.09 KiB) Viewed 2070 times
Bridle joint.FCStd
(41.55 KiB) Downloaded 44 times
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: [WIP] Joint Macro

Post by TheMarkster »

You should be able to do it with the mortise and tenon joint types.

Edit: The problem with that is the mortise and tenon types have rounded ends. I am updating the macro to include a new boolean property "Rounded" for mortise and tenon types. This will default to True. If set to False the ends will not be rounded. New version will be 0.2022.04.28. Should be up soon on the addon manager, within the next few minutes.
Snip macro screenshot-747946.png
Snip macro screenshot-747946.png (41.79 KiB) Viewed 1977 times
Snip macro screenshot-effbf4.png
Snip macro screenshot-effbf4.png (43.2 KiB) Viewed 1977 times
User avatar
bntarc
Posts: 50
Joined: Thu Apr 12, 2018 4:30 pm
Location: Illinois USA
Contact:

Re: [WIP] Joint Macro

Post by bntarc »

Thank for the update
I have done the update
I can't run the macro anymore...

14:16:59 Traceback (most recent call last):
File "C:/Users/Administrator/AppData/Roaming/FreeCAD/Macro/Joint.FCMacro", line 1276, in <module>
import joint as FP
<class 'ModuleNotFoundError'>: No module named 'joint'

Code: Select all

OS: Windows 10 (10.0)
Word size of FreeCAD: 64-bit
Version: 0.20.28671 (Git)
Build type: Release
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * A2plus 0.4.56
  * Assembly3 0.11.3
  * BOLTSFC
  * CurvedShapes 1.0.2
  * dxf-library
  * frame
  * parts_library
  * Reporting
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: [WIP] Joint Macro

Post by TheMarkster »

Check your macros to ensure you have a file named joint.py in it.
Snip macro screenshot-a3dc47.png
Snip macro screenshot-a3dc47.png (35.38 KiB) Viewed 1922 times
Post Reply