Add starts parameter to generic_bottle_cap() for multi-start threads - #2020
Open
HannesGitH wants to merge 1 commit into
Open
Add starts parameter to generic_bottle_cap() for multi-start threads#2020HannesGitH wants to merge 1 commit into
HannesGitH wants to merge 1 commit into
Conversation
Plastic bottle necks (especially larger PET finishes) commonly use 2- or 3-start threads, which generic_bottle_cap() could not model. thread_helix() already supports starts, so pass it through and divide the turn count by starts so the thread still spans the same axial length inside the cap. With the default starts=1 the output is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plastic bottle necks — especially the larger PET finishes (38 mm and up) — commonly use 2- or 3-start threads, but
generic_bottle_cap()could only produce single-start threads. I ran into this making an adapter cap for a 38 mm PET bottle: the pitch was right, but the cap only engaged for a fraction of a turn before binding, because the neck lead is2 * pitch.thread_helix()already supportsstarts, so this just passes it through:startsargument (default 1), documented in the Arguments block and the Description.turnsis divided bystarts, sincethread_helix()risespitch * startsper revolution — without that the thread would overflow the cap cavity.pitchkeeps its existing meaning (axial distance between adjacent threads, i.e. what you measure with calipers on the neck), so the lead ispitch * starts.Backwards compatible: with the default
starts=1the generated geometry is unchanged — I renderedgeneric_bottle_cap(texture="knurled",neck_od=25,thread_od=30,height=10)before and after and the STLs are byte-identical (md52a525bc9150080fda6e2a76673f74858).The 2- and 3-start variants render manifold with no warnings under
--hardwarnings.Happy to add the matching
startstogeneric_bottle_neck()in a follow-up (or here, if you prefer) — I kept this one minimal.