Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Custom feature: tapless (self-forming) screws

joshua_wise822joshua_wise822 Member Posts: 7 PRO
edited April 7 in FeatureScript

Hi all,

I found Thomas Sanladerer's "self-forming screws" to be extremely useful, but the FeatureScripts I saw out there didn't quite do what I wanted and didn't reliably produce the output that I wanted, and just using a Derived on his design got tiresome in a hurry. So I decided to learn FeatureScript, and wrote my first FeatureScript of my own to implement this. Below, find a configurable tapless screw feature that cuts from mate connectors of your choice, and is configurable for various sizes of screw.

https://cad.onshape.com/documents/3f129486c90c39e087c587e9/w/2e3f538eb10df254726a08d9/e/59f4cc80ed60d26042c424dd

Hope this is useful to someone!
joshua

Comments

  • martin_kopplowmartin_kopplow Member Posts: 756 PRO

    I have been using the other FS for printed parts already, and the principle works pretty well. I like your combined default/custom size approach, though. Maybe a few more defaults might be convenient. I use M2,5 a lot (appears to be popular with e.g. PCB mounts) and would sure like to include M6, because many bought items just seem to come with 6mm mounting holes.

    Apparently, this is handled by this section:

        if (definition.screwSize == ScrewSize.SCREW_M3) {
            definition.innerDiameter = 2.1 * millimeter;
            definition.clearanceDiameter = 3.2 * millimeter;
            definition.insetKnobRadius = 3 * millimeter;
            definition.leadInLength = 2 * millimeter;
        } else if (definition.screwSize == ScrewSize.SCREW_M4) {
            definition.innerDiameter = 3.0 * millimeter;
            definition.clearanceDiameter = 4.2 * millimeter;
            definition.insetKnobRadius = 5 * millimeter;
            definition.leadInLength = 2 * millimeter;
        } else if (definition.screwSize == ScrewSize.SCREW_M5) {
            definition.innerDiameter = 3.9 * millimeter;
            definition.clearanceDiameter = 5.2 * millimeter;
            definition.insetKnobRadius = 7 * millimeter;
            definition.leadInLength = 3 * millimeter;
        } else if (definition.screwSize == ScrewSize.SCREW_M6) {
            definition.innerDiameter = 4,2 * millimeter;
            definition.clearanceDiameter = 6.2 * millimeter;
            definition.insetKnobRadius = 8 * millimeter;
            definition.leadInLength = 3 * millimeter;
    

    export enum ScrewSize { annotation { "Name": "M3" } SCREW_M3, annotation { "Name": "M4" } SCREW_M4, annotation { "Name": "M5" } SCREW_M5, annotation { "Name": "M6" } SCREW_M6, annotation { "Name": "Custom" } SCREW_CUSTOM, }

    I found one can just append own defaults here and add a line there, where the choices are listed, probably these are the menu definitions.

    Could one also add a greater number of knobs definition for larger custom diameters (and especially a finer thread class) here by just one more line like "definition. knobCount = 5" or so (I am not a coding wizard)?

  • joshua_wise822joshua_wise822 Member Posts: 7 PRO

    Yes, I can add those! Do you have inner diameters / clearance diameters that seem to work well for M2.5 and M6?

    I haven't tried with larger fasteners, but having more knobs for larger diameters seems like a good idea. I will try to add that as a configuration option and will let you know when I do. Do you have suggested knob counts / radii that seem to print well for you?

  • jelte_steur814jelte_steur814 Member Posts: 428 PRO

    @joshua_wise822: I was trying to add it to my feature tree and got:

    image.png

    Can you share it publicly and add the URL here?

  • martin_kopplowmartin_kopplow Member Posts: 756 PRO

    @joshua_wise822

    So far, I have done this maually, and it appears to be slightly different depending on the print process. (We have FDM and DLP)

    For finer threaded things, like found on electronic components like sensors and such, I found that a knob offset from the cylinder face only say 10% more than the thread depth is a good starting point, and then to make the knob-to-cylinder-ratio on the perimeter close to 60% knob and 40% plain. So, for a 8x0,5mm fine thread insert I did last week, I made 5 knobs and it worked out well. Here's how I made up the geometry:

    Screenshot 2025-04-10 111253.png

    https://cad.onshape.com/documents/2f130e80b342023ecf2d65f8/w/12a3c67836afab3b373065a1/e/dc5037e2efcdcdcb3dd51d04?renderMode=0&rightPanel=variableTablePanel&uiState=67f78c102daa673a186009d3

    If I had to make a guess, I'd say that configuring hole diameter and inner diameter (to represent thread depth) as core dimensions would be a good starting point, and then have the script find the best knob diameter as a function of the knob-to-plain-perimeter-ratio to match someting greater than 0,5. That would probably be fit for all metric standard threads.

    I also use a similar approach for self tapping screws for thermoplasics like these:

    Screenshot 2025-04-10 103842.png

    They have a deeper cut thread compared to their diameter, and so my hole cross section is usually more star-shaped for these. I know they are meant to work with plain holes, but the same reasoning (damage done by the thread cutting into the printed wall layers) applies here. I could imagine an FS that queried screw type first and then created the adequate knobbyness by using adjusted parameters would be a nice tool.

Sign In or Register to comment.