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

Posted on 2005-04-26
Last Modified: 2013-12-06
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?
Question by:Filae
    LVL 3

    Expert Comment


    Author Comment

    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.
    LVL 8

    Expert Comment

    Are you trying to create a quad in a circle?


    Author Comment

    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...
    LVL 22

    Expert Comment

    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;
    LVL 22

    Expert Comment

    With points refunded?  Several people answered his question.
    LVL 20

    Expert Comment

    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.


    Accepted Solution

    PAQed with points refunded (125)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
    Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now