0
$\begingroup$

This is a really simple trig problem, but my brain is stuck on it. I'm designing an object in OpenSCAD (3D Drafting), and in order to 'draw' the object, I need to specify a set of points [x,y]. Together, the points makes a closed polygon. Ex: Square is represented by [0,0],[10,0],[10,10],[0,10]

I'm fine with 90 degree corners, but when my object has angles, I don't know how to specify the correct coordinates, and my objects come out skewed. Basically, given a curved object, how do I determine a set of coordinates?

Example: Trying to determine the x-coordinates for an angled object:

Finding x-coordinates given an angled object

How would I find those two question mark coordinates?

Here is my current attempt, with 'eyeing' the coordinates: Red lines showing desired

Thanks!

$\endgroup$

1 Answer 1

1
$\begingroup$

you have a line that goes through $(0,0) and $(110, 30)

$110 y = 30 x$ or $3 x - 11y = 0$ now you need a line that is parallel and 5 units away

$3 x - 11y + d=0$

$d = \sqrt{3^2 + 11^2}\cdot 5$

$3 x - 11y + 5\sqrt {130} = 0$

This line intersect the line y = 5

$x = \frac {55-5\sqrt {130}}3$

$(\frac {55 - 5\sqrt {130}}3, 5)$ is one of your missing coordinates.

The other coordinate:

the line perpendicular to $3x - 11 y = 0$ through the point $(110,30)$

$11(x-110) + 3(y-30) = 0\\ 11x +3y - 1300=0$ intersects $3 x - 11y + 5\sqrt {130} = 0$

$33x +9y - 3900=0\\ 33x -121y +55\sqrt{130}=0\\ 130 y = 3900 + 55\sqrt {130}\\ y = 30 + 55\frac{\sqrt {130}}{130}\\ x = 110 - 15\frac{\sqrt {130}}{130}$

$(110 - 15\frac{\sqrt {130}}{130},30 + 55\frac{\sqrt {130}}{130})$

Which you might notice is $(110,30) + \frac {5}{\sqrt{3^2+11^2}} (-3,11)$

$\endgroup$
2
  • $\begingroup$ Thanks for the quick response. But calculating those numbers gives me: [108.69, 34.82] and [14.53, 5]. This seems off: (55−130√3,5) = (14.53, 5) , which can't be correct because it is the inner crook of the corner, meaning it should be closer to x=100 . Here are the points, and a screenshot of output: polygon(points = [[0,0],[100,0],[110,30],[108.69,34.82],[14.53,5],[0,5]]); imgur.com/a/vTyMN $\endgroup$ Feb 3, 2017 at 3:48
  • $\begingroup$ That would be because I dropped a 5 in last step. $\endgroup$
    – Doug M
    Feb 3, 2017 at 5:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .