Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_metric_bolt_head_height() does not take headtype into account yet #93

Open
stefanct opened this issue Mar 28, 2023 · 0 comments
Open
Assignees

Comments

@stefanct
Copy link

The function simply maps the given diameter to a respective height. However, these heights depend on the head type of the respective screw and thus the returned value does not match the actual value in some cases (I didn't fully investigate which cases), e.g., for countersunk. Getting the exact height is important to me to precisely cut out clearances above screws that are "embedded" into the material of 3d prints.

It should be quite easy to add an optional parameter that describes the head type. I have added a similar function for my own needs:

function get_metric_bolt_head_type_height(size, headtype) = 
  let (D = headtype != "hex"?
    get_metric_socket_cap_diam(size) :
    get_metric_bolt_head_size(size))
  let (H = headtype == "socket"?
    get_metric_socket_cap_height(size) :
    get_metric_bolt_head_height(size))
  (
    (headtype == "pan" || headtype == "round" || headtype == "button")? H*0.75 :
    (headtype == "countersunk")? (D-size)/2 :
    (headtype == "oval")? ((D-size)/2 + D/2/3) :
    H
  );

The hardest path is probably just to cut down on the code duplication between that function and the metric_bolt module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants