//demo cad /* short length of 3 start whitworth thread two coloured intersected cubes with a hole through them some hulled 2d ish shapes */ a= thread("whitworth",25,30,64,8,bevel=12,starts=3) // thread // the two cubes b=cube([20,20,20], center=true) c= cube([40,10,10]) c=translate(c,[-20,-3,-2]) b.color="green" c.color="red" d= union([b,c]) hole= cylinder (d1=8,d2=4,h=50,center=true) d= difference(d,hole) d.color="blue" // blue cubes // a boolean on different colored items, gives the final color to be grey // keep colors b2= difference(b,hole) b2.color="green" c2= difference(c,hole) c2.color="red" d2c=[b2,c2] // cubes in original colors c= circle3d(d=25) c=rotate(c,[45,45,45]) s=square3d([20,30]) s=hull([s,c]) // hulled planes, sort of // move to show all at once d=translate(d,[0,0,30]) a=translate(a,[40,0,0]) s=translate(s,[40,0,50]) some= [a,d,s] //show_obj(some,d2c) show_ply(some,d2c) //show_scad(some,d2c) // check thread verbose_set_global(true) v= verify(a) v= repair (a) a=verify (v) /* results of verbose verify for a [verify] Shape 0: verts=14746 tris=29236 status=NoError [verify] verts=14746 tris=29236 [verify] degenerate or zero-area tri count=426 [verify] edges=43854 boundary=0 nonmanifold=0 [verify] RESULT: Issues detected */ // showing some help (part of) ? thread /* === thread === Creates a threaded cylinder with helical threads, multi-start support, and beveled ends. Sensible defaults for quick testing. Parameters: profile : string or array - "acme", "whitworth", "buttress", "60_degree", "square",or [[x,y],...] array or variable name (default "60_degree") diameter : float - Outer thread diameter (major diameter, default 10) length : float - Final thread length (default 50) segments : int - Number of facets per revolution (default 32) pitch : float - Distance between thread crests (default 2) depth : float - Thread depth (radial, default 0.5*pitch - not used for 60_degree) bevel : float - Chamfer height at top/bottom (default 0) starts : int - Number of thread starts (default 1) Quick Example: th = thread("60_degree") For more: ? thread full - Complete documentation ? thread examples - More examples ? thread algorithm - Implementation details */