Finding the vertices of an object with angles (polygon)

103 Views Asked by At

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!

1

There are 1 best solutions below

2
On

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)$