Algorithm to clean/simplify net segment lines.
More...
#include <netsegmentsimplifier.h>
Algorithm to clean/simplify net segment lines.
Performed operations:
- Remove redundant junctions (same position, same layer)
- Remove redundant lines (same anchors, same layer), keeping the thickest
- Remove zero-length lines
- Remove useless junctions within straight line segments (join line segments into the same direction to a single line)
- Split lines to connect with junctions on the path between start and end points
- Split intersecting lines, placing a new junction to connect them (only orthogonal intersections for now)
◆ AnchorType
| Enumerator |
|---|
| Via | |
| Fixed | |
| Junction | |
◆ NetSegmentSimplifier() [1/2]
◆ NetSegmentSimplifier() [2/2]
Copy constructor.
- Parameters
-
◆ ~NetSegmentSimplifier()
◆ addAnchor()
Add a line anchor.
- Parameters
-
| type | Type of the anchor. |
| pos | Position. |
| start | Start (most upper) layer of the anchors or nullptr for schematic netsegment simplifications |
| end | End (most lower) layer of the anchors or nullptr for schematic netsegment simplifications |
- Returns
- The ID of the added anchors.
◆ addLine()
| int addLine |
( |
int |
p1, |
|
|
int |
p2, |
|
|
const Layer * |
layer, |
|
|
const Length & |
width |
|
) |
| |
|
noexcept |
Add a line between two anchors.
- Parameters
-
| p1 | ID of first anchors. |
| p2 | ID of second anchors. |
| layer | Layer of the line (nullptr for schematic netsegment simplification). |
| width | Line width. |
- Returns
- The ID of the added line.
◆ simplify()
Perform the simplification.
- Note
- This method also resets the state, so the object can be reused for the next net segment.
- Attention
- When lines are split, new anchor- and line IDs will be generated on the fly! So the returned lines may contain IDs which you didn't know yet from addAnchor() and addLine()!.
- Returns
- Any remaining lines after the simplification.
◆ operator=()
◆ getConnectedFixedAnchors()
| QSet< int > getConnectedFixedAnchors |
( |
| ) |
const |
|
privatenoexcept |
◆ addJunctionsAtLineIntersections()
| void addJunctionsAtLineIntersections |
( |
| ) |
|
|
privatenoexcept |
◆ splitLinesAtAnchors()
| void splitLinesAtAnchors |
( |
| ) |
|
|
privatenoexcept |
◆ removeDuplicateJunctions()
| void removeDuplicateJunctions |
( |
| ) |
|
|
privatenoexcept |
◆ removeRedundantLines()
| void removeRedundantLines |
( |
| ) |
|
|
privatenoexcept |
◆ mergeNextLines()
◆ findAnchor()
◆ isAnchorOnLayer()
| bool isAnchorOnLayer |
( |
const Anchor & |
anchor, |
|
|
const Layer * |
layer |
|
) |
| |
|
staticprivatenoexcept |
◆ isStraightLine()
| bool isStraightLine |
( |
const Point & |
p0, |
|
|
const Point & |
p1, |
|
|
const Point & |
p2 |
|
) |
| |
|
staticprivatenoexcept |
◆ mAnchors
◆ mLines
◆ mNextFreeLineId
◆ mAnchorMap
◆ mPinsOrPads
◆ mModified
The documentation for this class was generated from the following files: