[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 405
  • Last Modified:

Drawing a Quad Polygon strating from a 3d Line entity.

I need to draw a Quad shape starting from a Line expressed in 3d points structure data (x,y,z).
I need to find the normals of the line ( with an angle of 90.0 degrees), and intersect them with a given height. In this way i could find the other 2 vertices and able to draw the quad. I will use this procedure to find the trajectory of a circular Blade, cutting a solid.

Is there some experts that could help me?
0
Filae
Asked:
Filae
1 Solution
 
FilaeAuthor Commented:
Ive resolved the proble on my own, sorry for the inconvenience:

I proceed in this way:

I find the Alfa angle:

Alfa = atan(y2-y1/x2-x1)

Then i find the other two vertices of the quad.

x3 = x1 - r sin Alfa
y3 = y1 + r cos Alfa
x4 = x2 - r sin Alfa
y4 = y2 + r cos Alfa

r = radius of circular blade.
0
 
_corey_Commented:
Are you trying to create a quad in a circle?

corey
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
FilaeAuthor Commented:
No, im building several circles rapresenting a blade track, with several polys that interpolate the circles. If there was a space for images on this site, i would be able to clarify me better.. sorry...
0
 
NovaDenizenCommented:
You can do this without any trig, and without the risk of division-by-zero (if we can assume that x1 != x2 or y1 != y2).

dx = x2 - x1
dy = y2 - y1
scale = sqrt(dx*dx + dy*dy)/r
xoff = -scale*dy;
yoff = scale*dx;
x3 = x1 + xoff;
y3 = y1 + yoff;
x4 = x2 + xoff;
y4 = y2 + yoff;
0
 
NovaDenizenCommented:
With points refunded?  Several people answered his question.
0
 
VenabiliCommented:
I will guess you had simply missed this from the Asker
"Ive resolved the proble on my own, sorry for the inconvenience:" and posting a solution right after this...two months before your answer. :)

It is a self answered question.

Venabili
0
 
moduloCommented:
PAQed with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now