Convert an anchor in a right angle?

Hello

I would like to choose an anchor point and adjust it so that it creates a perfect right angle. How can I do?

Imagine some closed, filled with shape, composed a dozen anchor points. I would choose one of these anchor points (a corner anchor point, not a point of inflection) and adjust it (built-in? script?) while it creates a perfect right angle (90 deg.). This essentially means moving it to just the right place so that the lines connecting its two neighbouring anchor points form a right angle.

Hope that the description is clear.

Please, do not assume that the right angle that results would be necessarily oriented along an axis North-South, or any other rational compass statement.

Thanks a lot for any help or pointers...

Ariel

So here's the script I wrote. Looks like it works pretty well, but I did not too widely tested yet.

// BS"D
// Create Right Angle
// An Illustrator CS5 Script (may work in other versions too)
// Copyright (c) 2014 by Ariel (www.freelancebookdesign.com)
// This script may be used freely provided these opening comments are not removed.
// This script will adjust a point on a path (open or closed) so that it forms a 90 degree angle with its two adjacent points.
// See http://forums.adobe.com/thread/1385409?tstart=60 for more details.
// To use, select an anchor point on a path. The path must contain at least 3 anchor points.
 // The selected point should not be an end point if the path is open.
 // Run the script. The selected point will be moved the smalled distance possible such that it forms a
 // right angle with its neighbouring points.

try{
    if (app.activeDocument.selection.length == 0){
        throw("Please select an anchor point and try again.");
    }
    var mySelection = app.activeDocument.selection[0];
    if (mySelection.constructor.name != "PathItem"){
        throw ("Please select an anchor point and try again.");
    }
    var myPoints = mySelection.pathPoints;
    if (myPoints.length < 3){
        throw ("The script can only work if there are at least 3 anchor points on the path.");
    }
    var foundSelected = false;
    for (var i = 0; i < myPoints.length; i++){
        var myPoint = myPoints[i];
        if (myPoint.selected == PathPointSelection.ANCHORPOINT){
            foundSelected = true;
            break;
        }
    }
    if (foundSelected == false){
        throw ("Please select one of the anchor points.");
    }
    if (!mySelection.closed && myPoint == myPoints[myPoints.length-1]){
        throw ("The last anchor point was selected. Please select an anchor point between two others.");
    }
    if (!mySelection.closed && myPoint == myPoints[0]){
        throw("Please select an anchor point between two others.");
    }
    var prevIndex = i-1;
    var nextIndex = (i+1) % myPoints.length;
    if (mySelection.closed && prevIndex < 0){
        prevIndex = myPoints.length-1;
    }
    var adjustedPoint = adjustPoint(myPoints[prevIndex], myPoint, myPoints[nextIndex]);
    myPoint.anchor = [adjustedPoint.x, adjustedPoint.y];
    myPoint.rightDirection = [adjustedPoint.x, adjustedPoint.y];
    myPoint.leftDirection = [adjustedPoint.x, adjustedPoint.y];
}
catch(e){
    alert(e);
}
function adjustPoint(pointA, pointB, pointC){
    // A and C are static. B will be adjusted.
    var Ax = pointA.anchor[0];
    var Ay = pointA.anchor[1];
    var Bx = pointB.anchor[0];
    var By = pointB.anchor[1];
    var Cx = pointC.anchor[0];
    var Cy = pointC.anchor[1];
    // Find new point M that is midway between A and C
    var Mx = 0.5 * (Cx + Ax);
    var My = 0.5 * (Cy + Ay);
    // r = radius of circle whose diameter is AC
    var r = (Math.sqrt((Cx - Ax)*(Cx - Ax) + (Cy - Ay)*(Cy - Ay)))/2;
    // s = the distance between M and B
    var s = Math.sqrt((Bx - Mx)*(Bx - Mx) + (By - My)*(By - My));
    if (s == 0) {
        alert("The script must now disappear in a puff of infinity.");
        // pointB does not need to be moved;
        return {x: Bx, y: By};
    }
    // f is the ration between r and s
    var f = r/s;
    // D is the new point we're looking for
    var Dx = Mx + (Bx - Mx) * f;
    var Dy = My + (By - My) * f;
    return {x: Dx, y: Dy};
}

Tags: Illustrator

Similar Questions

  • How to print a triangle with a right angle with asterisk in labview?

    Hello friends I am a newbe 2 labview so my question is what is the code to print right angle triangle

    as *.

    ****

    ***

    **

    *

    Ray.R wrote:

    There are several ways to do this, the simple constant impression of a string that contains the stars, in a table containing the same to a decreasing number of Asterix in a loop For... Well the list could go on...

    Ideas are still endless, it seems...

  • Power connector at right angle for laptop HP 2230 s?

    Is it possible to get an adapter at right angles to the power connector DC for my laptop HP 2230 s?

    The connector on the DC power cable that goes into the laptop out the path to the side (a good 2.5 "), which, besides being bulky, resembles an accident waiting to happen. On my old Fujitsu, the connector was barely right angle type, it came out at all, and was not a danger to catch on anything and damage the socket or the plug. This type of connector puts also much less strain on the DC input jack, as he does not act as a lever for bit.

    I've seen at right angles to the adapters for different types of cable (you plug your cable on one end and the other goes in the computer), like this:

    I hope you get the idea. In any case, what I would like is an adapter for the type of connector used on my HP laptop. The type of connector seems to be pretty standard in the range, so an adapter can be used with many models of HP. In the end, I hope that HP will change cables from their power supplies for laptop to come with these types of connectors at the ends, but in the meantime, is possible to get an appropriate, either through HP or a third party adapter?

    Thanks in advance to anyone who can offer suggestions!

    http://www.bixnet.com/cntlc90.html

    I know this is an old thread... but since nobody listed everything that might work, I found this on the same site listed zetto.

  • (Redirected) New Inspiron 5558, right Angle DC Power adapter

    I was looking for an adapter at right angles to the DC power jack.  The diameter of the plug is 4.5 mm (0,178 inches in diameter).  The existing plug is straight and the cord Gets a lot of stress at that time here because the female connector is located on the side of the laptop rather than the back.  A right angle adapter will relieve this stress.  There are several right angle adapters, but I couldn't find the right necessary size, which is much smaller on this laptop.

    Hi Pete Colorado,.

    Please repost this in the laptop computer Forum help.

    http://en.community.Dell.com/support-forums/laptop/f/3518

  • Pallets, anchored on the right always open in minimized state

    I have a custom workspace (similar to the basics) with my common palettes clustered and anchored to the right. They were always open and ready to go since I used this kind of configuration since the beginning of CS. But since the upgrade to 9.1, now palettes always open in a reduced state. Reduced to a minimum. And before you start, I need to double click on each of them and open them individually. A total pain in the Bar of the Astor. What's the story? And the same thing happens if I switch to Essentials BTW. Except the Pages palette is not at least.

    Try to remove temporarily the woodwing plugins both suitcase.

  • How to convert all anchors in Illustrator for the corners?

    How can I convert all anchors in Illustrator for the corners? 'Convert anchor points selected on the corner' does not work or I couldn't use it properly.

    I use the direct Selection tool in the half of the points of the object and click 'CSAPC' - and it does nothing.

    is one knows how to do this?

    To run the script, see here:

    http://help.Adobe.com/en_US/Illustrator/CS/using/WS714a382cdf7d304e7e07d0100196cbc5f-62a3a .html

    The scripts folder is in the folder presets, located in the program folder.

  • Convert dvr - ms with a right-click format .wtv doesn't exist despite what instructions help Windows say. ___

    Windows 7 help and support says to "convert recorded TV (.wtv) file to an older format go the folder where your recorded TV files are stored (usually C:\Users\Public), right click on the file you want to convert and then click on convert to .dvr-ms Format.»

    When I right-click on these files there is no option to "Convert to .dvr-ms Format." is there a way to do this, or a parameter in the folder to allow this?

    I don't know why your computer does not have this option.  If your computer has the conversion program: C:\windows\ehome\wtvconverter.exe.  If this is the case, you can run it from a command prompt window (Start >all programs > Accessories > prompt ) by entering these commands:

    CD /d c:\windows\ehome
    wtvconverter
    sourcefile targetfile /ShowUI

    where:

    sourceFile = full path of the .wtv file you want to convert
    TargetFile = full path of the .dvr-ms file that you want to create
          /ShowUI (as an option).  If so, show the progress of the conversion in a separate window

    For example:

    CD /d c:\windows\ehome
    wtvconverter
    "C:\users\public\public tv\TV Show.dvr - ms recorded" /ShowUI 'C:\users\public\public tv\TV Show.wtv recording'  

    To convert a whole folder of .wtv files .drv-ms format, use this command:

    wtvconverter sourcefolder\*.wtv/ShowUI

    For example:

    wtvconverter "C:\users\public\public recorded tv\ * .wtv ' /ShowUI

  • upgrade to Firefox 4 usual locker in het right angle down does not appeap when I open a secure page. Why not?

    When for example I wanted to open my bank account in private via a secure internet page it appeared always a padlock at the bottom of the page to the right. Since today upgrading to Firefox 4 het appears not more. Is it normal with Firefox 4 or is this a problem?

    The lock has been replaced by the site identity button, for details on use, see https://support.mozilla.com/kb/Site+Identity+Button

  • BlackBerry smartphones, which is the small blue arrow at the bottom right angle screen on the Bold 9900

    https://picasaweb.Google.com/LH/photo/KZuuMx5VxBoaJ9iBtoSgTg?feat=DirectLink

    In the attached screen you can see the arrow which I mention in the lower corner on the right.

    It appears in a tab or folder to the home screen.   It is also visible in the following applications.

    E-mail (account both BES and BIS)

    Facebook

    BBM

    Social RSS

    Google Talk

    Text messages

    Address book

    Task list

    It is not visible in the following applications

    Browser

    Calendar

    Wikitude

    Clock radio

    BlackBerry App World

    Twitter

    Google Maps

    In some applications such as Word Press, it is visible on the launch screen but does not appear after that.

    It's on my phone (Rogers Wireless) and my friends (Telus) phone is not a specific business problem.

    Anyone know what it is?

    Phone Version information

    BlackBerry Bold 9900

    V7.0.0.261

    Which would indicate that there is more material below, which you can scroll.

  • How an anchor to use right on the path and not on the point tool? I have

    I'm using version CS 5. I tried, but gives me an error. Is it available on a newer version?

    kisanbhat,

    There are three tools of anchor Point.

    Add the anchor Point should work (only) on the path between the existing Anchor Points. Removal of Point of anchorage and Point Director conversion should work (only) on exoisting Anchor Points.

    Otherwise, something is really wrong.

    The following is a general list of things you can try when the question is not in a specific file (you tried/made some of them already). 1 and 2) are easier for temporary strangenesses and 3) and 4) specifically preferences might be corrupt); ((5) is a list in itself and 6) is the last resort.

    (1) close Illy and open again.

    (2) restart the computer (you can do that up to 3 times);

    (3) close Illy and press Ctrl + Alt + Shift / Cmd + Option + shift during startup (easy, but irreversible);

    4) move the folder (follow the link with this name) with closed Illy (more tedious but also more thorough and reversible);

    5 look through and try the relevant among the other options (click on the link with that name, item 7) is a list of the usual suspects among other applications which can disturb and confuse Illy, point 15) applies to the maybe CS5, CS6 and CC);

    Even worse, you can:

    (6) uninstall, run the vacuum cleaner tool (if you have CS3/CS4/CS5/CS6/CC), and then reinstall.

    http://www.Adobe.com/support/contact/cscleanertool.html

  • Convert the anchor point tool problem

    I'm new to illustrator... when I want to move the tangents that regardless it only works with the first I catch, another disappears and reappears while I hold one... bug?

    Tacojka,

    What happens if you:

    1) select directly the anchor.

    (2) alt/OptionDrag one of the handles.

    (3) drag handles?

  • I have all of a sudden all these words highlighted with small green circles and arrows at the top right, angle, and when I hover over them a window opens with coupon

    It's really annoying because I need to work and it just get in the way. They are like spam links. How can I prevent these.
    Thank you
    David

    Sounds like Malware, see this:
    https://support.Mozilla.org/en-us/KB/troubleshoot-Firefox-issues-caused-malware

  • screen appearance is at a right angle

    Can someone tell me how to get the screen back to normal appearance, it is 0900 instead of 1200.  Thank you!!

    This is control, Alt and the up arrow if it happens to everyone.

  • Stupid question - rectangles with right right angle corners

    Don't know what I did, but currently using FW CS5, when I draw a rectangle, the corners are slightly rounded.

    There is no round applied.

    I thought I changed the hard edge of anti-aliasing, but is no more.

    If anyone can remember how to give my rectangles perfectly curved corners again that would be very appreciated!

    Thank you.

    You might see roundness because there's a stroke applied - round features that are larger in diameter that 1px will appear from the corners rounded on. Check the properties panel, if there is a contour color applied and delete if it is there. Hope that helps!

    Aaron Beall

    http://Fireworks.abeall.com

  • Angle right cord adapter for Xoom

    I know this has been discussed before, but I can't.  Does anyone has an adapter found good right angle for power cord?  This would make the Pivot Pad a real winner.

    Lew

    @lewwill,

    I'm working on tests a couple square options, but I don't have them yet. I have found at right angle adapters HDMI and USB Host (OTG), see my other son for those.

    -Doc

Maybe you are looking for

  • When you add a freeze frame, where it is saved to?

    Successfully, I right click on 'Add Freeze Frame' in order to capture a still of my movie, but now I can't find the frozen real framework. Where it is saved to?  Thank you.

  • Satellite Pro L20: Wireless connection is not reliable

    Hello We have some Toshiba laptops in the office. However, the wireless on our most recent purchase (Satellite Pro L20) installation is very reliable. Periodically he loses sight of the network without apparent reason. We have the device permanently

  • New Xbox - profile Email

    New Xbox today and my son cannot access his profile to play online. Request by e-mail, then password when he tries. I remember only an email and password I used to put in place years ago. When I go to the xbox live web, it allows me to connect, but t

  • Pilot of the T61 wireless adapter

    My T61 adapater is the Intel Pro/Wireless 3945ABG. the driver is Version 11.1.1.11 [probably the same driver as the day I bought it]. I recently received a message from ThinkVantage saying that it could not connect to a wireless network and I might "

  • multicolored lines running through the screen of my computer Vista laptop window up and down

    multicolored lines on the screen of my laptop window Vista from the top to down manufacturing blurr photos and texts. seem as if a screen is placed on the desktop.