Metlivi Blog

How to Extend Two Straight Edges to a Precise Corner Without Changing the Shape’s Dimensions

To make two straight edges meet precisely, extend each edge along its existing direction to their common intersection. Move only the endpoints beside the gap, keeping the remaining outline fixed. This preserves the intended dimensions when that intersection lies within the shape’s existing width and height.

For a character or virtual-toy outline, this is a local geometry edit in an external drawing tool. The walkthrough below explains how to establish the correct corner, make the edit in QCAD or Inkscape, and check the result. One condition matters: extending an edge necessarily changes its segment length. Preserving overall dimensions means keeping the intended width, height and reference positions—not keeping every unfinished segment the same length.

October 29, 20267 min readBy Metlivi Editorial Team
Section 1

What must stay fixed to preserve the shape’s dimensions?

Before editing, distinguish three measurements: the overall width and height, the positions and directions of the existing sides, and the lengths of the individual segments. Closing an unfinished corner can preserve the first two while changing the third.

Imagine two incomplete sides of a character’s rectangular body. The top edge already establishes the top boundary, and the right edge already establishes the right boundary. Extending them to meet adds the missing corner without moving either boundary. However, if two sloping edges meet above the current highest point, completing that corner increases the outline’s height. No endpoint operation can both reach that intersection and preserve the smaller height.

Record the intended width and height, the two endpoints away from the gap, and any alignment point used to position the character. Keep a copy of the original outline for comparison. These references let you distinguish a correct corner repair from an accidental resize.

Section 2

How do you locate the exact corner?

Treat each straight segment as part of an infinitely long line. For two nonparallel lines in the same drawing plane, their intersection determines the corner. A midpoint between the unfinished endpoints generally does not lie on either line, so moving both endpoints there can change both edge directions.

For horizontal and vertical edges, the calculation is especially simple: take the x-coordinate from the vertical edge and the y-coordinate from the horizontal edge. Their combination gives the intersection. For sloping edges, use an intersection-aware editing command or calculate the crossing before changing the endpoints.

The following worked example uses illustrative drawing units. It represents an unfinished rectangular character body whose other edges already establish an overall width of 80 units and height of 60 units.

Element Before the edit After the edit
Top edge (0, 60) to (72, 60) (0, 60) to (80, 60)
Right edge (80, 0) to (80, 52) (80, 0) to (80, 60)
Shared corner Missing (80, 60)
Overall geometric width × height 80 × 60 80 × 60

The top edge lies on y = 60, and the right edge lies on x = 80. Their intersection is therefore (80, 60). Each unfinished segment gains 8 units, while the outline’s overall width and height remain unchanged. This coordinate check is useful even when an automatic tool performs the edit: it gives you an independently determined result to compare against.

Section 3

How do you extend both edges automatically in QCAD?

For an outline made from two separate line entities, QCAD provides Trim Both. Despite its name, the command can extend two lines to their common intersection as well as shorten them. The current manual lists it under Modify → Trim and Divide → Trim Both, with the sequential shortcut T, M and command names including trim2 and extend2. QCAD Manual: Trim Both

  1. Open the editable outline and locate the two straight line entities beside the missing corner.
  2. Confirm that these are the intended edges and that their projected intersection matches the required outline.
  3. Start Trim Both.
  4. Click the first edge, then the second edge.
  5. Press Escape twice to finish the command.
  6. Compare the resulting corner with the expected coordinates and the saved dimensions.

The tool’s documented operation is to bring both selected entities to their shared intersection. In the example above, the two near-gap endpoints should finish at (80, 60). QCAD’s modification tutorial also explains selecting the portions you want to retain when trimming; if your edges already cross, click those retained portions carefully. QCAD Manual: Trim Both, QCAD Tutorial: 1.9 Modification

Do not substitute an arbitrary length increase unless you have already calculated the distance. QCAD documents lengthening by a specified amount as a separate operation. For this task, an intersection-based operation directly expresses the desired endpoint. QCAD Tutorial: 1.9 Modification

Section 4

How do you place the corner precisely in Inkscape?

If the character outline is already an editable path in Inkscape, work on its nodes. The Node tool selects and repositions individual nodes; dragging a segment itself can change its curvature, so select the endpoint deliberately. Editing Paths with the Node Tool

For the worked example, activate the Node tool with N, select only the top edge’s endpoint at (72, 60), and set its coordinates to X = 80 and Y = 60. Then select only the right edge’s endpoint at (80, 52) and give it the same coordinates. Inkscape’s Node tool includes numeric x- and y-coordinate fields and a unit selector. Use the same units throughout. Node Tool Options

These coordinate changes preserve the example’s edge directions: the top endpoint moves horizontally along y = 60, and the right endpoint moves vertically along x = 80. For sloping edges, enter their calculated intersection instead. Keep the opposite endpoints fixed, and confirm that each edited segment still follows its original straight line.

If the two endpoints belong to one open outline and must become a connected corner, select those coincident end nodes and use Join (merge) nodes. Inkscape documents this separately from Join end nodes with a new segment, which creates a connecting segment. Establish the correct corner position before joining. Node Tool Options

Section 5

Why can joining the unfinished endpoints produce the wrong shape?

Joining endpoints answers a connectivity question: how should these path pieces connect? Extending edges answers a geometric question: where do their existing directions meet? Solve the geometric question first.

In the example, a straight connector from (72, 60) to (80, 52) would create a diagonal across the missing corner. It would retain the overall 80-by-60 bounds, yet produce a bevel instead of the intended corner at (80, 60). Correct dimensions alone therefore do not prove that the outline is correct.

Likewise, two endpoints sharing coordinates are not sufficient evidence that a path has been closed. The Inkscape guide distinguishes open paths, which have end nodes, from closed paths, whose ends are connected. Inspect the path’s connectivity if you need a single continuous character silhouette. Editing Paths with the Node Tool

Section 6

What should you check when the result looks wrong?

Use this diagnostic sequence before moving more points. It separates an unsuitable intersection from an incorrect selection or an unfinished connection.

Symptom Check Next action
The corner lies far from the character Are the edges almost parallel? Recheck whether they are the intended pair before extending.
No unique corner exists Are the lines parallel or on the same infinite line? Reconsider the intended outline; extension alone cannot select a unique corner.
The character becomes wider or taller Does the intersection fall outside the original bounds? Decide whether the intersection or the original dimensions define the design.
An edge changes direction Did its opposite endpoint move, or was the target off its original line? Restore the reference point and use the correct intersection.
A diagonal appears across the gap Were the unfinished endpoints connected directly? Undo the connector and extend both edges to the intersection first.
The corner appears connected but remains open Are there separate endpoints at the same coordinates? Inspect connectivity and join the intended end nodes.

For nearly parallel lines, small differences in direction can place the intersection a long distance away. A surprising result is a reason to inspect the original edge directions before accepting the edit. For exactly parallel distinct lines, there is no intersection; for coincident lines, there is no single uniquely determined corner.

Section 7

How do you verify the finished character outline?

Check the geometry numerically, then inspect the silhouette. For the worked example, both edited endpoints should be (80, 60), the opposite endpoints should remain (0, 60) and (80, 0), and the complete outline should still span 80 by 60 drawing units.

Compare the edited outline with the saved copy. Away from the repaired corner, the existing edges should occupy the same positions. At the corner, look for a remaining gap, an extra diagonal, an overshoot or an unintended curve. If you need one continuous outline, check its connection separately from its appearance.

A precise corner repair has a clear result: the two edges reach their true intersection, their original directions and distant endpoints remain fixed, and the dimensions you chose to preserve still match. Establish those conditions before editing, and the final checks become straightforward.

Section 8

Sources

Related reading

Keep exploring this topic