Giter Club home page Giter Club logo

threadprofile's Introduction

ThreadProfile Workbench

icon

Toolbar Icon

Download the SVG Toolbar Icon

Installation

Can be installed via the AddonManager in Tools menu -> AddonManager if you have a very recent build. Open the AddonManger. Click the Configure icon. Add this to the custom repositories section: https://github.com/mwganson/ThreadProfile Close and restart the AddonManager. You should now see ThreadProfile listed in the Workbench tab.

Overview

Use the 2d profile object created with this workbench to create threads by sweeping it along a helix of the appropriate height and pitch. It is compatible for use in both the Part and Part Design workbenches in FreeCAD. To use in Part Design if there is an active body the ThreadProfile object will be created inside the body. Then select the ThreadProfile object and click the Make Helix toolbar icon to create a helix. A new shapebinder will be created linking the helix, and the helix will be hidden. You can then sweep it as you would a sketch using either the Additive Pipe (for external threads) or the Subtractive Pipe (for internal threads). In Part workbench you would use the Sweep tool, which would then need to be cut (if an internal thread) from a suitable object, such as an extruded hexagon.

See also

Threadmaker macro

Advantages

There are a number of advantages to using ThreadProfile objects in your threads:

  • It's quicker and easier than sketching your own traditional thread profile.
  • It's possible to make custom threads of any desired diameter and pitch, including ANSI, such as 1/4" 20 TPI.
  • All of the threads I've made so far in testing have passed Check Geometry with BOP Check enabled.

Details

The ThreadProfile object is really just a glorified rebranded Draft BSpline object. In fact, the template code for producing it was unabashedly copied directly from the Draft workbench for use as a starting point, which I then modified to meet my needs. In particular, the necessary properties, such as Pitch and Minor Diameter were added, along with the code necessary to produce the desired BSpline object.

Create V thread profile Command

create object
This creates the V thread ThreadProfile object with default properties. Create it first, and then set the desired properties in the data tab of the combo view. There are a number of presets available, but you should double-check these by taking a cross-section of both parts to check the fit, then adjust the minor diameter accordingly. If there is an active Part Design Body, the object will be placed inside it. Failing that, if there is an active Part container the object will be placed into that.

New for v1.75 there is a Variants property in V thread types (hidden for other types) that allows 4 options: "60" -- the standard v thread, "45" -- a non-standard experimental 45 degree variant hopefully more 3D printer friendly, "2-Start" -- a 2-start v thread, and "3-Start" a 3-start v thread. (Variants was previously called "Angle" in v1.74, so any objects created with that version will probably be broken and will need to be rebuilt.)

Create Buttress thread profile Command

create object
This creates the Buttress thread ThreadProfile object with default properties. Create it first, and then set the desired properties in the data tab of the combo view. If there is an active Part Design Body, the object will be placed inside it. Failing that, if there is an active Part container the object will be placed into that.

These are ANSI B1.9-1973 (R2007), Class 2 -- Standard Grade, 7 degree / 45 degree flat-rooted buttress threads. (Class 3 -- Precision Grade would have 2/3 the tolerance of these for a tighter fit.) The tolerance is based on a thread length engagement of 10 threads. Shorter engagements could use a tighter fit and still work, longer engagements might require more tolerance. You can adjust the tolerance by adjusting the minor diameter after selecting one of the presets. Make the external minor diameter larger and the internal minor diameter smaller if you want a tighter fit, and vice versa for a looser fit.

There are other diameter / pitch combinations in the standard than are provided in the presets. The ones provided are only the recommended combinations. You can set the minor diameter and pitch to any values you want, but you'll need to work out the tolerances for yourself.

Create Bottle thread profile Command

create bottle object
This creates a bottle thread object (SP4xx M type) 45 degree / 10 degree buttress thread.

Make Helix Command

make helix
The Make Helix command creates a Helix and sets its Pitch property to match the Pitch property of the ThreadProfile object. This property is linked parametrically, thus any change to the ThreadProfile.Pitch property will also cause the Helix.Pitch property to update itself. We also set the Helix.Height property to ThreadProfile.Pitch * ThreadProfile.ThreadCount, thus ensuring the Helix.Height property is such that the thread produced in the sweep will have Thread Count threads. This is also parametrically linked. As of v1.70 the helix will be attached to the object the thread profile is attached to via expressions. That way if you attach the thread profile to something else after creating the helix the helix will also attach itself to the same object in the same map mode.

If there exists an active Part Design body when the helix is created, then the helix will be placed in the active body. This seems to work fine, so no more need for adding a shapebinder.

Do Sweep Command

do sweep
The Do Sweep command will perform the sweep for you. To use it you must first select the ThreadProfile object to sweep and the helix to sweep it along, then activate the command either from the toolbar or menu.

If a helix is selected, then the operation performed is a Part workbench Sweep, with solid = True and Frenet = True. This happens even if there is an active body and even if the ThreadProfile object is in the active body. If there is an active body, then an AdditivePipe is performed unless the InternalOrExternal property is set to "Internal", in which case the Part Design Subtractive Sweep is used.

Be wary of coplanar issues when cutting internal threads out of existing material. If the Cut (or SubtractivePipe) seems to have failed it could be because of the issues FreeCAD has with coplanar boolean operations. The solution for this is to move either the base object or the cutting tool slightly.

Open Online Calculator Command

open online calculator
Opens on online calculator for the metric sizes or for the ANSI UN and UNR inch sizes or for the ANSI Buttress sizes in the default browser. It is possible (I think) that FreeCAD might not have permission to do this. If so, then it will likely fail. Use the calculator to get the minor diameter for the thread you wish to make. For inch sizes, the 2A and 2B tolerances are for the normal fit. For Buttress threads class 2 is normal, class 3 is tighter fit. For metric size v threads the 6g tolerance is for normal fit. Typically there will be 2 minor diameters to select from: a minimum and a maximum. If you make the internal thread a little bit smaller the fit will be tighter. If you make the external thread a little bit smaller the fit will be looser. A good way to check the fit is to make the nut and the screw at the same time, then use the Part workbench cross-section tool to check the fit.

Parameterization Property

This property can change the shape of the threadprofile object. If you are not satisfied with the looks of the threads when viewed up close after zooming in, you can try modifying this property to see what difference it makes. Default is 1.0. It's value can range from 0.0 to 1.0.

Quality Property

The ThreadProfile object appears at first glance to be a simple circle, but it's not. As mentioned above, it's a BSpline. Think of it as a circle with a varying radius around the circumference. For every degree there are 2 points used to define the curve, 720 points in all. Quality 2 profiles use only every other point, in other words 360 points or 1 point per degree. Quality 3 uses only every 3rd point, and so on, up to 240 Quality settings at this time. Previously I thought Quality 1 was always better because there were more points defining the curve, but counter-intuitively this is not the case. More is not always better. I've set new defaults for this property for the different profile types. Examine your threads up close by zooming in. If they appear rough try experimenting with different Quality values.

See also Deviation property, which now defaults to 0.1 for better looking rendering of the threads.

Deviation Property

This sets the ViewObject.Deviation property of the Body if in Part Design or the Sweep object if in Part workbench to default of 0.1. This makes the threads look much better on the screen when being rendered, but can also slow down FreeCAD. Setting this to 0.5 will speed things up some, but at the expense of not as good looking threads. I believe FreeCAD default for this is 0.2. Set this to 0 if you want to set the deviation value of the body or sweep and have it not changed on recomputes.

Pitch Property

This is the pitch for the thread. You also need to set this in the Helix Pitch property. If you wish to make ANSI threads, such as 1/4-20, for example, you would set this value to 25.4/20 if you are in mm units or 1/20 if you are using inch units. I keep FreeCAD in mm units, so I would use 25.4/20 for the Pitch for that thread.

Minor Diameter

This is the minor diameter of your thread. This is NOT the nominal diameter. You need to look this value up and use the one for your desired nominal diameter, pitch, and fit tolerance. Here are links to online calculators for Unified Inch Screwthreads, Metric, and for ANSI Buttress

Continuity

What is this? This is a property of the underlying BSpline object. This is readonly and is only included for informational purposes. Normally, this should be C2 continuity. You can read more about smoothness here.

Height

This is the height of the sweep object (in mm). Adjusting this adjusts the ThreadCount property to set the height.

Version

This is the version of the ThreadProfile workbench used to create the ThreadProfile object, not the version of the ThreadProfile workbench currently installed.

Thread Count

When a Helix is created using the Make Helix command the Height property of the Helix is set to a height such that Thread Count number of threads will be created. As of v1.77 this is now readonly. Use the Height property instead.

Presets

These are some presets I added to version 1.30 (likely to be expanded some in future versions). I'm not entirely sure how accurate the data is. Do not blindly rely on it. You should still lookup the minimum and maximum minor diameters for your desired fit tolerance. If you are modeling both the internal and the external threads for a project it is a good idea to take cross sections of both so you can inspect the fit on the screen.

FAQ

  • When zooming in close the thread surface looks very rough. What can be done about this?
    ** I believe this only affects the way the object appears on the screen. Here are some things you can do to try to improve the appearance. Switch to the view tab of the sweep object (or body if in Part Design) and adjust the Deviation property to something like 0.1. The Angular Deflection property might also have an effect. This should smooth the surface rendering, but at the expense of longer processing times. Check the Quality property of the ThreadProfile object and see if changing that up or down can help the appearance. Check the Parameterization property and try different settings for it, for example, 0.25 instead of 1.0.
  • Why is there a line running up the thread?
    ** There are actually multiple lines. One is is the BSpline's seamline. If you Pad / Extrude the profile you can see this seamline as a straight edge, similar to what you see in cylinders and extruded / padded circles. The others are the seamlines from the helix.

* My internal threads are always external. What am I doing wrong?
** Use subtractive pipe in Part design to cut the internal thread out of an existing shape, e.g. a Pad. In Part workbench use the Sweep object as a cutting tool to cut it out of an existing shape, e.g. an extruded hexagon. (Ensure you have selected "Internal" in the "Internal Or External" ThreadProfile property when making internal threads.)
* Is it possible to access this via Python scripting?
** Yes. Use:

import ThreadProfileCmd
ThreadProfileCmd.ThreadProfileCreateObjectCommandClass().makeThreadProfile()
or
ThreadProfileCmd.ThreadProfileCreateButtressObjectCommandClass().makeButtressThreadProfile()

Parameters:
name="BThreadProfile",internal_data = internal_buttress_data, external_data = external_buttress_data, presets = buttress_presets_data,minor_diameter=buttress_presets_data[13][2],pitch=25.4/10,internal_or_external="External",thread_count=10
name is the name of the ThreadProfile object created.
internal_data, external_data, presets are lists that could be used to create a custom profile type.
minor_diameter is the minor diameter (we don't use nominal, only minor). To calculate minor diameter this code is used:

        def cd(txt, tpi, nominal): #cd = calculate diameters
            pitch = 25.4/tpi
            length_of_engagement = 10 * pitch #10 * pitch, longer engagements should have more tolerance
            nom = nominal * 25.4
            minor = nom - 0.66271 * pitch
            tolerance = 0.002 * (nom)**(1/3) + .00278 * length_of_engagement**(1/2) + 0.00854 * pitch**(1/2)
            return[txt, pitch, minor - tolerance, minor + tolerance]

The internal_data and external_data list properties define the radius of the ThreadProfile object at the various angles around the circumference. There are 720 points. Each point is the x-coordinate of a thread profile sketched on the xz plane. The first element in the list is the x-coordinate at z=1/720 degrees, then z=2/720 degrees, etc. Don't worry, you don't need to include these parameters. The default used is for the standard Metric M profile. When the ThreadProfile is created the data points are used as such: each element is taken, then added to it the minor radius + pitch * element value for the x-coordinate. To get the y-coordinate we use the current element index / 720. We use the math.cos() and math.sin() functions, but let's not get too bogged down here. You can view the source code for more details.

Release notes:

  • 2024.08.01 (version 1.92)
  • Add Deviation property, default to 0.1 for nicer looking threads
  • Fix issue with Part Design in 0.22
  • Fix face not being made in 0.22
  • 2024.07.31 (version 1.91)
  • update to work with 0.22 dev due to FreeCAD changing the name of the Support property to AttachmentSupport
  • 2024.06.11 (version 1.90)
  • fix issue with newer versions of 0.22.
  • improve exception messaging on failure to create threadprofile objects (thanks Mikael)
  • 2023.09.21 (version 1.89)
  • fix issue with sweep not updating on height change
  • 2023.09.21 (version 1.88)
  • fix issue with newer versions of FreeCAD where the new helix object was producing defective sweeps (workaround is to set the Helix.SegmentLength property 1.0 instead of default of 0)
  • Up Quality property limits from 12 to 240 to give user more flexibility
  • When creating helix object select both the helix and the threadprofile object so the user can just click the sweep icon instead of needing to select both objects.
  • 2024.08.01 (version 1.92)
  • add Deviation property
  • 2024.07.31 (version 1.91)
  • update to work with 0.22
  • 2023.06.10 (version 1.87)
  • fix issue 56 when pitch changed height was also changing
  • 2023.06.09 (version 1.86)
  • account for new SegmentLength property of Helix objects (addresses issue 56)
  • 2023.04.09 (version 1.85)
  • update links to online calculators (thanks to Gotthard Scalet for the fix)
  • 2022.10.01 (version 1.84)
  • fix issue with presets for 1 1/4-12 and 1 1/8-12 UNF
  • 2022.08.26 (version 1.83)
  • fix issue with multi start threads when threadprofile object is not at identity placement
  • 2022.08.04 (version 1.82)
  • fix issue with helix not going into active body if body is inside active part container --thanks tritol
  • 2022.01.30 (version 1.80)
  • link helix attachment offset property to threadprofile's attachment offset property
  • 2021.11.30 (version 1.77)
  • bug fix in calculating thread count from height
  • 2021.10.17 (version 1.77)
  • add Height property, set ThreadCount to readonly ** if you still want to use ThreadCount you can do so in the python console. Select thread profile, Ctrl+Shift+P to send to the console. Enter in the console: obj.ThreadCount = 10. It can still also be used in expressions, such as in a spreadsheet cell.
  • 2021.10.17 (version 1.76)
  • fix bug related to helix height
  • 2021.10.17 (version 1.75)
  • Support 2-start and 3-start v threads
  • 2021.10.07 (version 1.74)
  • Support nonstanard 45 degree V threads for 3D printing
  • 2021.10.01 (version 1.73)
  • notify user in report view if update is available
  • 2021.09.02 (version 1.72)
    ** Expose Parameterization property for user editing. This property can change the shape of the threads. Default: 1.0. Range of values: 0.0 to 1.0.
  • 2021.09.02 (version 1.71)
    ** bug fix -- generated threads were failing check geometry with self-intersections ** Change Quality defaults for the different thread types.
  • 2021.08.25 (version 1.70)
    ** add * in front of current setting in settings dialog ** remove shapebinders in part design and just put the helix in the body ** on creating helix attach it to the same object the thread profile is attached to ** if link helix parametrically is set (the default) the helix attachment will be linked to the thread profile attachment via expressions
  • 2021.03.16 (version 1.69)
    ** more bug fix work on Thread Count parameter
  • 2021.03.03 (version 1.68)
    ** fix bug where changing Thread Count parameter was not updating Sweep object properly
  • 2021.03.03 (version 1.67)
    ** accept galou's PR to use our own tr
  • 2020.08.27 (version 1.66)
    ** fix bug in ThreadCount property not updating Sweep object ** fix bug in PartDesign where sometimes Part Sweep was used even if there was active body
  • 2020.08.04 (version 1.65)
    ** switch to svg icons
  • 2020.07.30 (version 1.64)
    ** make subtractive pipe visible in dialog for external threads
  • 2020.07.16 (version 1.63)
    ** maintenance update to fix error related to recent FreeCAD update
  • 2020.07.16 (version 1.62)
    ** fix bug where only shell was being created ** make external bottle threads 0.25mm smaller minor diameter
  • 2020.07.16 (version 1.61)
    ** improve continuity of bspline to C3 (was C2) ** should improve quality of finished sweep object
  • 2020.07.15 (version 1.60)
    ** add bottle thread buttress (SP4xx M type) 45/10 degree thread support
  • 2019.08.22 (version 1.51)
    ** fix spelling errors
  • 2019.08.02 (version 1.50)
    ** Add sweep tool
  • 2019.08.01 (version 1.42)
    ** Fix python2 bug related to creating buttress threads ** Fix bug in presets
  • 2019.08.01 (version 1.41)
    ** Fix bug where presets were not working after restarting and reloading file
  • 2019.07.31 (version 1.41)
    ** Add online buttress calculator link
  • 2019.07.31 (version 1.40)
    ** Add Buttress thread support
  • 2019.07.27 (version 1.31)
    ** Helix placement now linked parametrically to ThreadProfile placement, can be disabled in settings.
  • 2019.07.25 (version 1.30)
    ** Added presets ** Changed variable to reflect there are 719 (not 720) points used to make the ThreadProfile BSpline
  • 2019.07.23 (version 1.23)
    ** If there is an active part design body when the helix is created, make a shapebinder for it and hide the helix ** Put the helix into the active Part container if one exists
  • 2019.07.23 (version 1.22)
    ** If there is an active part design body or Part object, add the thread profile to it.
  • 2019.07.23 (version 1.21)
    ** Change Pitch type from Float to Length ** Check if Gui is up before creating view object ** Recompute document before returning object from makeThreadProfile() ** Fix bug where if more than one helix is made we set the correct helix properties
  • 2019.07.22 (version 1.20)
    ** Add link to online calculators
  • 2019.07.22 (version 1.10)
    ** Add Make Helix command
    ** Add Thread Count property
  • 2019.07.22 (version 1.0)
    ** initial release

threadprofile's People

Contributors

galou avatar luzpaz avatar mwganson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

threadprofile's Issues

Please explain fields used in presets

In the ThreadProfileCmd.py file, at line 585, it uses 4.773. The comment at line 586 then quotes 4.891.

Later on at line 641, it says the default is for M6 x 1 internal. Yet at line 585, internal_or_external="External" is used.

I think the comments do not agree with the code.

At line 661, 4.773 and 4.917 are used. Why the difference between 4.891 and 4.917?

It would be helpful to add a comment at line 644 explicitly spelling out how the four items are used in the following lists.

If I wanted to add M7 x 0.5, for example, is it as simple as adding a single line after line 703 to the Python file?

Thanks.

Can not change Height?

If the Height parameter in VThreadProfile is changed the Additive Pipe breaks. In report view: "Recompute failed! Please check report view." If a new VThreadProfile is started any Height can be given but not changed after the AdditivePipe is made.

FreeCAD 0.20 29177 - 2022/06/13
ThreadProfile version 1,85

image

Missing option for generating trapezoid threads and other shapes

Hello.
I wanted to make a nut for trapezoid threads as often used in 3D printers, i.e. TR8, or TR10, or TR12...
Hereby I noticed that your otherwise great tool only allows metric threads (V-Shaped) and threads I never needed in my life before, but there is no flat thread (angle 90 degrees) and also no trapezoid one (slight angle on both sides, while top is flat).

May I suggest adding such profiles, too?

Also a rounded thread (half round profile) would be interesting. I saw such threads on filters for breath protection.
Conical threads would also be very useful.

how to script generating a helix and shapebinder ... ??

Working on figuring out how to script the thread profile workbench. Thanks for any help or tips.

Here's the current state of my test macro.

file: vtp_test.FCMacro

# -*- coding: utf-8 -*-

import FreeCAD as App
import FreeCADGui as Gui
import sys
import Part
import ThreadProfileCmd

minor_diameter = 30
thread_pitch = 2.0
thread_count = 3

try:
    vtp_test = App.getDocument("vtp_test1")
except NameError:
    vtp_test = App.newDocument("vtp_test1")

vtp_body = vtp_test.getObject('vtp_body')
if (id(vtp_body) == id(None)):
    vtp_body = vtp_test.addObject('PartDesign::Body','vtp_body')
else:
    vtp_body.removeObjectsFromDocument()


# make vthreadprofile
vtp = ThreadProfileCmd.ThreadProfileCreateObjectCommandClass().makeThreadProfile('VThreadProfile')
vtp_body.addObject(vtp)
vtp.InternalOrExternal = 'External'
vtp.MinorDiameter = minor_diameter
vtp.Pitch = thread_pitch
vtp.ThreadCount = thread_count
vtp_body.recompute()

# make helix and associates shapebinder
ThreadProfileCmd.ThreadProfileMakeHelixCommandClass();
# ... ??

# sweep shapebinder along thread profile
# ... ??

Gui.ActiveDocument.ActiveView.viewIsometric()
Gui.ActiveDocument.ActiveView.fitAll()

Helix creation not working

Running Freecad 0.22 build 38375, OS : windows 10 up to date

Creation of Helix gives following error :

10:43:42 Running the Python command 'ThreadProfileMakeHelix' failed:
Traceback (most recent call last):
File "C:\Users\laure\AppData\Roaming\FreeCAD\Mod\ThreadProfile.\ThreadProfileCmd.py", line 404, in Activated
helix.setExpression("Support",profile.Name+".Support")

Property 'Support' not found

Same issue with build 38334 on Linux Mint 22

System info :

OS: Windows 10 build 19045
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.38375 (Git)
Build type: Release
Branch: main
Hash: fe702349e848571802c01659668cc4bee519f4c6
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: French/France (fr_FR)
Installed mods:

  • Help 1.0.3
  • ThreadProfile 1.90.0

custom profiles from helical projection of a sketch

it would be nice to create faces from a planar sketch by an helical projection.

The idea is to create a set of points from every geometry element in the sketch and interpolate there points by a bspline. The result then is flat face which can be used to create any kind of thread-profile.

Blank page on Addon Manager

image

OS: Linux Mint 21.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.36220 (Git)
Build type: Unknown
Branch: main
Hash: 68fd2934cfcdb7b31d235d562412a5c04f55682e
Python 3.10.12, Qt 5.15.3, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * OpenDark 2023.12.17
  * ThreadProfile 1.89.0

concentrated profiles

why I cannot map my thread concentric to my sketch. It just does not want to get centered?

Tech Draw WB Issue with TP imports

Hello Mark!
Thanks for this work bench and your YT content explaining it. I have used the Thread Profile WB to make projects with threads of all types, v, bottle, and buttress for 3d printing. I recently tried to make a tech drawing for a project and had issues with wild unconstrained lines coming from some parts with a Thread Profile based thread. I was having trouble with angled perspectives (like the default Home View) imported into a tech drawing. My original goal was to forsake drafting standards in my drawing and simply show an assembly view of some parts with fastening hardware and a few dimensions. I have since completed that project and moved on, but thought I might mention my issue I was having.
Full disclosure, the parts I was having trouble with had a somewhat hacked thread. I used your "M33 Fine 1.5" V-profile as a base and changed it to a 32.5mm minor diameter 1mm pitch for the internal thread, and 33mm minor diameter for the external mate. It worked great for 3d printing with a Prusa MK3.
Like I said, I have moved on from this project, but the project is posted with a freecad file here: https://www.thingiverse.com/thing:5016757

OS: Fedora 33.20211010.0 (Silverblue) (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.20.25997 (Git) AppImage
Build type: Release
Branch: master
Hash: 77b198048a63f1e9ca15eef64c8042d599a14cf3
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)

Thanks again,
-Jake

External threads generated are detached from body and body disappears.

Using FreeCAD 0.19 Thread Profile workbench v1.69 bug. More details at end.

Have this model generated:

image

But when I add the same thread on the left the constructed body disappears and only the new threads are visible.

image

5m video demonstrating issue: https://youtu.be/qCGIcOizI3Y

FIle used in the video demonstration uploaded here: https://github.com/stepheneb/freecad-and-thread-profile-issue/blob/master/filter-tester-b6.FCStd

NOTE: I have to first open FC without loading my file and open the Draft Workbench first. see #28

OS: macOS 10.16
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 (Git)
Build type: Release
Branch: master
Hash: b2ca86d8d72b636011a73394bf9bcdedb3b109b7
Python version: 3.8.8
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)

use wire instead of bspline

It would be nice to use a wire (list of edges) instead of one bspline as the profile. This way exact geometry can be created where possible (eg cylindrical faces are created from a arc) and edges are created on sharp corners. An example can be found in the gear-workbench:
looooo/freecad.gears#1 (comment)

Btw.: Helical projection is a great idea!

selecting Thread Profile workbench: cannot import name '_ViewProviderWire' from 'Draft'

FC: 0.19, ThreadProfile workbench 1.69 (more details at bottom)

  1. Load this file) https://github.com/stepheneb/freecad-and-thread-profile-issue/blob/master/filter-tester-b1.FCStd
  2. Make body p40 active
  3. Switch to ThreadProfile workbench

May be related: https://forum.freecadweb.org/viewtopic.php?f=23&t=56711&p=490392#p490392

17:27:14  Traceback (most recent call last):
  File "/Users/stephen/Library/Preferences/FreeCAD/Mod/ThreadProfile/ThreadProfileCmd.py", line 43, in <module>
    from Draft import _DraftObject, getParam, _ViewProviderWire, formatObject, select
<class 'ImportError'>: cannot import name '_ViewProviderWire' from 'Draft' (/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/Draft.py)
17:27:15  Traceback (most recent call last):
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_wire.py", line 94, in attach
    self.symbol = gui_utils.dim_symbol()
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftutils/gui_utils.py", line 208, in dim_symbol
    marker = coin.SoSphere()
<class 'NameError'>: name 'coin' is not defined
17:27:15  Traceback (most recent call last):
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_wire.py", line 141, in onChanged
    super(ViewProviderWire, self).onChanged(vobj, prop)
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_base.py", line 293, in onChanged
    if self.texture:
<class 'AttributeError'>: 'ViewProviderWire' object has no attribute 'texture'
17:27:15  Traceback (most recent call last):
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_wire.py", line 141, in onChanged
    super(ViewProviderWire, self).onChanged(vobj, prop)
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_base.py", line 293, in onChanged
    if self.texture:
<class 'AttributeError'>: 'ViewProviderWire' object has no attribute 'texture'
17:27:15  Traceback (most recent call last):
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_wire.py", line 131, in onChanged
    if self.symbol:
<class 'AttributeError'>: 'ViewProviderWire' object has no attribute 'symbol'
17:27:15  Traceback (most recent call last):
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_wire.py", line 94, in attach
    self.symbol = gui_utils.dim_symbol()
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftutils/gui_utils.py", line 208, in dim_symbol
    marker = coin.SoSphere()
<class 'NameError'>: name 'coin' is not defined
17:27:15  Traceback (most recent call last):
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_wire.py", line 141, in onChanged
    super(ViewProviderWire, self).onChanged(vobj, prop)
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_base.py", line 293, in onChanged
    if self.texture:
<class 'AttributeError'>: 'ViewProviderWire' object has no attribute 'texture'
17:27:15  Traceback (most recent call last):
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_wire.py", line 141, in onChanged
    super(ViewProviderWire, self).onChanged(vobj, prop)
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_base.py", line 293, in onChanged
    if self.texture:
<class 'AttributeError'>: 'ViewProviderWire' object has no attribute 'texture'
17:27:15  Traceback (most recent call last):
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_wire.py", line 131, in onChanged
    if self.symbol:
<class 'AttributeError'>: 'ViewProviderWire' object has no attribute 'symbol'
17:27:15  Traceback (most recent call last):
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_wire.py", line 141, in onChanged
    super(ViewProviderWire, self).onChanged(vobj, prop)
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_base.py", line 293, in onChanged
    if self.texture:
<class 'AttributeError'>: 'ViewProviderWire' object has no attribute 'texture'
17:27:15  Traceback (most recent call last):
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_wire.py", line 141, in onChanged
    super(ViewProviderWire, self).onChanged(vobj, prop)
  File "/Applications/cad/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_base.py", line 293, in onChanged
    if self.texture:
<class 'AttributeError'>: 'ViewProviderWire' object has no attribute 'texture'
17:27:15  AttachEngine3D::calculateAttachedPlacement:InertialCS: inertia tensor has axis of symmetry. Second and third axes of inertia are undefined.
17:27:15  AttachEngine3D::calculateAttachedPlacement:InertialCS: inertia tensor has axis of symmetry. Second and third axes of inertia are undefined.
17:27:15  AttachEngine3D::calculateAttachedPlacement:InertialCS: inertia tensor has axis of symmetry. Second and third axes of inertia are undefined.
17:27:15  AttachEngine3D::calculateAttachedPlacement:InertialCS: inertia tensor has axis of symmetry. Second and third axes of inertia are undefined.

OS: macOS 10.16
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 (Git)
Build type: Release
Branch: master
Hash: b2ca86d8d72b636011a73394bf9bcdedb3b109b7
Python version: 3.8.8
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)

45 degree thread for 3D printing

Is it possible to add a new type of thread, which is like metric but has a 45° angle instead of 60?
For 3D printing, it would make it a LOT easier for parts which you want to screw together. Typically, printers get good results with overhangs up to 45°. Metric is 60°, which doesn't work too well... printed supports take a lot of time to remove, and never look good.
Buttress thread is only 45°, but it's not symmetrical. So you have to print one part upside down, which isn't always possible either.

cannot find ThreadProfile icon

Hi,
I installed ThreadProfile 1.82.0, as described, restarted Freecad, but cannot find any toolbar icon to start....
please advise where to find it.
regards
Ludo

Icon path in package.xml

Thanks for helping test the new package.xml file format! The icon path in the package.xml file should be relative to the content item's subdirectory: so in this case, drop the "ThreadProfile", so the path is just "Resources/Icons/ThreadProfileLogo.svg". The same applies to your other two workbenches.

Some questions about pitch

Hey, i was extremely relieved after finding your ThreadProfile Workbench, because for me as a beginner, the other options seemed to be way too complex. Unfortunally the accuracy of your tool is not really great i fear, probably because of using non-standard pitches.

The object i am trying to design is here:
https://forum.freecadweb.org/viewtopic.php?f=3&t=46254

So basically i just selected a M12x1 profile and changed the pitch to 0.5, since thats what a M12 board lens has. That doesnt work, the thread is too large after being 3d printed...

Is it generally possible to make a M12x0.5 thread or is my approach wrong?

Toolbar does not go away or go inactive when alternative workbench selected

When you switch workbenches from ThreadProfile, the menu changes to reflect the new workbench but the ThreadProfile toolbar does not disappear and remains active. An item for the toolbar does not appear in the view, toolbars menu when another workbench is active.

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.27422 (Git)
Build type: Release
Branch: master
Hash: d938733eaf2c2ce7cb18d1cbb56147185c473530
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United Kingdom (en_GB)

would it be hard for me to add a multi-lead thread feature?

Edit: What I want is to be able to do set the lead -- I think some of places I use the term pitch below is incorrect. See: https://www.harveyperformance.com/in-the-loupe/multi-start-thread-guide

I'd like to make custom multi-lead thread pattern using part of the standard v-shaped profile.

I'm making some parts that mate using a three-lead thread that is somewhat similar to what mason jars use. Imagine a cap fora cylinder between 50 and 70mm in diameter.

I haven't looked at the code yet but I thought I might for example be able to start with a thread shape that is normally used at a pitch of 1mm and increase that pitch to six mm and then combine three variants sweep objects each rotated at 120 degrees.

But when I start with an external thread with a 50mm mm minor diameter, a 1 mm pitch and a thread count of 10 that looks like this:

image

And then change the pitch to 6 mm with a thread count of 2 the size of the swept profile greatly increase in size like this:

image

So currently the size of the swept thread seems to only be affected by the radius and the pitch setting in the VThreadProfile object.

It seems like a first step might be to expose an attribute for the thread swept profile size. Normally this would just be set by the minor diameter and the selected pitch -- but if overridden I could change the thread profile size back to the swept profile size used in the 50 mm diameter by 1.0 pitch.

If you think it's not too hard to extend your modeling to support this I'd be happy to try implementing it.

Here's an example of what I'm trying to generate in FreeCad:

image

Helix is not putted to active body

Make helix button at active body fails with:

Running the Python command 'ThreadProfileMakeHelix' failed:
Traceback (most recent call last):
File "/home/tritol/.local/share/FreeCAD/Mod/ThreadProfile/./ThreadProfileCmd.py", line 399, in Activated
body.Group=body.Group+[getattr(doc,name)] #put helix in body to avoid out of scope warnings

Object can only be in a single GeoFeatureGroup

[code]
OS: Arch Linux
Word size of FreeCAD: 64-bit
Version: 0.20.29177 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20)
Hash: 68e337670e227889217652ddac593c93b5e8dc94
Python 3.9.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: Czech/Czech Republic (cs_CZ)
Installed mods:

  • MeshRemodel 1.8919.0
  • Estimate 0.1.2
  • DynamicData 2.46.0
  • 3DfindIT 1.2.0
  • Pyramids-and-Polyhedrons
  • slic3r-tools
  • POV-Ray-Rendering
  • fcgear 1.0.0
  • CurvedShapes 1.0.4
  • fasteners 0.3.50
  • Manipulator 1.4.9
  • Silk 1.0.0
  • 3D_Printing_Tools
  • Render 2022.2.0
  • ThreadProfile 1.81.0
  • Defeaturing
    [/code]

Cannot create long screw

Hi,

It is not possible to create long screw.

Repro steps:

  1. Create VthreadProfile
  2. set Presets to M4 fine 0.5
  3. set High to 30mm
  4. create helix
  5. create thread profile by threadprofile workbench sweep

as result there is something strange - screen attached.
image

FreeCAD version:

[code]
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.2.29177 +426 (Git)
Build type: Release
Branch: (HEAD detached from 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: Polish/Poland (pl_PL)
Installed mods:

  • A2plus 0.4.60k
  • Assembly4 0.12.6
  • Curves 0.6.8
  • ExplodedAssembly
  • fasteners 0.4.55
  • freecad.gears 1.0.0
  • lattice2 1.0.0
  • Manipulator 1.5.0
  • ThreadProfile 1.84.0
    [/code]

Icons disappeared after restart v0.19

I installed this yesterday and played around with it a bit. This morning I pulled up freecad 0.19 again and the icons are gone. (not in part design, part, etc)

I even removed it completely, restarted and reinstalled it and I cannot get them to return. (fedora 34)

Am I missing something incredibly simple?

"Do sweep" button is always disabled

In Part design, draw a 15mm diameter circle. Extrude it 12mm.
Go to thread profile workbench.
Create a new V-thread. Select the M12x1.0 fine profile. Change the pitch to 0.5mm. Set height to 12mm. Set quality to 8,
Click "Make helix" and when asked "Do you want to incorporate this object into PartDesign Body using a wrap feature" select yes.
A 1mm diameter helix is created and not the 12mm expected.
Additionally, the "do sweep" button is disabled.
Do you know what is going wrong? Thank you.

Add Profiles/Support for NPT or Other Tapered Threads

Is it possible to add support for NPT or other tapered threads (e.g. BSP)? I was not sure if it was possible for the current code to deal with a tapered thread/helix, such as passing the thread taper off to the helix as an angle, or if they had to be built manually. The thread taper angle for all NPT is constant across all sizes so it could be defined as a fixed parameter. I was starting to build my own using the Part Helix command based upon data at this link: https://www.machiningdoctor.com/charts/thread-npt-charts/. However, it would be very useful if some of these were available as presets. Thank you.

Throwing out exception information with the bath water

This addon is not working for me (allthough it seems to be due to problems with importSVG) But the exception information was not very helpful in this addon:

except Exception:
    FreeCAD.Console.PrintError("ThreadProfile Error: Exception creating thread profile object.\n")

I suggest printing out the underlying exception to help troubleshooting, maybe something like this:

except Exception as e:
    FreeCAD.Console.PrintError(
    	"ThreadProfile Error: Exception creating thread profile object.\n"
    	f"\n{'\n'.join(traceback.format_exception(e))}\n"
    )

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.