In case anyone finds it useful ...
https://www.thingiverse.com/thing:2421943 "Some simple OpenSCAD to get the points for lines that are tangential to two arbitrary circles. I found myself bodging this a lot so used Prof. Google to get some equations to do it properly. Enjoy!" _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org 
what is the prof google ?
On 06/07/17 16:36, Ian Oliver wrote: > In case anyone finds it useful ... > > https://www.thingiverse.com/thing:2421943 > > "Some simple OpenSCAD to get the points for lines that are tangential > to two arbitrary circles. > > I found myself bodging this a lot so used Prof. Google to get some > equations to do it properly. > > Enjoy!" > > > > _______________________________________________ > OpenSCAD mailing list > [hidden email] > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org 
On 20170706 18:33, Mr C Camacho wrote:
> what is the prof google ? Just googling for likely pages and my scad files link to the ones I used. I was really just flagging that the maths are stolen and I just did the monkey see, monkey do. _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org 
oh right! doh!
I was thinking there was some soon to be shuttered google service that would take sets of data and produce a formula! On 06/07/17 19:31, Ian Oliver wrote: > On 20170706 18:33, Mr C Camacho wrote: >> what is the prof google ? > > Just googling for likely pages and my scad files link to the ones I > used. I was really just flagging that the maths are stolen and I just > did the monkey see, monkey do. > > > _______________________________________________ > OpenSCAD mailing list > [hidden email] > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org 
I was trying to write a script to draw tangents of circles a while ago: http://forum.openscad.org/ScripttoreplicatehullandminkoswkiforCSGexportimportintoFreeCADtd16537.html
I can't remember where I got the maths from. Nophead supplied this very neat answer, that allows for different radii of the circles, and negative radii for concave shapes  hull and minkowski can't do that!: http://forum.openscad.org/ScripttoreplicatehullandminkoswkiforCSGexportimportintoFreeCADtp16537p16556.html Ian 
On 20170706 22:52, droftarts wrote:
> Nophead supplied this very neat answer, that allows for different radii of > the circles, and negative radii for concave shapes Wow, and very nice it is too. A neater way of creating the very shape I wanted from my tangent code, as it happens, and easier to use! _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org 
I use it for complex belt paths around different sized pulleys, for example an Hbot I a working on. On 7 July 2017 at 11:22, Ian Oliver <[hidden email]> wrote: On 20170706 22:52, droftarts wrote: _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org 
Hi nophead
Presumably you've added a bit to the script that adds up the length of the tangents, and the arcs of where the belt is on the pulley, to come up with the belt length? Ian 
Yes indeed although I haven't actually cut a belt to test it yet. // // p w t t p // i i h o i // t d i o t // c t c t c // h h k h h line from tooth base // T5x6 = [ 5, 6, 2.2, 1.2, 0.5]; T5x10 = [ 5, 10, 2.2, 1.2, 0.5]; T2p5x6 =[2.5, 6, 1.7, 0.7, 0.3]; GT2x6 = [2.0, 6, 1.38, 0.75, 0.254]; function belt_pitch(type) = type[0]; function belt_width(type) = type[1]; function belt_thickness(type) = type[2]; function belt_tooth_height(type) = type[3]; function belt_pitch_height(type) = belt_tooth_height(type) + type[4]; belt_colour = grey20; tooth_colour = grey50; // // We model the belt path at the pitch radius of the pulleys and the pitch line of the belt to get an accurate length. // The belt is then drawn by offseting each side from the pitch line. // module belt(type, points, gap = 0, gap_pt = undef) { width = belt_width(type); pitch = belt_pitch(type); thickness = belt_thickness(type); vitamin(str("BT", belt_pitch(type) * 10,width, round(length), ": Belt T", belt_pitch(type)," x ", width, "mm x ", length, "mm")); function tangent(p1, p2) = let( r1 = p1[2], r2 = p2[2], dx = p2.x  p1.x, dy = p2.y  p1.y, d = sqrt(dx * dx + dy * dy), theta = atan2(dy, dx) + acos((r1  r2) / d), xa = p1.x +(cos(theta) * r1), ya = p1.y +(sin(theta) * r1), xb = p2.x +(cos(theta) * r2), yb = p2.y +(sin(theta) * r2) )[ [xa, ya], [xb, yb] ]; len = len(points); indices = [0 : len  1]; tangents = [for(i = indices) let(ends = tangent(points[i], points[(i + 1) % len])) for(end = [0, 1]) ends[end]]; straights = [for(i = indices) norm(tangents[2 * i]  tangents[2 * i + 1])]; arcs = [for(i = indices) let(p1 = tangents[2 * i + 1], p2 = tangents[(2 * i + 2) % (2 * len)], corner = points[(i + 1) % len], c = [corner.x, corner.y], v1 = p1  c, v2 = p2  c, r = abs(corner.z)) PI * acos((v1 * v2) / sqr(r)) * r / 180]; function sumv(v, i = 0, sum = 0) = i == len(v) ? sum : sumv(v, i + 1, sum + v[i]); length = ceil((sumv(concat(straights, arcs))  gap) / pitch) * pitch; //echo(straights, arcs, length); module shape() { difference() { union() { for(i = indices) if(points[i][2] > 0) translate([points[i].x, points[i].y]) circle(points[i][2]); polygon(tangents); } for(i = indices) if(points[i][2] < 0) translate([points[i].x, points[i].y]) circle(points[i][2]); } } module gap() if(gap) translate(gap_pt) square([gap, thickness + eps], center = true); color(belt_colour) render(convexity = len) linear_extrude(height = width, center = true) difference() { offset(thickness  belt_pitch_height(type)) shape(); offset(belt_pitch_height(type) + belt_tooth_height(type)) shape(); gap(); } color(tooth_colour) render(convexity = len) linear_extrude(height = width, center = true) difference() { offset(belt_pitch_height(type) + belt_tooth_height(type)) shape(); offset(belt_pitch_height(type)) shape(); gap(); } } On 8 July 2017 at 08:49, droftarts <[hidden email]> wrote: Hi nophead _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org 
This post was updated on .
I may be doing something similar here but in reverse? Finding the tangent points for two lines and a circle.

Yes I think you generate the same shapes but with different starting data. On 22 July 2017 at 13:41, irevdev <[hidden email]> wrote: I may be doing something similar here _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org 
In reply to this post by irevdev
Nice! Though your link is horribly malformed; should be here
I like that you can define the point, and then radius from that; the other script is a bit painful, as you have to offset all the points, as the radius grows out from the point. This has advantages in some circumstances, but can cause headaches in others! It's good that there are two options now. Ian 
Free forum by Nabble  Edit this page 