Package Docs 0.2.3¶
-
class
helical_thread.
HelicalThread
(radius, pitch, height, taper_out_rpos=0, taper_in_rpos=1, inset_offset=0, first_t=0, last_t=1, angle_degs=45, major_cutoff=0, minor_cutoff=0, ext_clearance=0.1, thread_overlap=0.001)[source]¶ Bases:
taperable_helix.helix.Helix
A set of fields used to represent a helical thread and passed as the parameter to helical_thread.
Control of the size and spacing of the thread using the various fields in Helix and those below.
-
angle_degs
: float = 45¶ angle in degrees
-
major_cutoff
: float = 0¶ Size of of flat at the major diameter
-
minor_cutoff
: float = 0¶ Size of flat at the minor diameter
-
ext_clearance
: float = 0.1¶ External clearance between external and internal threads
-
thread_overlap
: float = 0.001¶ Amount to overlap threads with the core so the union of core and threads is a manifold
-
first_t
: float = 0¶
-
helix
(hl=None)¶ This function returns a Function that is used to generates points on a helix.
It takes an optional HelixLocation which refines the location of the final helix when its tapered. If HelixLocation is None then the radius is Helix.radius and horz_offset and vert_offset will be 0. If its not None HelixLocation.radius maybe None, in which case Helix.radius will be used. and HelixLocation.horz_offset will be added to the radius and used to calculate x and y. The HelixLocation.vert_offset will be added to z.
This function returns a function, f. The funciton f that takes one parameter, an inclusive value between first_t and last_t. We then define t_range=last_t-first_t and the rel_height=(last_t-t)/t_range. The rel_height is the relative position along the “z-axis” which is used to calculate function functions returned tuple(x, y, z) for a point on the helix.
Credit: Adam Urbanczyk from cadquery [forum post](https://groups.google.com/g/cadquery/c/5kVRpECcxAU/m/7no7_ja6AAAJ)
- Parameters
hl (
Optional
[HelixLocation
]) – Defines a refinded location when the helix is tapered- Return type
Callable
[[float
],Tuple
[float
,float
,float
]]- Returns
A function which is passed “t”, an inclusive value between first_t and last_t and returns a 3D point (x, y, z) on the helix as a function of t.
-
inset_offset
: float = 0¶
-
last_t
: float = 1¶
-
taper_in_rpos
: float = 1¶
-
taper_out_rpos
: float = 0¶
-
radius
: float¶
-
pitch
: float¶
-
height
: float¶
-
-
class
helical_thread.
ThreadHelixes
(ht, int_helix_radius=0, int_helixes=<factory>, ext_helix_radius=0, ext_helixes=<factory>)[source]¶ The helixes returned by helical_thread` that represents the internal thread, prefixed with int_ and the external thread, prefixed with ext_.
-
ht
: helical_thread.helicalthread.HelicalThread¶ The basic Dimensions of the helixes
-
int_helix_radius
: float = 0¶ The internal thread radius
-
int_helixes
: List[taperable_helix.helix.HelixLocation]¶ List of the internal helix locations
-
ext_helix_radius
: float = 0¶ The external thread radius
-
ext_helixes
: List[taperable_helix.helix.HelixLocation]¶ List of the external helix locations
-
-
helical_thread.
helical_thread
(ht)[source]¶ Given HelicalThread compute the internal and external helixes thread and returning them in ThreadHelixes. int_hexlix_radius, int_helixes, ext_helix_radius and ext_helixes. The helixes are an array of HelixLocations that define the helixes of the thread. If minor_cutoff is 0 then the thread will be triangular and the length of the {int|ext}_helixes 3. if minor_cutoff > 0 then the thread will be a trapezoid with the length of the {int|ext}_helixes will be 4.
- Parameters
ht (
HelicalThread
) – The basic dimensions of the helicla thread- Return type
ThreadHelixes
- Returns
internal and external helixes necessary to use taperable-helix