65 std::vector<PCB_SHAPE*> shapes{ ref, free };
69 BOOST_CHECK_LE( slopeDiffY( free ), 100 );
94 std::vector<PCB_SHAPE*> shapes{ ref, free };
97 BOOST_CHECK_LE( slopeDiffY( free ), 100 );
116 std::vector<PCB_SHAPE*> modified;
123 BOOST_CHECK_LE( ( a->
GetEnd() - b->GetStart() ).EuclideanNorm(), 100 );
124 BOOST_CHECK_LE( ( a->
GetEnd() -
VECTOR2I( 12 *
MM, 3 *
MM ) ).EuclideanNorm(), 1000 );
127 BOOST_CHECK( std::find( modified.begin(), modified.end(), b ) != modified.end() );
128 BOOST_CHECK( std::find( modified.begin(), modified.end(), a ) == modified.end() );
141 std::vector<PCB_SHAPE*> shapes{ seg };
149 BOOST_CHECK( diag.
freeDof > 0 );
167 std::vector<PCB_SHAPE*> shapes{ seg };
179 bool attributed =
false;
185 if( c->m_Uuid ==
id )
190 BOOST_CHECK( attributed );
213 std::vector<PCB_SHAPE*> shapes{ ref, free };
219 bool solved = adapter.
Solve();
247 std::vector<PCB_SHAPE*> shapes{ ref, free };
250 BOOST_CHECK_LE(
std::abs( free->GetEnd().x - free->GetStart().x ), 100 );
272 std::vector<PCB_SHAPE*> shapes{ ref, free };
275 double freeLen = ( free->GetEnd() - free->GetStart() ).EuclideanNorm();
276 BOOST_CHECK_LE(
std::abs( freeLen - 10.0 *
MM ), 1000 );
296 std::vector<PCB_SHAPE*> shapes{ line, probe };
300 BOOST_CHECK_LE(
std::abs( probe->GetStart().y ), 100 );
312 circle->SetLocked(
true );
317 std::vector<PCB_SHAPE*> shapes{
circle, probe };
320 double distToCenter = ( probe->GetEnd() -
circle->GetCenter() ).EuclideanNorm();
322 BOOST_CHECK_LE(
std::abs( distToCenter - 5.0 *
MM ), 5000.0 );
341 std::vector<PCB_SHAPE*> shapes{ ellipse, probe };
365 std::vector<PCB_SHAPE*> shapes{ arc, probe };
381 circle->SetLocked(
true );
386 std::vector<PCB_SHAPE*> shapes{
circle, line };
393 BOOST_CHECK_LE(
std::abs( dist - 5.0 *
MM ), 5000.0 );
411 std::vector<PCB_SHAPE*> shapes{ fixed, free };
415 double centerDist = ( free->GetCenter() - fixed->
GetCenter() ).EuclideanNorm();
416 double radiusSum = 5.0 *
MM + free->GetRadius();
418 BOOST_CHECK_LE(
std::abs( centerDist - radiusSum ), 5000.0 );
419 BOOST_CHECK_GT( free->GetRadius(), 0 );
439 std::vector<PCB_SHAPE*> modified;
443 double centerDist = ( neighbor->GetCenter() - resized->
GetCenter() ).EuclideanNorm();
445 BOOST_CHECK_LE(
std::abs( centerDist - ( 7.0 *
MM + neighbor->GetRadius() ) ), 5000.0 );
448 BOOST_CHECK( std::find( modified.begin(), modified.end(), neighbor ) != modified.end() );
452 BOOST_CHECK_LE(
std::abs( centerDist - 10 *
MM ), 5000.0 );
465 locked->SetLocked(
true );
470 resized->SetRadius( 4 *
MM );
472 std::vector<PCB_SHAPE*> modified;
475 double centerDist = ( resized->GetCenter() -
locked->GetCenter() ).EuclideanNorm();
478 BOOST_CHECK_LE(
std::abs( centerDist - 9 *
MM ), 5000.0 );
501 BOOST_CHECK_LE(
std::abs( neighbor->GetRadius() - 8 *
MM ), 5000 );
524 BOOST_CHECK_LE(
std::abs( neighbor->GetRadius() - 8 *
MM ), 5000 );
533 locked->SetLocked(
true );
539 edited->
Move( { 5 *
MM, 0 } );
553 std::vector<VECTOR2I> pts = { { 0, 0 },
555 { 15 *
MM, 20 *
MM },
557 { -5 *
MM, 10 *
MM } };
565 std::vector<VECTOR2I> dragged = pts;
570 std::vector<PCB_SHAPE*> modified;
575 BOOST_CHECK_LE( ( outline.CPoint( 1 ) - dragged[1] ).EuclideanNorm(), 5000.0 );
576 BOOST_CHECK_LE( ( outline.CPoint( 2 ) - dragged[2] ).EuclideanNorm(), 5000.0 );
577 BOOST_CHECK_LE( ( seg->
GetStart() - dragged[1] ).EuclideanNorm(), 5000.0 );
578 BOOST_CHECK( std::find( modified.begin(), modified.end(), seg ) != modified.end() );
580 for(
int i : { 0, 3, 4 } )
581 BOOST_CHECK_LE( ( outline.CPoint( i ) - pts[i] ).EuclideanNorm(), 5000.0 );
610 BOOST_CHECK_LE( ( neighbor->GetCenter() - resized->
GetEllipseCenter() ).EuclideanNorm(), 5000.0 );
623 circle->SetLocked(
true );
628 std::vector<PCB_SHAPE*> shapes{
circle, ellipse };
631 BOOST_CHECK_LE( ( ellipse->GetEllipseCenter() -
VECTOR2I( 20 *
MM, 15 *
MM ) ).EuclideanNorm(), 5000.0 );
632 BOOST_CHECK_LE(
std::abs( ellipse->GetEllipseMajorRadius() - 8 *
MM ), 5000 );
633 BOOST_CHECK_LE(
std::abs( ellipse->GetEllipseMinorRadius() - 4 *
MM ), 5000 );
656 std::vector<PCB_SHAPE*> shapes{ seg, probe };
659 BOOST_CHECK_LE( ( probe->GetStart() -
VECTOR2I( 5 *
MM, 2 *
MM ) ).EuclideanNorm(), 1000 );
679 std::vector<PCB_SHAPE*> shapes{ ref, free };
682 BOOST_CHECK_LE(
std::abs( free->GetStart().y ), 100 );
683 BOOST_CHECK_LE(
std::abs( free->GetEnd().y ), 100 );
708 std::vector<PCB_SHAPE*> shapes{ axis, segA, segB };
712 BOOST_CHECK_LE(
std::abs( segB->GetStart().x - 8 *
MM ), 1000 );
713 BOOST_CHECK_LE(
std::abs( segB->GetStart().y - segA->GetStart().y ), 1000 );
731 std::vector<PCB_SHAPE*> shapes{ seg };
734 double length = ( seg->
GetEnd() - seg->
GetStart() ).EuclideanNorm();
735 BOOST_CHECK_LE(
std::abs( length - 8.0 *
MM ), 1000 );
754 len->SetDriving(
true );
756 std::vector<PCB_SHAPE*> shapes{ seg };
759 double length = ( seg->
GetEnd() - seg->
GetStart() ).EuclideanNorm();
760 BOOST_CHECK_LE(
std::abs( length - 8.0 *
MM ), 1000 );
761 BOOST_CHECK_LE( ( seg->
GetEnd() -
VECTOR2I( 8 *
MM, 0 ) ).EuclideanNorm(), 5000 );
780 std::vector<PCB_SHAPE*> shapes{ rect };
792 BOOST_CHECK_LE(
std::abs( width - 30 *
MM ), 5000 );
793 BOOST_CHECK_LE(
std::abs( height - 30 *
MM ), 5000 );
816 std::vector<PCB_SHAPE*> shapes{ rect };
828 BOOST_CHECK_LE(
std::abs( height - 20 *
MM ), 5000 );
829 BOOST_CHECK_LE(
std::abs( width - 40 *
MM ), 5000 );
846 std::vector<PCB_SHAPE*> shapes{ rect };
878 std::vector<PCB_SHAPE*> shapes{ rect };
888 BOOST_CHECK_LE(
std::abs( width - 8 *
MM ), 5000 );
911 std::vector<PCB_SHAPE*> shapes{ rect };
916 adapter.
Solve(
true );
918 std::vector<PCB_SHAPE*> changed = adapter.
Apply();
920 BOOST_CHECK( changed.empty() );
932 const std::vector<VECTOR2I> points{ { 30 *
MM, 20 *
MM },
933 { 39 *
MM, 27 *
MM },
934 { 36 *
MM, 38 *
MM },
935 { 24 *
MM, 38 *
MM },
936 { 21 *
MM, 27 *
MM } };
947 std::vector<PCB_SHAPE*> shapes{ poly };
957 BOOST_REQUIRE_EQUAL( outline.
PointCount(), 5 );
959 double driven = ( outline.
CPoint( 3 ) - outline.
CPoint( 1 ) ).EuclideanNorm();
960 BOOST_CHECK_LE(
std::abs( driven - 24.0 *
MM ), 5000 );
963 for(
int i : { 0, 2, 4 } )
964 BOOST_CHECK_LE( ( outline.
CPoint( i ) - points[i] ).EuclideanNorm(), 1000 );
974 const std::vector<VECTOR2I> points{ { 30 *
MM, 20 *
MM },
975 { 39 *
MM, 27 *
MM },
976 { 36 *
MM, 38 *
MM },
977 { 24 *
MM, 38 *
MM },
978 { 21 *
MM, 27 *
MM } };
988 std::vector<PCB_SHAPE*> shapes{ poly };
1002 for(
int i = 0; i < 5; ++i )
1013 const std::vector<VECTOR2I> points{ { 10 *
MM, 10 *
MM },
1014 { 50 *
MM, 10 *
MM },
1015 { 50 *
MM, 40 *
MM },
1016 { 10 *
MM, 40 *
MM } };
1032 std::vector<PCB_SHAPE*> shapes{ poly };
1048 for(
int i = 0; i < 4; ++i )
1066 chain.SetClosed(
true );
1079 std::vector<PCB_SHAPE*> shapes{ poly };
1093 BOOST_CHECK_GT( outline.
ArcCount(), 0 );
1105 const std::vector<VECTOR2I> points{ { 10 *
MM, 10 *
MM },
1106 { 50 *
MM, 10 *
MM },
1107 { 50 *
MM, 40 *
MM },
1108 { 10 *
MM, 40 *
MM } };
1124 std::vector<PCB_SHAPE*> shapes{ poly };
1140 for(
int i = 0; i < 4; ++i )
1160 std::vector<PCB_SHAPE*> shapes{ poly, seg };
1191 std::vector<PCB_SHAPE*> shapes{
circle };
1215 std::vector<PCB_SHAPE*> shapes{ ref, other };
1218 BOOST_CHECK_LE(
std::abs( other->GetRadius() - 4 *
MM ), 1000 );
1236 std::vector<PCB_SHAPE*> shapes{ ref, other };
1239 BOOST_CHECK_LE( ( other->GetCenter() -
VECTOR2I( 5 *
MM, 5 *
MM ) ).EuclideanNorm(), 1000 );
1263 std::vector<PCB_SHAPE*> shapes{ ref, arm };
1267 BOOST_CHECK_LE(
std::abs( arm->GetEnd().x - arm->GetStart().x ), 100 );
1282 std::vector<PCB_SHAPE*> shapes{ arc };
1305 std::vector<PCB_SHAPE*> shapes{ ref, other };
1308 BOOST_CHECK_LE(
std::abs( other->GetRadius() - 5 *
MM ), 3000 );
1321 const VECTOR2I startBefore = bezier->GetStart();
1322 const VECTOR2I c1Before = bezier->GetBezierC1();
1323 const VECTOR2I c2Before = bezier->GetBezierC2();
1324 const VECTOR2I endBefore = bezier->GetEnd();
1332 std::vector<PCB_SHAPE*> shapes{
anchor, bezier };
1345 BOOST_CHECK_LE( ( bezier->GetEnd() -
VECTOR2I( 20 *
MM, 5 *
MM ) ).EuclideanNorm(), 1000 );
1352 VECTOR2I endDelta = bezier->GetEnd() - endBefore;
1370 std::vector<PCB_SHAPE*> shapes{ a, b };
1398 std::vector<PCB_SHAPE*> shapes{ a, b };
1425 std::vector<PCB_SHAPE*> modified;
1432 BOOST_CHECK_LE( ( bezier->
GetEnd() - seg->GetStart() ).EuclideanNorm(), 100 );
1433 BOOST_CHECK_LE( ( bezier->
GetEnd() -
VECTOR2I( 13 *
MM, 4 *
MM ) ).EuclideanNorm(), 1000 );
1436 BOOST_CHECK( std::find( modified.begin(), modified.end(), seg ) != modified.end() );
1437 BOOST_CHECK( std::find( modified.begin(), modified.end(), bezier ) == modified.end() );
1456 const VECTOR2I yEnd0 = y->GetEnd();
1458 std::vector<PCB_SHAPE*> modified;
1462 BOOST_CHECK_LE( slopeDiffY( x ), 100 );
1465 BOOST_CHECK_LE( ( y->GetStart() - x->
GetEnd() ).EuclideanNorm(), 5000.0 );
1466 BOOST_CHECK( x->
GetEnd() != xEnd0 );
1469 BOOST_CHECK_LE( ( y->GetEnd() - yEnd0 ).EuclideanNorm(), 5000.0 );
1491 const VECTOR2I yEnd0 = y->GetEnd();
1493 std::vector<PCB_SHAPE*> modified;
1497 BOOST_CHECK_LE( ( x->
GetEnd() -
VECTOR2I( 10 *
MM, 0 ) ).EuclideanNorm(), 5000.0 );
1498 BOOST_CHECK_LE( ( y->GetStart() - x->
GetEnd() ).EuclideanNorm(), 5000.0 );
1501 BOOST_CHECK_LE( ( y->GetEnd() - yEnd0 ).EuclideanNorm(), 5000.0 );
1518 const VECTOR2I bEnd0 = b->GetEnd();
1520 std::vector<PCB_SHAPE*> modified;
1522 { 12 *
MM, 3 *
MM }, &modified );
1527 BOOST_CHECK_LE( ( a->
GetEnd() - b->GetStart() ).EuclideanNorm(), 100 );
1528 BOOST_CHECK_LE( ( a->
GetEnd() -
VECTOR2I( 12 *
MM, 3 *
MM ) ).EuclideanNorm(), 5000.0 );
1529 BOOST_CHECK( std::find( modified.begin(), modified.end(), b ) != modified.end() );
1532 BOOST_CHECK_LE( ( b->GetEnd() - bEnd0 ).EuclideanNorm(), 5000.0 );
1551 const VECTOR2I nStart0 = n->GetStart();
1552 const VECTOR2I nEnd0 = n->GetEnd();
1554 a->
Move( { 0, 5 *
MM } );
1555 b->Move( { 0, 5 *
MM } );
1557 std::vector<PCB_SHAPE*> modified;
1561 BOOST_CHECK_LE( ( n->GetStart() - nStart0 ).EuclideanNorm(), 100 );
1562 BOOST_CHECK_LE( ( n->GetEnd() - nEnd0 ).EuclideanNorm(), 100 );
1563 BOOST_CHECK( std::find( modified.begin(), modified.end(), n ) == modified.end() );
1567 BOOST_CHECK_LE( ( a->
GetEnd() -
VECTOR2I( 10 *
MM, 5 *
MM ) ).EuclideanNorm(), 5000.0 );
1568 BOOST_CHECK_LE( ( b->GetStart() -
VECTOR2I( 10 *
MM, 5 *
MM ) ).EuclideanNorm(), 5000.0 );
1581 std::vector<ENDPOINT_BINDING> bindings =
1584 BOOST_REQUIRE_EQUAL( bindings.size(), 2 );
1604 std::vector<ENDPOINT_BINDING> bindings =
1607 BOOST_REQUIRE_EQUAL( bindings.size(), 2 );
1621 std::vector<ENDPOINT_BINDING> bindings =
1624 BOOST_REQUIRE_EQUAL( bindings.size(), 1 );
1641 std::vector<ENDPOINT_BINDING> bindings =
1644 BOOST_REQUIRE_EQUAL( bindings.size(), 2 );
void ReSolveAfterShapeResize(BOARD *aBoard, PCB_SHAPE *aShape, std::vector< PCB_SHAPE * > *aModified, const std::function< void(BOARD_ITEM *)> &aBeforeModify)
Re-solve after a resize, e.g. a circle radius edit. Holds aShape fixed so its neighbors adjust.
CONSTRAINT_DIAGNOSIS ApplyConstraintImmediately(BOARD *aBoard, const PCB_CONSTRAINT *aConstraint, std::vector< PCB_SHAPE * > *aModified, const std::function< void(BOARD_ITEM *)> &aBeforeModify, const std::set< KIID > &aFixedShapes)
Solve a just-created constraint's cluster so the geometry snaps to satisfy it (SolidWorks-style),...
CONSTRAINT_DIAGNOSIS SolveCluster(BOARD *aBoard, const CONSTRAINT_MEMBER &aDragged, const VECTOR2I &aCursor, std::vector< PCB_SHAPE * > *aModified, const std::function< void(BOARD_ITEM *)> &aBeforeModify, bool aIncludeDragged, bool aStabilize, const std::set< KIID > &aEdited, const std::optional< std::pair< CONSTRAINT_MEMBER, VECTOR2I > > &aCoDragged, const std::set< KIID > &aFixedShapes, bool aHoldDraggedRigid)
Gather the cluster of shapes transitively constrained with the dragged shape, solve with the dragged ...
void ReSolveShapeClusters(BOARD *aBoard, const std::vector< PCB_SHAPE * > &aShapes, std::vector< PCB_SHAPE * > *aModified, const std::function< void(BOARD_ITEM *)> &aBeforeModify)
Re-solve the clusters of shapes edited outside the solver, e.g.
bool ReSolveShapeClustersHoldingEdited(BOARD *aBoard, const std::vector< PCB_SHAPE * > &aEditedShapes, std::vector< PCB_SHAPE * > *aModified, const std::function< void(BOARD_ITEM *)> &aBeforeModify)
Re-solve clusters whose new geometry is authoritative holding every edited shape fully fixed so only ...
Translates KiCad board geometry to and from the planegcs solver (issue #2329).
bool Solve(const CONSTRAINT_MEMBER &aDragged, const VECTOR2I &aCursor, bool aStabilize=false, const std::set< KIID > &aEdited={}, const std::optional< std::pair< CONSTRAINT_MEMBER, VECTOR2I > > &aCoDragged=std::nullopt, bool aHoldDraggedRigid=false)
Solve the system, pinning a dragged anchor to a cursor position.
const std::vector< KIID > & UnmappedConstraints() const
Constraints from the last Build() that could not be mapped onto a solver primitive (wrong member coun...
bool Build(const std::vector< PCB_SHAPE * > &aShapes, const std::vector< PCB_CONSTRAINT * > &aConstraints, const std::set< KIID > *aFixedShapes=nullptr, const std::vector< PCB_DIMENSION_BASE * > &aDimensions={})
Translate a cluster into a planegcs system.
std::vector< PCB_SHAPE * > Apply(const std::function< void(BOARD_ITEM *)> &aBeforeWrite={})
Write the solved coordinates back into the shapes, de-normalized to IU.
CONSTRAINT_DIAGNOSIS Diagnose()
Report degrees of freedom and conflicting/redundant constraints.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void SetLocked(bool aLocked) override
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
const CONSTRAINTS & Constraints() const
Geometric constraints (#2329) owned by this board.
int GetEllipseMinorRadius() const
const VECTOR2I & GetEllipseCenter() const
void SetCornerRadius(int aRadius)
int GetEllipseMajorRadius() const
SHAPE_POLY_SET & GetPolyShape()
EDA_ANGLE GetEllipseRotation() const
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
void SetPolyPoints(const std::vector< VECTOR2I > &aPoints)
int GetCornerRadius() const
A geometric constraint between board items (issue #2329).
void SetValue(std::optional< double > aValue)
void SetDriving(bool aDriving)
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
void SetEllipseMinorRadius(int aR) override
void Move(const VECTOR2I &aMoveVector) override
Move this object.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int PointCount() const
Return the number of points (vertices) in this line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
Represent a set of closed polygons.
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index.
int HoleCount(int aOutline) const
Returns the number of holes in a given outline.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
int NewOutline()
Creates a new empty polygon in the set and returns its index.
int NewHole(int aOutline=-1)
Creates a new hole in a given outline.
int OutlineCount() const
Return the number of outlines in the set.
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
constexpr extended_type Cross(const VECTOR2< T > &aVector) const
Compute cross product of self with aVector.
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
std::vector< ENDPOINT_BINDING > SelectEndpointBindings(BOARD *aBoard, const KIID &aItem, const VECTOR2I &aStart, const std::optional< VECTOR2I > &aEnd, double aMaxDist)
Choose the coincident bindings a freshly drawn item endpoints should take so it tracks the geometry i...
PCB_SHAPE * addSegment(BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aEnd)
PCB_SHAPE * addEllipseArc(BOARD &aBoard, const VECTOR2I &aCenter, int aMajor, int aMinor, const EDA_ANGLE &aRotation, const EDA_ANGLE &aStart, const EDA_ANGLE &aEnd)
PCB_SHAPE * addPoly(BOARD &aBoard, const std::vector< VECTOR2I > &aPoints)
double ellipseEquationAt(const PCB_SHAPE *aEllipse, const VECTOR2I &aPos)
Squared-normalized ellipse equation value at aPos: 1.0 exactly on the outline.
PCB_SHAPE * addArc(BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
PCB_SHAPE * addCircle(BOARD &aBoard, const VECTOR2I &aCenter, int aRadius)
PCB_SHAPE * addBezier(BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aCtrl1, const VECTOR2I &aCtrl2, const VECTOR2I &aEnd)
void solveAndApply(BOARD &aBoard, const std::vector< PCB_SHAPE * > &aShapes)
Build the cluster of aShapes against every constraint on aBoard, solve it, and write the result back ...
PCB_SHAPE * addEllipse(BOARD &aBoard, const VECTOR2I &aCenter, int aMajor, int aMinor, const EDA_ANGLE &aRotation)
PCB_CONSTRAINT * addConstraint(BOARD &aBoard, PCB_CONSTRAINT_TYPE aType, const std::vector< CONSTRAINT_MEMBER > &aMembers, std::optional< double > aValue=std::nullopt)
PCB_SHAPE * addRect(BOARD &aBoard, const VECTOR2I &aStart, const VECTOR2I &aEnd)
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
@ VERTEX
An indexed rectangle corner or polygon outline vertex; pairs with CONSTRAINT_MEMBER::m_index.
@ WHOLE
The item as a whole (a segment as a line, a circle).
@ START
First endpoint of a segment or arc.
@ END
Second endpoint of a segment or arc.
@ CENTER
Center of an arc or circle.
@ CONCENTRIC
Two arcs/circles share a center.
@ SYMMETRIC
Two points are mirror images about an axis.
@ FIXED_POSITION
A point is locked at its current location.
@ VERTICAL
A segment (or two points) is vertical.
@ TANGENT
A line and a curve, or two curves, touch tangentially.
@ COINCIDENT
Two points are made to coincide.
@ PERPENDICULAR
Two segments are perpendicular.
@ FIXED_RADIUS
An arc/circle has a driving radius value.
@ HORIZONTAL
A segment (or two points) is horizontal.
@ EQUAL_RADIUS
Two arcs/circles have equal radius.
@ MIDPOINT
A point is the midpoint of a segment.
@ POINT_ON_LINE
A point lies on a segment's supporting line.
@ FIXED_LENGTH
A segment has a driving length value.
@ ANGULAR_DIMENSION
An angle between members (driving or reference).
@ COLLINEAR
Two segments lie on the same line.
@ PARALLEL
Two segments are parallel.
@ EQUAL_LENGTH
Two segments have equal length.
The outcome of a constraint solve, in plain data so callers need not know planegcs.
bool solved
Solver reached Success or Converged.
bool IsOverConstrained() const
bool IsWellConstrained() const
std::vector< KIID > redundant
Constraints the solver reports as redundant.
int freeDof
Remaining degrees of freedom (-1 if not diagnosed).
One participant in a constraint: a referenced board item plus the feature of that item that participa...
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_CASE(ParallelToFixedHorizontal)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
const SHAPE_LINE_CHAIN chain
SHAPE_CIRCLE circle(c.m_circle_center, c.m_circle_radius)
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D