omdl  v0.9.7
OpenSCAD Mechanical Design Library
mounts.scad
Go to the documentation of this file.
1 //! Screw mounts tabs, mount slots, mount posts, etc.
2 /***************************************************************************//**
3  \file
4  \author Roy Allen Sutton
5  \date 2025
6 
7  \copyright
8 
9  This file is part of [omdl] (https://github.com/royasutton/omdl),
10  an OpenSCAD mechanical design library.
11 
12  The \em omdl is free software; you can redistribute it and/or modify
13  it under the terms of the [GNU Lesser General Public License]
14  (http://www.gnu.org/licenses/lgpl.html) as published by the Free
15  Software Foundation; either version 2.1 of the License, or (at
16  your option) any later version.
17 
18  The \em omdl is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  Lesser General Public License for more details.
22 
23  You should have received a copy of the GNU Lesser General Public
24  License along with the \em omdl; if not, write to the Free Software
25  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26  02110-1301, USA; or see <http://www.gnu.org/licenses/>.
27 
28  \details
29 
30  \amu_define group_name (Mounts)
31  \amu_define group_brief (Screw mounts tabs, mount slots, mount posts, etc.)
32 
33  \amu_include (include/amu/pgid_path_pstem_pg.amu)
34 *******************************************************************************/
35 
36 //----------------------------------------------------------------------------//
37 // group and macros.
38 //----------------------------------------------------------------------------//
39 
40 /***************************************************************************//**
41  \amu_include (include/amu/group_in_parent_start.amu)
42  \amu_define includes_required_add
43  (
44  models/3d/fastener/screws.scad
45  )
46  \amu_include (include/amu/includes_required.amu)
47 *******************************************************************************/
48 
49 //----------------------------------------------------------------------------//
50 
51 //! A mount tab with screw hole and support brace.
52 /***************************************************************************//**
53  \param wth <decimal> wall thickness.
54 
55  \param screw <datastruct | decimal> screw bore; structured data or
56  a single decimal to set the bore diameter.
57 
58  \param brace <decimal-list-2 | decimal> brace percentage; a list
59  [by, bz] or a single decimal to set (by=bz).
60 
61  \param size <decimal-list-2 | decimal> tab size; a list [sx, sy].
62 
63  \param vr <decimal-list-4 | decimal> rounding radius; a list
64  [v1r, v2r, v3r, v4r] or a single decimal for
65  (v1r=v2r=v3r=v4r).
66 
67  \param vrm <integer> rounding mode {0|1|2|3|4}.
68 
69  \details
70 
71  Construct a mount tab with a screw hole. The parameters \p wth and
72  \p screw are required (the others are optional). When \p brace is
73  specified, braces are constructed to support and reinforce the
74  connection to the adjacent structure. The brace-to-tab and
75  brace-to-wall lengths can be specified independently. When the \p
76  size if not supplied, a default size will be used based on the
77  specified mount tab features.
78 
79  ## Multi-value and structured parameters
80 
81  ### screw bore
82 
83  #### Data structure fields: screw
84 
85  e | data type | default value | parameter description
86  ---:|:-----------------:|:-----------------:|:------------------------------------
87  0 | <decimal> | required | \p d: bore diameter
88  1 | (see below) | \b undef | \p h: screw head
89  2 | (see below) | \b undef | \p t: tolerance
90 
91  See screw_bore() for documentation of the data types for the
92  screw bore parameters \p h and \p t.
93 
94  \amu_define scope_id (example_mount_screw_tab)
95  \amu_define title (Screw mount tab example)
96  \amu_define image_views (top right diag)
97  \amu_define image_size (sxga)
98 
99  \amu_include (include/amu/scope_diagrams_3d.amu)
100 *******************************************************************************/
101 module mount_screw_tab
102 (
103  wth,
104  screw,
105  brace,
106  size,
107  vr,
108  vrm
109 )
110 {
111  // screw: diameter, head, and tolerance
112  d = defined_e_or(screw, 0, screw);
113  h = defined_e_or(screw, 1, undef);
114  t = defined_e_or(screw, 2, undef);
115 
116  // default size: x and y (adjusted for tolerance and brace thickness)
117  dx = d*3 + defined_e_or(t, 0, 0) + (is_undef(brace) ? 0 : wth*2);
118  dy = d*3 + defined_e_or(t, 1, 0);
119 
120  x = defined_e_or(size, 0, dx);
121  y = defined_e_or(size, 1, dy);
122 
123  // rounding defaults
124  r = defined_or(vr, d/2);
125 
126  rm = vrm == 1 ? [[5,5,0,0], [10,0,9]]
127  : vrm == 2 ? [[5,5,10,9], [10,0,9]]
128  : vrm == 3 ? [[1,1,0,0], [4,0,3]]
129  : vrm == 4 ? [[1,1,4,3], [4,0,3]]
130  : [0, 0];
131 
132  translate([0, y/2, wth/2])
133  union()
134  {
135  // mount tab
136  difference()
137  {
138  extrude_linear_uss(wth, center=true)
139  pg_rectangle([x, y], vr=r, vrm=first(rm), center=true);
140 
141  screw_bore(d=d, l=wth+eps*8, h=h, t=t, a=0);
142  }
143 
144  // mount tab reinforcement triangular brace
145  if ( is_defined(brace) )
146  {
147  by = defined_e_or(brace, 0, brace);
148  bz = defined_e_or(brace, 1, by);
149 
150  sy = y * by /100;
151  sz = y * bz /100;
152 
153  for ( i=[-1, 1] )
154  rotate([0, 90, 0])
155  translate([-wth/2 -sz - eps*2, -y/2, (x/2 - wth/2)*i])
156  extrude_linear_uss(wth, center=true)
157  pg_triangle_sas([sy, 90, sz], vr=r, vrm=second(rm));
158  }
159  }
160 }
161 
162 //! A screw mount slot with optional cover envelope.
163 /***************************************************************************//**
164  \param wth <decimal> wall thickness.
165 
166  \param screw <datastruct> screw bore (see below).
167 
168  \param cover <decimal-length-3 | decimal> cover envelope; a list
169  [co, ct, cb], the cover over and around the top and
170  base, or a single decimal to set (co=ct=cb).
171 
172  \param size <decimal> slot length.
173 
174  \param align <integer-list-3 | integer> mount alignment; a list
175  [ax, ay, az] or a single integer to set ax.
176 
177  \param mode <integer> mode {0=cover, 1=slot (negative), 2=cover
178  with slot removed}.
179 
180  \param f <decimal-list-2 | decimal> scale factor; a list
181  [fd, fh], the bore diameter and bore height scale
182  factors, or a single decimal to specify \p fd only.
183  The default values for both \p fd and \p fh is 1.
184 
185  \details
186 
187  Construct a screw mount slot with an opening that allows for the
188  insertion and interlocking of a screw head. The mount is secured to
189  the screw by sliding the screw head into the mount slot. The mount
190  can be used with and without a cover. The parameter \p size is
191  optional and when not specified, its value is 3 * d (the screw neck
192  diameter).
193 
194  ## Multi-value and structured parameters
195 
196  ### screw bore
197 
198  #### Data structure fields: screw
199 
200  e | data type | default value | parameter description
201  ---:|:-----------------:|:-----------------:|:------------------------------------
202  0 | <decimal> | required | \p d : neck diameter
203  1 | <datastruct> | [d*2, d/2] | \p h : screw head
204 
205  See screw_bore() for documentation of the data types for the
206  screw parameters \p d and \p h.
207 
208  \amu_define scope_id (example_mount_screw_slot)
209  \amu_define title (Screw mount slot example)
210  \amu_define image_views (front top diag)
211  \amu_define image_size (sxga)
212 
213  \amu_include (include/amu/scope_diagrams_3d.amu)
214 *******************************************************************************/
215 module mount_screw_slot
216 (
217  wth,
218  screw,
219  cover,
220  size,
221  align,
222  mode,
223  f
224 )
225 {
226  // slot cover
227  module cover()
228  {
229  // shape overlap adjustment
230  coa = eps*4;
231 
232  hull()
233  for ( x=[-1, 1] )
234  {
235  translate([sl/2*x, 0, sd + cto - coa])
236  cylinder(d=hd + ctt*2 - coa, h=eps);
237 
238  translate([sl/2*x, 0, coa])
239  cylinder(d=hd + ctb*2 - coa, h=eps);
240  }
241  }
242 
243  // slot
244  module slot()
245  {
246  translate([0, 0, -eps*4])
247  union()
248  {
249  // neck slot
250  screw_bore(d, l=sd, h=h, t=[sl], f=f, a=9);
251 
252  // screw insert hole
253  translate([sl/2, 0, 0])
254  cylinder(d=hd, h=sd);
255  }
256  }
257 
258  // diameter and height scale factors
259  fd = defined_eon_or(f, 0, 1);
260  fh = defined_e_or(f, 1, 1);
261 
262  // screw: diameter, head
263  d = defined_e_or(screw, 0, screw);
264  h = defined_e_or(screw, 1, [d*2, d/2]);
265 
266  // local scaled version of screw diameter
267  ld = d * fd;
268 
269  // screw head: diameter, flat height, bevel height
270  hd = defined_e_or(h, 0, 0) * fd;
271  hf = defined_e_or(h, 1, 0) * fh;
272  hb = defined_e_or(h, 2, 0) * fh;
273 
274  // slot cover: default, over, top, bottom
275  cto = defined_eon_or(cover, 0, 0);
276  ctt = defined_e_or(cover, 1, cto);
277  ctb = defined_e_or(cover, 2, ctt);
278 
279  // slot size: depth, length
280  sd = wth + hf;
281  sl = defined_or(size, d * 3);
282 
283  alignments =
284  [
285  [0, -sl-hd-ctt*2, -sl-hd-ctb*2, -sl-hd, -sl, sl, sl+ld, sl+hd, sl+hd+ctb*2, sl+hd+ctt*2]/2,
286  [0, -hd-ctt*2, -hd-ctb*2, -hd, -ld, ld, hd, hd+ctb*2, hd+ctt*2]/2,
287  [0, -wth/2, -wth+hb, -wth, -sd, -sd-cto]
288  ];
289 
290  // when 'align' is scalar assign to 'align_x'
291  align_x = select_ci ( alignments.x, defined_eon_or(align, 0, 0), false );
292  align_y = select_ci ( alignments.y, defined_e_or(align, 1, 0), false );
293  align_z = select_ci ( alignments.z, defined_e_or(align, 2, 0), false );
294 
295  translate([align_x, align_y, align_z])
296  {
297  if (mode == 0)
298  cover();
299 
300  if (mode == 1)
301  slot();
302 
303  if (mode == 2)
304  difference()
305  {
306  cover();
307  slot();
308  }
309  }
310 }
311 
312 //! A screw mount post with screw bore and optional fins.
313 /***************************************************************************//**
314 
315  \param post <datastruct> post (see below).
316  \param screw <datastruct> screw bore (see below).
317  \param bore_sft <datastruct> self-forming threads screw bore (see below).
318  \param fins <datastruct> fins (see below).
319  \param cut <datastruct> cut (see below).
320 
321  \details
322 
323  Construct a screw mount post with screw bore, fins, and diagonal
324  cut at base. The post and fins have preset rounding configurations,
325  but also support manual rounding specifications. The post screw
326  bore is removed using either screw_bore(), or screw_bore_tsf(), or
327  both. All relevant screw bore features are made available,
328  including nut-slot cut-outs as shown in the examples below. The
329  post can be configured with a diagonally cut base to facilitate 3D
330  printing posts without base support, such as those attached
331  elevated on walls.
332 
333  \note Both \p screw and \p bore_sft may be used together when it is
334  desired to create a recessed screw head and a bore with self
335  forming threads. The \p screw bore diameter will need to be
336  sufficiently reduced so as to not remove the self-forming
337  thread engagement cylinders.
338 
339  ## Multi-value and structured parameters
340 
341  ### post
342 
343  #### Data structure fields: post
344 
345  e | data type | default value | parameter description
346  ---:|:-----------------:|:-----------------:|:------------------------------------
347  0 | <decimal-list-2 \| decimal> | required | \p pd: post diameter(s)
348  1 | <decimal> | required | \p ph: post height
349  2 | <integer-list-4 \| integer \| string> | 0 | rounding mode
350  3 | <decimal-list-4 \| decimal> | min(pd)/8 | rounding radius
351 
352  The post base and top can have different diameters by assigning a
353  list [pdb, pdt]. This is useful for 3D printing unsupported wall
354  attached posts. When \p pd is assigned a decimal the base and top
355  diameters will be equal. The rounding mode can be assigned one of
356  the preset configuration strings: {"p1", ..., "p13"} or assigned
357  a custom value. Both the rounding mode and rounding radius can be
358  assigned a list, to control each edge individually, or a single
359  value when all edges shall be the same.
360 
361  \note When assigning the rounding mode and rounding radius
362  individually, the inner-upper and inner-lower edges of the
363  rectangular revolution, that forms the post, should be
364  assigned zero in most circumstances as follows, for
365  example: [0, 1, 4, 0].
366 
367  ### screw bore
368 
369  #### Data structure fields: screw
370 
371  e | data type | default value | parameter description
372  ---:|:-----------------:|:-----------------:|:------------------------------------
373  0 | <decimal> | required | \p d: bore diameter
374  1 | <decimal> | pd | \p l: bore length
375  2 | <datastruct> | undef | \p h: screw head
376  3 | <datastruct> | undef | \p n: screw nut
377  4 | <datastruct> | undef | \p s: nut slot cutout
378  5 | <datastruct> | undef | \p f: bore scale factor
379 
380  See screw_bore() for documentation of the data types for the
381  screw parameters.
382 
383  ### self-forming threads screw bore
384 
385  #### Data structure fields: bore_sft
386 
387  e | data type | default value | parameter description
388  ---:|:-----------------:|:-----------------:|:------------------------------------
389  0 | <decimal> | required | \p d: bore diameter
390  1 | <decimal> | pd | \p l: bore length
391  2 | <datastruct> | undef | \p t: thread engagement
392 
393  See screw_bore_tsf() for documentation of the data types for the
394  self-forming threads screw bore parameters.
395 
396  ### fins
397 
398  #### Data structure fields: fins
399 
400  e | data type | default value | parameter description
401  ---:|:-----------------:|:-----------------:|:------------------------------------
402  0 | <integer> | required | fin count
403  1 | <integer> | 0 | fin type: {0=triangular, 1=rectangular}
404  2 | <decimal-list-3 \| decimal> | [ph*5/8, pd/4, pd/8] | size scale factors: [h, l, w]
405  3 | <integer-list-n \| integer \| string> | 0 | rounding mode
406  4 | <decimal-list-n \| decimal> | (see below) | rounding radius
407  5 | <decimal> | 360 | distribution angle
408 
409  The rounding mode can be assigned one of the preset configuration
410  strings: {"p1", ..., "p6"} or assigned custom values. Both the
411  rounding mode and rounding radius can be assigned a list, to
412  control each edge individually, or a single value when all edges
413  shall be the same.
414 
415  \note The edge list size is dependent on the fin type; n=3 for
416  triangular, and n=4 for rectangular.
417 
418  ### cut
419 
420  #### Data structure fields: cut
421 
422  e | data type | default value | parameter description
423  ---:|:-----------------:|:-----------------:|:------------------------------------
424  0 | <decimal> | 0 | cut x-angle
425  1 | <decimal> | 0 | cut post base offset
426  2 | <decimal> | 0 | cut z-rotation
427  3 | <decimal> | 4 | cube removal scale
428 
429  The \p cut parameter can be used to cut the base of the post at
430  an angle. As previously discussed, this is useful for 3D-printing
431  wall-attached posts that does not have lower support.
432 
433  \amu_define scope_id (example_mount_screw_post)
434  \amu_define title (Screw mount post example)
435  \amu_define image_views (front top diag)
436  \amu_define image_size (sxga)
437 
438  \amu_include (include/amu/scope_diagrams_3d.amu)
439 *******************************************************************************/
440 module mount_screw_post
441 (
442  post,
443  screw,
444  bore_sft,
445  fins,
446  cut
447 )
448 {
449  // round post fins
450  module round_post_fins(rd, rh)
451  {
452  // move distance for fin to always contact approximated polygon cylinder
453  function fin_embed(r, w) =
454  let
455  (
456  n = get_fn(r),
457  d = polygon_regular_perimeter(n, r) / n
458  )
459  r - sqrt( pow(r,2) - pow(w/2, 2) - pow(d/2, 2) );
460 
461  c = defined_eon_or(fins, 0, 0); // count
462 
463  if ( c > 0 )
464  {
465  t = defined_e_or(fins, 1, 0); // type
466  sf = defined_e_or(fins, 2, undef); // size scale factors: [h, l, t]
467 
468  h = defined_eon_or(sf, 0, 5/8) * rh;
469  l = defined_e_or (sf, 1, 1/4) * rd;
470  w = defined_e_or (sf, 2, 1/8) * rd;
471 
472  d_vr = ( t == 0 ) ? min(h, l)/2 : min(l, w)/2;
473 
474  vrm = defined_e_or(fins, 3, 0); // rounding mode
475  vr = defined_e_or(fins, 4, d_vr); // vertex rounding
476  da = defined_e_or(fins, 5, 360); // distribution angle
477 
478  // triangular
479  if ( t == 0 )
480  {
481  p_vrm =
482  let
483  (
484  p = !is_string(vrm) ? vrm
485  : (vrm == "p1") ? [10, 0, 9]
486  : (vrm == "p2") ? [4, 0, 3]
487  : (vrm == "p3") ? [6, 0, 7]
488  : (vrm == "p4") ? [7, 0, 7]
489  : (vrm == "p5") ? [0, 0, 1]
490  : (vrm == "p6") ? [0, 0, 5]
491  : 0
492  )
493  p;
494 
495  for (i = [0:c-1])
496  {
497  rotate([90, 0, da/c * i + 180])
498  translate([ -rd/2 - l + fin_embed(rd/2, w), 0, 0])
499  extrude_linear_mss(w, center=true)
500  pg_triangle_sas([h, 90, l], vr=vr, vrm=p_vrm);
501  }
502  }
503  else
504 
505  // rectangular
506  if ( t == 1 )
507  {
508  p_vrm =
509  let
510  (
511  p = !is_string(vrm) ? vrm
512  : (vrm == "p1") ? [0, 10, 9, 0]
513  : (vrm == "p2") ? [0, 4, 3, 0]
514  : (vrm == "p3") ? [0, 8, 7, 0]
515  : (vrm == "p4") ? [0, 5, 5, 0]
516  : (vrm == "p5") ? [0, 1, 1, 0]
517  : (vrm == "p6") ? [0, 9, 10, 0]
518  : 0
519  )
520  p;
521 
522  for (i = [0:c-1])
523  {
524  rotate([0, 0, da/c * i])
525  translate([rd/2 + l/2 - fin_embed(rd/2, w), 0, 0])
527  pg_rectangle( [l, w], vr=vr, vrm=p_vrm, center=true);
528  }
529  }
530  }
531  }
532 
533  pd = defined_e_or(post, 0, 0);
534  ph = defined_e_or(post, 1, 0);
535  vrm = defined_e_or(post, 2, 0);
536 
537  pd_min = min( pd );
538  pd_max = max( pd );
539 
540  vr = defined_e_or(post, 3, pd_min/8);
541 
542  p_vrm =
543  let
544  (
545  p = !is_string(vrm) ? vrm
546  : (vrm == "p1" ) ? [0, 5, 10, 0]
547  : (vrm == "p2" ) ? [0, 0, 10, 0]
548  : (vrm == "p3" ) ? [0, 5, 0, 0]
549  : (vrm == "p4" ) ? [0, 1, 0, 0]
550  : (vrm == "p5" ) ? [0, 9, 0, 0]
551  : (vrm == "p6" ) ? [0, 7, 0, 0]
552  : (vrm == "p7" ) ? [0, 1, 4, 0]
553  : (vrm == "p8" ) ? [0, 1, 8, 0]
554  : (vrm == "p9" ) ? [0, 5, 5, 0]
555  : (vrm == "p10") ? [0, 9, 10, 0]
556  : (vrm == "p11") ? [0, 1, 1, 0]
557  : (vrm == "p12") ? [0, 3, 4, 0]
558  : (vrm == "p13") ? [0, 7, 8, 0]
559  : 0
560  )
561  p;
562 
563  //
564  // construct
565  //
566 
567  difference()
568  {
569  union()
570  {
571  // round post
572  rotate_extrude()
573  pg_trapezoid(b=pd/2, h=ph, vr=vr, vrm=p_vrm);
574 
575  // fins
576  if ( is_defined(fins) )
577  round_post_fins(pd_min, ph);
578  }
579 
580  // screw bore
581  if ( is_defined(screw) )
582  {
583  d = defined_eon_or(screw, 0, 0);
584  l = defined_e_or(screw, 1, ph);
585  h = defined_e_or(screw, 2, undef);
586  n = defined_e_or(screw, 3, undef);
587  s = defined_e_or(screw, 4, undef);
588  f = defined_e_or(screw, 5, undef);
589 
590  translate([0, 0, ph+eps*2])
591  screw_bore(d=d, l=l, h=h, n=n, s=s, f=f, a=1);
592  }
593 
594  // self-forming threads screw bore
595  if ( is_defined(bore_sft) )
596  {
597  d = defined_eon_or(bore_sft, 0, 0);
598  l = defined_e_or(bore_sft, 1, ph);
599  t = defined_e_or(bore_sft, 2, undef);
600 
601  translate([0, 0, ph+eps*2])
602  screw_bore_tsf(d=d, l=l, t=t, a=1);
603  }
604 
605  // post cut
606  if ( is_defined(cut) )
607  {
608  a = defined_e_or(cut, 0, 0); // cut x-angle
609  o = defined_e_or(cut, 1, 0); // cut base offset
610  r = defined_e_or(cut, 2, 0); // cut z-rotation
611  s = defined_e_or(cut, 3, 4); // removal scale
612 
613  c = [pd_max, pd_max, ph] * s;
614 
615  translate([0, 0, o])
616  rotate([a, 0, r-90])
617  translate([0, 0, -third(c)/2])
618  cube(c, center=true);
619  }
620  }
621 }
622 
623 //! @}
624 //! @}
625 
626 
627 //----------------------------------------------------------------------------//
628 // openscad-amu auxiliary scripts
629 //----------------------------------------------------------------------------//
630 
631 /*
632 BEGIN_SCOPE example_mount_screw_tab;
633  BEGIN_OPENSCAD;
634  include <omdl-base.scad>;
635  include <models/3d/fastener/screws.scad>;
636  include <parts/3d/enclosure/mounts.scad>;
637 
638  $fn = 36;
639 
640  d = 4;
641  h = [7, 1, 1/2];
642  t = [0, 10];
643 
644  mirror([0,1,0])
645  mount_screw_tab(wth=3, screw=[d, h, t], brace=[50, 25], vrm=4);
646 
647  // end_include
648  END_OPENSCAD;
649 
650  BEGIN_MFSCRIPT;
651  include --path "${INCLUDE_PATH}" {var_init,var_gen_png2eps}.mfs;
652  table_unset_all sizes;
653 
654  images name "sizes" types "sxga";
655  views name "views" views "top right diag";
656 
657  variables set_opts_combine "sizes views";
658  variables add_opts "--viewall --autocenter --view=axes";
659 
660  include --path "${INCLUDE_PATH}" scr_make_mf.mfs;
661  END_MFSCRIPT;
662 END_SCOPE;
663 
664 BEGIN_SCOPE example_mount_screw_slot;
665  BEGIN_OPENSCAD;
666  include <omdl-base.scad>;
667  include <models/3d/fastener/screws.scad>;
668  include <parts/3d/enclosure/mounts.scad>;
669 
670  $fn = 36;
671 
672  rotate([0, 90, 90])
673  {
674  w = 2;
675  s = [4, [8, 2, 1]];
676  c = [1, 3, 1];
677 
678  translate([0, -15, 0])
679  mount_screw_slot(wth=w, screw=s, cover=c, mode=1);
680 
681  mount_screw_slot(wth=w, screw=s, cover=c, mode=2);
682 
683  translate([0, +15, 0])
684  difference() {
685  %mount_screw_slot(wth=w, screw=s, cover=c, mode=0);
686  mount_screw_slot(wth=w, screw=s, cover=c, mode=1);
687  }
688  }
689 
690  // end_include
691  END_OPENSCAD;
692 
693  BEGIN_MFSCRIPT;
694  include --path "${INCLUDE_PATH}" {var_init,var_gen_png2eps}.mfs;
695  table_unset_all sizes;
696 
697  images name "sizes" types "sxga";
698  views name "views" views "front top diag";
699 
700  variables set_opts_combine "sizes views";
701  variables add_opts "--viewall --autocenter --view=axes";
702 
703  include --path "${INCLUDE_PATH}" scr_make_mf.mfs;
704  END_MFSCRIPT;
705 END_SCOPE;
706 
707 BEGIN_SCOPE example_mount_screw_post;
708  BEGIN_OPENSCAD;
709  include <omdl-base.scad>;
710  include <models/3d/fastener/screws.scad>;
711  include <parts/3d/enclosure/mounts.scad>;
712 
713  $fn = 36;
714 
715  u = undef;
716 
717  translate([-20, 0, 0])
718  mount_screw_post(post=[[10, 5], 4], bore_sft=3, fins=[6, 1, 1]);
719 
720  s = [3, 21, [5, 1, 1, 4], [5, 2, 0, 6, 0, 5], [0, -10]];
721  translate([0, 0, 0])
722  mount_screw_post(post=[10, 20, "p10"], screw=s, fins=[2, 1, 1, "p1"]);
723 
724  translate([+20, 0, 0])
725  mount_screw_post(post=[10, 25, "p1"], screw=[3, 10, [5, 1, 1]], fins=[4, 0, u, "p1"]);
726 
727  // end_include
728  END_OPENSCAD;
729 
730  BEGIN_MFSCRIPT;
731  include --path "${INCLUDE_PATH}" {var_init,var_gen_png2eps}.mfs;
732  table_unset_all sizes;
733 
734  images name "sizes" types "sxga";
735  views name "views" views "front top diag";
736 
737  variables set_opts_combine "sizes views";
738  variables add_opts "--viewall --autocenter --view=axes";
739 
740  include --path "${INCLUDE_PATH}" scr_make_mf.mfs;
741  END_MFSCRIPT;
742 END_SCOPE;
743 */
744 
745 //----------------------------------------------------------------------------//
746 // end of file
747 //----------------------------------------------------------------------------//
748 
eps
<decimal> Epsilon, small distance to deal with overlapping shapes.
Definition: constants.scad:195
function defined_e_or(v, i, d)
Return an element of an iterable when it exists or a default value otherwise.
function third(v)
Return the third element of an iterable value.
function second(v)
Return the second element of an iterable value.
function defined_eon_or(v, i, d)
Return the list element or scalar numeric value, if either is defined, otherwise the default value.
function first(v)
Return the first element of an iterable value.
function select_ci(v, i, l=true)
Select specified element from list or return a default.
function defined_or(v, d)
Return given value, if defined, or a secondary value, if primary is not defined.
function is_defined(v)
Test if a value is defined.
function polygon_regular_perimeter(n, r, a)
Compute the perimeter of an n-sided regular polygon in 2D.
function get_fn(r)
Return facets number for the given arc radius.
module screw_bore(d=1, l=1, h, n, t, s, f, a)
Flat and beveled-head fastener bore with nut, nut slot, and bore tolerance.
Definition: screws.scad:358
module screw_bore_tsf(d=1, l=1, t, a)
Gapped fastener bore with engagement cylinders for self-forming threads.
Definition: screws.scad:695
module mount_screw_post(post, screw, bore_sft, fins, cut)
A screw mount post with screw bore and optional fins.
Definition: mounts.scad:1009
module mount_screw_slot(wth, screw, cover, size, align, mode, f)
A screw mount slot with optional cover envelope.
Definition: mounts.scad:630
module mount_screw_tab(wth, screw, brace, size, vr, vrm)
A mount tab with screw hole and support brace.
Definition: mounts.scad:362
module pg_trapezoid(b=1, h, l=1, a=90, o=origin2d, vr, vrm=1, vfn, center=false)
A polygon trapezoid with individual vertex rounding and arc facets.
Definition: polygon.scad:716
module pg_triangle_sas(v, a=x_axis_ci, o, vr, vrm=1, vfn, cm=0)
A polygon triangle specified by size-angle-size with vertex rounding.
Definition: polygon.scad:1104
module pg_rectangle(size=1, o, vr, vrm=1, vfn, center=false)
A polygon rectangle with vertex rounding.
Definition: polygon.scad:765
module extrude_linear_mss(h, center=false, c=true)
Linearly extrude a 2d shape with multi-segment uniformly-spaced profile scaling.
Definition: extrude.scad:748
module extrude_linear_uss(h, center=false, c=true, ha=0)
Linearly extrude a 2d shape with uniformly-spaced profile scaling.
Definition: extrude.scad:666