Posted by appjaws1

help with my poor maths January 30, 2016 10:15AM |
Registered: 3 years ago Posts: 758 |

I need to attach qty3, 6mm diameter x 20mm length rods equal distance on the attached scad and 1mm in from the edge, The rods need to be 90 degrees to the slope and 120 degrees apart

I have tried many ways ( all wrong, I just can't get my head round this multi angled problem due to poor maths.

Can anybody help please?

the script:-

$fn=100;

cylinder(h=4,r=13.5);

translate([0,0,4]) cylinder(h=5,r1=13.5,r2=6);

appjaws - Ormerod 1, core XY

Duet wifi, duex5

firmware 1.18

Web Interface 1.15a

OpenSCAD 2015.03

slic3r-1.33.8-prusa3d and/or Simplify3D 3.1.1

I have tried many ways ( all wrong, I just can't get my head round this multi angled problem due to poor maths.

Can anybody help please?

the script:-

$fn=100;

cylinder(h=4,r=13.5);

translate([0,0,4]) cylinder(h=5,r1=13.5,r2=6);

appjaws - Ormerod 1, core XY

Duet wifi, duex5

firmware 1.18

Web Interface 1.15a

OpenSCAD 2015.03

slic3r-1.33.8-prusa3d and/or Simplify3D 3.1.1

Re: help with my poor maths January 30, 2016 11:20PM |
Registered: 2 years ago Posts: 468 |

Re: help with my poor maths January 31, 2016 01:41AM |
Registered: 3 years ago Posts: 758 |

Re: help with my poor maths February 01, 2016 06:09AM |
Registered: 3 years ago Posts: 2,469 |

Quoteappjaws1

perfect, thank you.

atan2 eh! never heard of it before.

It is very similar to atan except that it uses both X and Y instead of X/Y as an argument to return an angle that is in the correct quadrant. atan can only return a value between -90 and +90 degrees.

e.g. imagine a point that is at location X=1 Y=1. To find the angle from the origin you could use atan(X/Y) which correctly gives you 45 degrees. But imagine that the point is at coordinate X= -1, Y= -1 In that case X/Y is still 1, so atan will return the same angle of 45 degrees.

Using atan2 allows you to enter both X and Y coordinates which will give you the correct angle of 225 degrees (openscad returns -135 degrees which is the same thing).

Dave

Re: help with my poor maths February 01, 2016 11:01AM |
Registered: 3 years ago Posts: 758 |

Sorry, only registered users may post in this forum.