Trig challenge February 04, 2014 10:28AM |
Registered: 11 years ago Posts: 369 |
y = a - 2r + w ------ sin x y = b ----- tan xwhere a, b, r and w are known and 0 < x < 90 degrees.
y = 70 - 2 + 3 ------ sin x y = 30 ----- tan xand if I plot the resulting expressions using https://www.desmos.com/calculator then I get the following:
Re: Trig challenge February 05, 2014 07:43AM |
Registered: 14 years ago Posts: 3,742 |
Quote
QuackingPlums
Short version is; I'm trying to fill an arbitrary shape with rounded triangles in OpenSCAD. I've simplified a pair of expressions that describe the canonical problem of filling a rectangle with two triangles but I can't for the life of me figure out how to simplify/solve them.
a = 70; b = 30; r = 2; w = 3; th = 4; $fn = 50; module TriangleA() { color([1,0,0]) hull() { translate([w + r, a - w - r, th/2]) cylinder(r = r, h = th, center = true); translate([w + r, w + r, th/2]) cylinder(r = r, h = th, center = true); translate([b - w - 4.6 * r, w + r, th/2]) cylinder(r = r, h = th, center = true); } } module TriangleB() { color([0,1,0]) hull() { translate([w + 4.6 * r, a - w - r, th/2]) cylinder(r = r, h = th, center = true); translate([b - w - r, a - w - r, th/2]) cylinder(r = r, h = th, center = true); translate([b - w - r, w + r, th/2]) cylinder(r = r, h = th, center = true); } } module Rectangle() { color([0.7,0.7,0.7]) translate(0,0,-0.5) cube([b, a, 1], false); } TriangleA(); TriangleB(); Rectangle();
Re: Trig challenge February 05, 2014 09:50AM |
Registered: 11 years ago Posts: 369 |
a = 70; b = 30; r = 1; w = 3; th = 4; $fn = 50; module TriangleA() { color([1,0,0]) hull() { translate([w + r, a - w - r, th/2]) cylinder(r = r, h = th, center = true); translate([w + r, w + r, th/2]) cylinder(r = r, h = th, center = true); translate([b // width of base - w // gap between (green) triangleB and edge - 2*r // tip of triangleB - w // gap between triangles - r // corner radius of (red) triangleA , w + r, th/2]) cylinder(r = r, h = th, center = true); } } module TriangleB() { color([0,1,0]) hull() { translate([w + 2 * r + w + r, a - w - r, th/2]) cylinder(r = r, h = th, center = true); translate([b - w - r, a - w - r, th/2]) cylinder(r = r, h = th, center = true); translate([b - w - r, w + r, th/2]) cylinder(r = r, h = th, center = true); } } module Rectangle() { color([0.7,0.7,0.7]) translate(0,0,-0.5) cube([b, a, 1], false); } TriangleA(); TriangleB(); Rectangle();
Re: Trig challenge February 05, 2014 10:14AM |
Registered: 14 years ago Posts: 3,742 |
1A 3A 1B 2A 3B 2B
Re: Trig challenge February 28, 2014 06:02AM |
Registered: 11 years ago Posts: 369 |
sin x = a - y = opp ------ --- 2r + w hyp tan x = b = opp - --- y adj
a y^2 + b y + c = 0and solve for y using the quadratic formula, substituting my coefficients for a, b and c.
Re: Trig challenge March 02, 2014 07:04AM |
Registered: 13 years ago Posts: 861 |
Quote
QuackingPlums
Not sure if this is the right section(especially since nobody seems to read this one!) !
Re: Trig challenge March 03, 2014 03:50AM |
Registered: 11 years ago Posts: 369 |
Re: Trig challenge March 04, 2014 01:17AM |
Registered: 13 years ago Posts: 861 |