Abstract:
A method and apparatus for shaping a linear segment is disclosed. The method comprises the steps of selecting a dynamic bend point, determining a primary snap point based on the location of the dynamic bend point in one of four predetermined regions and snapping the dynamic bend point to the primary snap point. A secondary snap point is also determined and the dynamic bend point is snapped either to the primary snap point or to the secondary snap point, depending on the location of the dynamic bend point inside or outside a predetermined secondary snap region.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    The present invention relates to a CAD (Computer Aided Design) method and apparatus for drawing images, and in particular to a CAD tool for shaping a linear segment. 
         [0003]    2. Description of the Related Art 
         [0004]    CAD software allows preparation and editing of machine drawings, schematics, artwork and other images. Typically, a CAD user creates these drawings by way of use of a library of objects and a number of drawing tools that allow to create, manipulate and shape the objects. 
         [0005]    CAD is frequently used for designing wiring patterns of a printed circuit board and other types of electronic and electrical design that requires connecting various sets of terminals for components located in different parts of the drawing with wires. CAD is also often used to create system diagrams and assembly drawings showing connections between different types of equipment using electrical cables. Wires and cables are typically represented in CAD-drawn schematics as linear segments running from one graphic representation of a component terminal to the next. It is typically desirable to bend these linear segments at right angles in order to clear various graphic representations of components and other wires. Conventionally, grid within the CAD system can be used to draw linear segments at right angles. Additionally, keyboard entry of the length and angle of a segment is used to draw segments of desired length and at desired angles. 
         [0006]    Alternatively, an existing linear segment can be shaped to have right angles by way of snapping portions of the linear segment to grid, thereby forming right angles. Another way of drawing segments at right angles is to use a constrain angle on a segment. Typically, one side of a segment is constrained to be at a desired angle and the other side is a free moving linear segment. This method allows only one side of the segment to be properly aligned. 
         [0007]    These conventional methods are slow and cumbersome to use. What is needed is a tool that allows shaping linear segments quickly and without the grid. The present invention satisfies this need. 
       SUMMARY OF THE INVENTION 
       [0008]    The method of the present invention comprises the steps of selecting a dynamic bend point, determining a primary snap point based on the location of the dynamic bend point in one of four predetermined regions and snapping the dynamic bend point to the primary snap point, thereby forming two new linear segments at the right angle at the desired location. In one embodiment, a secondary snap point is determined and the dynamic bend point is snapped either to the primary snap point or to the secondary snap point, depending on the location of the dynamic bend point inside or outside a predetermined secondary snap region. Provisions are made to display reference lines showing the direction of the snap for the dynamic bend point. 
         [0009]    The apparatus comprises a means for selecting a dynamic bend point, means for determining a primary snap point based on the location of the dynamic bend point in one of four predetermined regions and means for snapping the dynamic bend point to the primary snap point, thereby forming two new linear segments at the right angle at the desired location. In one embodiment, means for determining a secondary snap point and means for snapping the dynamic bend point either to the primary snap point or to the secondary snap point, depending on the location of the dynamic bend point inside or outside a predetermined secondary snap region are provided. Also provided is means for displaying reference lines showing the direction of the snap for the dynamic bend point. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0010]    Referring now to the drawings in which the same reference numbers and letters represent the same elements in all drawings. 
           [0011]      FIG. 1  is a diagram showing selecting a dynamic bend point on a linear segment and moving the dynamic bend point. 
           [0012]      FIGS. 2-5  are diagrams showing the operation of one embodiment of this invention where the dynamic bend lo point is located, respectively, in a first, second, third and fourth regions. 
           [0013]      FIGS. 6 ,  7  are diagrams showing the operation of another embodiment of this invention where the dynamic bend point is located either inside or outside a secondary snap region. 
           [0014]      FIG. 8  is a diagram showing a displaying reference line for indicating the direction of the snap. 
           [0015]      FIGS. 9 ,  10  are flow charts presenting illustrative examples of the steps used to implement the method of this invention. 
       
    
    
     DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS 
       [0016]    The drawings, which are part hereof, show, by way of illustration, several embodiments of this invention. It is understood that other embodiments may be utilized and structural changes may be made without departing from the scope of this invention. 
         [0017]    Viewing now  FIG. 1 , numeral  10  indicates an existing linear segment. Existing linear segment  10  comprises two end points indicated by letters A and B. Numeral  20  indicates a cursor. Cursor  20  is shown in  FIG. 1  as an arrow. However, as the persons most knowledgeable in the pertinent arts will recognize, there are a number of ways that a cursor may be presented. Cursor  20  moves with movement of a pointing device, typically a computer mouse, and is used for selecting objects, typically by depressing a button on a computer mouse, known to the persons most knowledgeable in the pertinent arts as “clicking on an object”. 
         [0018]    Letters DBP indicate a dynamic bend point. Dynamic bend point DBP is selected anywhere on existing linear segment  10  between endpoints A and B. Depending on how the computer mouse or other pointing device is configured, selecting dynamic bend point DBP is typically accomplished by, for example, double clicking on existing linear segment  10 . For the purposes of this discussion “selecting” also means “creating”, such that dynamic bend point DBP is not present on existing linear segment  10  before it is selected by said double clicking. 
         [0019]    Once selected, dynamic bend point DBP can be moved around by moving cursor  20 . Once again, depending on how the computer mouse or other pointing device is configured, moving dynamic bend point DBP is typically accomplished by, for example, positioning cursor  20  over dynamic bend point DBP, depressing the mouse button and moving the mouse while maintaining the button on the computer mouse depressed. 
         [0020]    Releasing dynamic bend point DBP is accomplished by releasing the button on the computer mouse. 
         [0021]    End points A and B and dynamic bend point DBP define two new linear segments indicated by numerals  10   a  and  10   b.    
         [0022]    As shown in  FIG. 1 , moving cursor  20  while depressing the button on the computer mouse moves dynamic bend point DBP. Four positions of cursor  20  and corresponding positions of dynamic bend point DBP are shown in  FIG. 1  for illustration. The path of cursor  20  is shown in dashed line. 
         [0023]    As dynamic bend point DBP moves, two new linear segments  10   a  and  10   b  are being continuously reshaped as would rubber bands attached to endpoints A and B and to dynamic bend point DBP. 
         [0024]    Viewing now, simultaneously,  FIG. 2  and  FIG. 9 , letters RP indicate a reference point. Reference point RP is determined continuously while moving dynamic bend point DBP that is the end point nearest to dynamic bend point DBP. Viewing the top portion of  FIG. 2 , dynamic bend point DBP is nearest to endpoint A. Therefore, reference point RP is computed to be located at endpoint A. 
         [0025]    Extending from reference point RP are 0, 45, 90, 135, 180, 225, 270 and 315 radials. A first region is defined between 315 and 45 radials, a second region is defined between 45 and 135 radials, a third region is defined between 135 and 225 radials and a fourth region is defined between 225 and 315 radials. 
         [0026]    Location of dynamic bend point DBP in one of the four regions is computed. In  FIG. 2 , dynamic bend point DBP is located in the first region. First region in  FIG. 2  is shaded in order to illustrate the location of dynamic bend point DBP in the first region. Said shading of a region where dynamic bend point DBP is located in  FIG. 2  and all other figures is utilized to assist in understanding this disclosure. The shading itself, however, is not part of this invention. 
         [0027]    Letters PSP indicate a primary snap point. Primary snap point PSP, when dynamic bend point DBP is located in the first region, is computed as a 90 degree projection from dynamic bend point DBP on the 0 radial. Said projection is shown in  FIG. 2  as a dashed line. 
         [0028]    Viewing the bottom portion of  FIG. 2 , when dynamic bend point DBP is released, it snaps to primary snap point PSP. 
         [0029]    Viewing now, simultaneously,  FIG. 3  and  FIG. 9 , as shown in the top portion of  FIG. 3 , dynamic bend point DBP is nearest to endpoint A. Therefore, reference point RP is computed to be located at endpoint A. 
         [0030]    Location of dynamic bend point DBP in one of the four regions is computed. In  FIG. 3 , dynamic bend point DBP is located in the second region. 
         [0031]    Primary snap point PSP, when dynamic bend point DBP is located in the second region, is computed as a 90 degree projection from dynamic bend point DBP on the 90 radial. Said projection is shown in  FIG. 3  as a dashed line. 
         [0032]    Viewing the bottom portion of  FIG. 3 , when dynamic bend point DBP is released, it snaps to primary snap point PSP. 
         [0033]    Viewing now, simultaneously,  FIG. 4  and  FIG. 9 , as shown in the top portion of  FIG. 4 , dynamic bend point DBP is nearest to endpoint A. Therefore, reference point RP is computed to be located at endpoint A. 
         [0034]    Location of dynamic bend point DBP in one of the four regions is computed. In  FIG. 4 , dynamic bend point DBP is located in the third region. 
         [0035]    Primary snap point PSP, when dynamic bend point DBP is located in the third region, is computed as a 90 degree projection from dynamic bend point DBP on the 180 radial. Said projection is shown in  FIG. 4  as a dashed line. 
         [0036]    Viewing the bottom portion of  FIG. 4 , when dynamic bend point DBP is released, it snaps to primary snap point PSP. 
         [0037]    Viewing now, simultaneously,  FIG. 5  and  FIG. 9 , as shown in the top portion of  FIG. 5 , dynamic bend point DBP is nearest to endpoint A. Therefore, reference point RP is computed to be located at endpoint A. 
         [0038]    Location of dynamic bend point DBP in one of the four regions is computed. In  FIG. 5 , dynamic bend point DBP is located in the fourth region. 
         [0039]    Primary snap point PSP, when dynamic bend point DBP is located in the fourth region, is computed as a 90 degree projection from dynamic bend point DBP on the 270 radial. Said projection is shown in  FIG. 5  as a dashed line. 
         [0040]    Viewing the bottom portion of  FIG. 5 , when dynamic bend point DBP is released, it snaps to primary snap point PSP. 
         [0041]    Viewing now, simultaneously,  FIG. 6  and  FIG. 10 , letters SSP indicate a secondary snap point. Secondary snap point SSP is computed as a corner of an imaginary rectangle having diagonal corners in end points A and B. The sides of said imaginary rectangle are indicated by numeral  30 . 
         [0042]    Extending from secondary snap point SSP are radials X and Y. Radials X and Y extend from secondary snap point SSP at pre-settable angles that may be adjusted at user&#39;s preference. Radials X and Y define a secondary snap region. 
         [0043]    Location of dynamic bend point DBP either inside or outside the secondary snap region is computed. In the top portion of  FIG. 6 , dynamic bend point DBP is shown inside the secondary snap region. When dynamic bend point DBP is located inside the secondary snap region, dynamic bend point DBP snaps to secondary snap point SSP, as shown by the dashed line in the top portion of  FIG. 6 . 
         [0044]    Viewing the bottom portion of  FIG. 6 , when dynamic bend point DBP is released, it snaps to secondary snap point SSP. 
         [0045]    Viewing now, simultaneously,  FIG. 7  and  FIG. 10 , Location of dynamic bend point DBP either inside or outside the secondary snap region is computed. In the top portion of  FIG. 7 , dynamic bend point DBP is shown outside the secondary snap region. When dynamic bend point DBP is located outside the secondary snap region, dynamic bend point DBP snaps according to its location in the first, second, third or fourth regions. 
         [0046]    In the top portion of  FIG. 7 , dynamic bend point DBP is shown inside the third region. Primary snap point PSP, when dynamic bend point DBP is located in the third region, is computed as a 90 degree projection from dynamic bend point DBP on the 180 radial. Said projection is shown in  FIG. 7  as a dashed line. 
         [0047]    Viewing the bottom portion of  FIG. 7 , when dynamic bend point DBP is released, it snaps to primary snap point PSP. 
         [0048]    Viewing now simultaneously  FIG. 8  and  FIG. 9 , top portion of  FIG. 8  shows the embodiment where dynamic bend point DBP snaps to primary snap point PSP. Numeral  40  indicates a first reference line. First reference line  40  extends from dynamic bend point DBP towards primary snap point PSP and helps the user to visualize where dynamic bend point DBP will snap. 
         [0049]    Bottom portion of  FIG. 8  shows the embodiment where dynamic bend point DBP snaps to secondary snap point SSP. Numeral  50  indicates a second reference line. Second reference line  50  extends from dynamic bend point DBP towards secondary snap point SSP and helps the user to visualize where dynamic bend point DBP will snap. 
         [0050]    Displaying either first reference line  40  or second reference line  50  can be enabled or disabled as a lo user&#39;s preference. First reference line  40  and second reference line  50  are typically presented in magenta color as rubber-banded lines. 
         [0051]    Existing linear segment  10  is shown in  FIG. 8  comprising a plurality of linear segments extending from end points A and B, indicated by numerals  10   c,    
         10   d  and  10   e.  Presence or absence of such additional linear segments at either endpoint A or B does not affect the steps of the method in this invention. 
       [0052]    While the present invention has been described and defined by reference to the preferred embodiment of the invention, such reference does not imply a limitation on the invention, and no such limitation is to be inferred. The invention is capable of considerable modification, alteration, and equivalents in form and function, as will occur to those ordinarily skilled and knowledgeable in the pertinent arts. The depicted and described preferred embodiments of the invention are exemplary only, and are not exhaustive of the scope of the invention. Consequently, the invention is intended to be limited only by the spirit and scope of the appended claims, giving full cognizance to equivalents in all respects.