KiCad PCB EDA Suite
|
#include <shape_arc.h>
Public Member Functions | |
SHAPE_ARC () | |
SHAPE_ARC (const VECTOR2I &aArcCenter, const VECTOR2I &aArcStartPoint, const EDA_ANGLE &aCenterAngle, int aWidth=0) | |
Construct and arc using center, start, angle. | |
SHAPE_ARC (const VECTOR2I &aArcStart, const VECTOR2I &aArcMid, const VECTOR2I &aArcEnd, int aWidth) | |
SHAPE_ARC (const SEG &aSegmentA, const SEG &aSegmentB, int aRadius, int aWidth=0) | |
Build a SHAPE_ARC which is tangent to two segments and a given radius. | |
SHAPE_ARC (const SHAPE_ARC &aOther) | |
virtual | ~SHAPE_ARC () |
SHAPE * | Clone () const override |
Return a dynamically allocated copy of the shape. | |
SHAPE_ARC & | ConstructFromStartEndAngle (const VECTOR2I &aStart, const VECTOR2I &aEnd, const EDA_ANGLE &aAngle, double aWidth=0) |
Construct this arc from the given start, end and angle. | |
SHAPE_ARC & | ConstructFromStartEndCenter (const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, bool aClockwise=false, double aWidth=0) |
Constructs this arc from the given start, end and center. | |
const VECTOR2I & | GetP0 () const |
const VECTOR2I & | GetP1 () const |
const VECTOR2I & | GetArcMid () const |
const VECTOR2I & | GetCenter () const |
const BOX2I | BBox (int aClearance=0) const override |
Compute a bounding box of the shape, with a margin of aClearance a collision. | |
VECTOR2I | NearestPoint (const VECTOR2I &aP) const |
bool | NearestPoints (const SHAPE_ARC &aArc, VECTOR2I &aPtA, VECTOR2I &aPtB, int64_t &aDistSq) const |
Compute closest points between this arc and aArc. | |
bool | NearestPoints (const SHAPE_CIRCLE &aCircle, VECTOR2I &aPtA, VECTOR2I &aPtB, int64_t &aDistSq) const |
Compute closest points between this arc and aCircle. | |
bool | NearestPoints (const SEG &aSeg, VECTOR2I &aPtA, VECTOR2I &aPtB, int64_t &aDistSq) const |
Compute closest points between this arc and aSeg. | |
bool | NearestPoints (const SHAPE_RECT &aRect, VECTOR2I &aPtA, VECTOR2I &aPtB, int64_t &aDistSq) const |
Compute closest points between this arc and aRect. | |
bool | Collide (const SEG &aSeg, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override |
Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance, indicating a collision. | |
bool | Collide (const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override |
Check if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision. | |
bool | Collide (const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override |
int | IntersectLine (const SEG &aSeg, std::vector< VECTOR2I > *aIpsBuffer) const |
Find intersection points between this arc and aSeg, treating aSeg as an infinite line. | |
int | Intersect (const CIRCLE &aArc, std::vector< VECTOR2I > *aIpsBuffer) const |
Find intersection points between this arc and a CIRCLE. | |
int | Intersect (const SHAPE_ARC &aArc, std::vector< VECTOR2I > *aIpsBuffer) const |
Find intersection points between this arc and another arc. | |
void | SetWidth (int aWidth) |
int | GetWidth () const |
bool | IsSolid () const override |
bool | IsEffectiveLine () const |
void | Move (const VECTOR2I &aVector) override |
void | Rotate (const EDA_ANGLE &aAngle, const VECTOR2I &aCenter) override |
Rotate the arc by a given angle about a point. | |
void | Mirror (const VECTOR2I &aRef, FLIP_DIRECTION aFlipDirection) |
void | Mirror (const SEG &axis) |
void | Reverse () |
SHAPE_ARC | Reversed () const |
double | GetRadius () const |
SEG | GetChord () const |
EDA_ANGLE | GetCentralAngle () const |
EDA_ANGLE | GetStartAngle () const |
EDA_ANGLE | GetEndAngle () const |
double | GetLength () const |
const SHAPE_LINE_CHAIN | ConvertToPolyline (double aAccuracy=DefaultAccuracyForPCB(), double *aEffectiveAccuracy=nullptr) const |
Construct a SHAPE_LINE_CHAIN of segments from a given arc. | |
bool | operator== (SHAPE_ARC const &aArc) const |
void | TransformToPolygon (SHAPE_POLY_SET &aBuffer, int aError, ERROR_LOC aErrorLoc) const override |
Fills a SHAPE_POLY_SET with a polygon representation of this shape. | |
bool | IsCCW () const |
bool | IsClockwise () const |
int | GetClearance (const SHAPE *aOther) const |
Return the actual minimum distance between two shapes. | |
bool | IsNull () const |
Return true if the shape is a null shape. | |
virtual bool | Collide (const SHAPE *aShape, int aClearance, VECTOR2I *aMTV) const |
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance, indicating a collision. | |
virtual VECTOR2I | Centre () const |
Compute a center-of-mass of the shape. | |
virtual int | Distance (const VECTOR2I &aP) const |
Returns the minimum distance from a given point to this shape. | |
virtual SEG::ecoord | SquaredDistance (const VECTOR2I &aP, bool aOutlineOnly=false) const |
virtual bool | PointInside (const VECTOR2I &aPt, int aAccuracy=0, bool aUseBBoxCache=false) const |
Check if point aP lies inside a closed shape. | |
virtual bool | Parse (std::stringstream &aStream) |
virtual const std::string | Format (bool aCplusPlus=true) const |
FACET * | NewFacet () |
SGNODE * | CalcShape (SGNODE *aParent, SGNODE *aColor, WRL1_ORDER aVertexOrder, float aCreaseLimit=0.74317, bool isVRML2=false) |
SHAPE_TYPE | Type () const |
Return the type of the shape. | |
wxString | TypeName () const |
virtual bool | HasIndexableSubshapes () const |
virtual size_t | GetIndexableSubshapeCount () const |
virtual void | GetIndexableSubshapes (std::vector< const SHAPE * > &aSubshapes) const |
Static Public Member Functions | |
static double | DefaultAccuracyForPCB () |
Static Public Attributes | |
static const int | MIN_PRECISION_IU = 4 |
This is the minimum precision for all the points in a shape. | |
Protected Types | |
typedef VECTOR2I::extended_type | ecoord |
Protected Attributes | |
SHAPE_TYPE | m_type |
< type of our shape | |
Private Member Functions | |
void | update_values () |
bool | sliceContainsPoint (const VECTOR2I &p) const |
Private Attributes | |
VECTOR2I | m_start |
VECTOR2I | m_mid |
VECTOR2I | m_end |
int | m_width |
BOX2I | m_bbox |
VECTOR2I | m_center |
double | m_radius |
std::list< FACET * > | facets |
Definition at line 39 of file shape_arc.h.
|
protectedinherited |
|
inline |
Definition at line 43 of file shape_arc.h.
Referenced by Clone(), and Reversed().
SHAPE_ARC::SHAPE_ARC | ( | const VECTOR2I & | aArcCenter, |
const VECTOR2I & | aArcStartPoint, | ||
const EDA_ANGLE & | aCenterAngle, | ||
int | aWidth = 0 |
||
) |
Construct and arc using center, start, angle.
Center and angle are used to calculate the mid and end points of the arc, and are not stored.
aArcCenter | is the arc center. |
aArcStartPoint | is the arc start point. |
aCenterAngle | is the arc angle. |
aWidth | is the arc line thickness. |
Definition at line 45 of file shape_arc.cpp.
References center, end, KiROUND(), m_end, m_mid, m_start, RotatePoint(), update_values(), VECTOR2< T >::x, and VECTOR2< T >::y.
SHAPE_ARC::SHAPE_ARC | ( | const VECTOR2I & | aArcStart, |
const VECTOR2I & | aArcMid, | ||
const VECTOR2I & | aArcEnd, | ||
int | aWidth | ||
) |
aArcStart | is the arc start point. |
aArcEnd | is the arc end point. |
aArcMid | is the arc mid point. |
aWidth | is the arc line thickness. |
Definition at line 66 of file shape_arc.cpp.
References update_values().
Build a SHAPE_ARC which is tangent to two segments and a given radius.
aSegmentA | is the first segment |
aSegmentB | is the second segment |
aRadius | is the arc radius |
aWidth | is the arc line thickness |
Definition at line 78 of file shape_arc.cpp.
References SEG::A, ANGLE_90, EDA_ANGLE::AsRadians(), SEG::B, SEG::Center(), EDA_ANGLE::Cos(), VECTOR2< T >::EuclideanNorm(), SEG::Intersect(), KiROUND(), SEG::Length(), SEG::LineProject(), m_end, m_mid, m_start, m_width, RotatePoint(), EDA_ANGLE::Sin(), update_values(), VECTOR2< T >::x, and VECTOR2< T >::y.
SHAPE_ARC::SHAPE_ARC | ( | const SHAPE_ARC & | aOther | ) |
|
inlinevirtual |
Definition at line 84 of file shape_arc.h.
|
overridevirtual |
Compute a bounding box of the shape, with a margin of aClearance a collision.
aClearance | how much the bounding box is expanded wrs to the minimum enclosing rectangle for the shape. |
Implements SHAPE.
Definition at line 413 of file shape_arc.cpp.
References BOX2< Vec >::Inflate(), KiROUND(), m_bbox, and m_width.
Referenced by BOOST_AUTO_TEST_CASE(), CheckArcGeom(), Collide(), drawShapes(), GERBER_DRAW_ITEM::GetBoundingBox(), and playground_main_func().
|
inherited |
Definition at line 703 of file wrlfacet.cpp.
References IFSG_NODE::AddChildNode(), IFSG_INDEX::AddIndex(), IFSG_NODE::AddRefNode(), SHAPE::facets, IFSG_NODE::GetRawPtr(), S3D::GetSGNodeParent(), IFSG_FACESET::NewNode(), IFSG_SHAPE::NewNode(), IFSG_COLORS::SetColorList(), IFSG_COORDS::SetCoordsList(), IFSG_NORMALS::SetNormalList(), SGPOINT::x, SGPOINT::y, and SGPOINT::z.
Referenced by WRL2FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL1FACESET::TranslateToSG().
|
inlinevirtualinherited |
Compute a center-of-mass of the shape.
Definition at line 232 of file shape.h.
References SHAPE::BBox(), and BOX2< Vec >::Centre().
Referenced by PNS::TOPOLOGY::AssembleDiffPair(), Collide(), SCH_EASYEDA_PARSER::ParseSchematic(), and pickSegment().
|
inlineoverridevirtual |
Return a dynamically allocated copy of the shape.
copy | of the shape |
Reimplemented from SHAPE.
Definition at line 86 of file shape_arc.h.
References SHAPE_ARC().
Referenced by CheckArc().
|
overridevirtual |
Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance, indicating a collision.
aActual | [out] an optional pointer to an int to be updated with the actual distance int the event of a collision. |
aLocation | [out] an option pointer to a point to store a nearby location in the event of a collision. |
Implements SHAPE.
Definition at line 254 of file shape_arc.cpp.
References SEG::A, SEG::B, center, Collide(), SHAPE_CIRCLE::Collide(), VECTOR2< T >::EuclideanNorm(), GetCenter(), GetCentralAngle(), SHAPE_CIRCLE::GetCircle(), CIRCLE::Intersect(), m_end, m_start, SEG::NearestPoint(), radius, and SEG::Square().
Referenced by BOOST_AUTO_TEST_CASE(), Collide(), Collide(), SHAPE_LINE_CHAIN::Collide(), drawShapes(), GEOM_TEST::IsOutlineValid(), and SHAPE_LINE_CHAIN::SelfIntersectingWithArcs().
|
virtualinherited |
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance, indicating a collision.
aShape | shape to check collision against |
aClearance | minimum clearance |
aMTV | [out] minimum translation vector |
aActual | [out] an optional pointer to an int to store the actual distance in the event of a collision. |
aLocation | [out] an option pointer to a point to store a nearby location in the event of a collision. |
Reimplemented in SHAPE_COMPOUND, SHAPE_RECT, and SHAPE_SEGMENT.
Definition at line 1195 of file shape_collisions.cpp.
References collideShapes().
|
overridevirtual |
Check if the boundary of shape (this) lies closer to the point aP than aClearance, indicating a collision.
aActual | [out] an optional pointer to an int to store the actual distance in the event of a collision. |
aLocation | [out] an option pointer to a point to store a nearby location in the event of a collision. |
Reimplemented from SHAPE.
Definition at line 766 of file shape_arc.cpp.
References ANGLE_0, BBox(), CIRCLE::Center, center, VECTOR2< T >::Distance(), VECTOR2< T >::EuclideanNorm(), GetCenter(), GetCentralAngle(), GetEndAngle(), GetStartAngle(), KiROUND(), m_end, m_start, m_width, CIRCLE::NearestPoint(), EDA_ANGLE::Normalize(), radius, and RotatePoint().
SHAPE_ARC & SHAPE_ARC::ConstructFromStartEndAngle | ( | const VECTOR2I & | aStart, |
const VECTOR2I & | aEnd, | ||
const EDA_ANGLE & | aAngle, | ||
double | aWidth = 0 |
||
) |
Construct this arc from the given start, end and angle.
aStart | is the arc starting point |
aEnd | is the arc endpoint |
aAngle | is the arc included angle |
aWidth | is the arc line thickness |
Definition at line 195 of file shape_arc.cpp.
References CalcArcCenter(), center, m_end, m_mid, m_start, m_width, RotatePoint(), and update_values().
Referenced by DIRECTION_45::BuildInitialTrace(), SCH_IO_EAGLE::loadPolyLine(), SCH_IO_EAGLE::loadSymbolPolyLine(), and PNS::MEANDER_SHAPE::makeMiterShape().
SHAPE_ARC & SHAPE_ARC::ConstructFromStartEndCenter | ( | const VECTOR2I & | aStart, |
const VECTOR2I & | aEnd, | ||
const VECTOR2I & | aCenter, | ||
bool | aClockwise = false , |
||
double | aWidth = 0 |
||
) |
Constructs this arc from the given start, end and center.
aStart | is the arc starting point |
aEnd | is the arc endpoint |
aCenter | is the arc center |
aClockwise | determines which of the two solutions to construct |
aWidth | is the arc line thickness |
Definition at line 213 of file shape_arc.cpp.
References ANGLE_360, m_end, m_mid, m_start, EDA_ANGLE::Normalize(), RotatePoint(), and update_values().
Referenced by SHAPE_LINE_CHAIN::amendArc(), BOOST_AUTO_TEST_CASE(), CADSTAR_ARCHIVE_PARSER::VERTEX::BuildArc(), DIRECTION_45::BuildInitialTrace(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), PCB_IO_EASYEDAPRO_PARSER::ParseContour(), EASYEDA_PARSER_BASE::ParseLineChains(), SHAPE_LINE_CHAIN::Slice(), and SHAPE_LINE_CHAIN::splitArc().
const SHAPE_LINE_CHAIN SHAPE_ARC::ConvertToPolyline | ( | double | aAccuracy = DefaultAccuracyForPCB() , |
double * | aEffectiveAccuracy = nullptr |
||
) | const |
Construct a SHAPE_LINE_CHAIN of segments from a given arc.
aAccuracy | maximum divergence from true arc given in internal units. |
aEffectiveAccuracy | is the actual divergence from true arc given. the approximation error is between -aEffectiveAccuracy/2 and +aEffectiveAccuracy/2 in internal units |
Definition at line 886 of file shape_arc.cpp.
References SHAPE_LINE_CHAIN::Append(), EDA_ANGLE::AsDegrees(), CircleToEndSegmentDeltaRadius(), EDA_ANGLE::Cos(), SEG::Distance(), GetArcMid(), GetArcToSegmentCount(), GetCenter(), GetCentralAngle(), GetP0(), GetP1(), GetRadius(), GetStartAngle(), KiROUND(), m_end, m_start, m_width, EDA_ANGLE::Sin(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by SHAPE_LINE_CHAIN::Append(), PNS::ArcHull(), BOARD_ADAPTER::createPadWithMargin(), KIGFX::PCB_PAINTER::draw(), TEARDROP_MANAGER::findAnchorPointsOnTrack(), and SHAPE_LINE_CHAIN::Insert().
|
inlinestatic |
Definition at line 276 of file shape_arc.h.
References PCB_IU_PER_MM.
Referenced by SHAPE_LINE_CHAIN::Append(), PNS::ArcHull(), BOOST_AUTO_TEST_CASE(), GEOM_TEST::IsOutlineValid(), and PNS::SHOVE::ShoveObstacleLine().
|
virtualinherited |
Returns the minimum distance from a given point to this shape.
Always returns zero if the point is inside a closed shape and aOutlineOnly is false.
aP | is the point to test |
Reimplemented in SHAPE_COMPOUND, and SHAPE_LINE_CHAIN.
Definition at line 109 of file shape.cpp.
References SHAPE::SquaredDistance().
|
virtualinherited |
Reimplemented in SHAPE_CIRCLE, SHAPE_COMPOUND, SHAPE_LINE_CHAIN, SHAPE_POLY_SET, SHAPE_RECT, and SHAPE_SEGMENT.
Definition at line 47 of file shape.cpp.
References SHAPE_BASE::m_type.
Referenced by PNS::VIA::Format(), SHAPE_CIRCLE::Format(), SHAPE_SEGMENT::Format(), and SHAPE_FILE_IO::Write().
|
inline |
Definition at line 118 of file shape_arc.h.
References m_mid.
Referenced by CREEPAGE_GRAPH::Addshape(), approximateLineChainWithArcs(), BOOST_AUTO_TEST_CASE(), commonParallelProjection(), ConnectBoardShapes(), ConvertToPolyline(), FABMASTER::createBoardItems(), DoDogboneTestChecks(), PCB_IO_KICAD_SEXPR::formatPolyPts(), ALTIUM_PCB::HelperCreateBoardOutline(), FABMASTER::loadFootprints(), CADSTAR_SCH_ARCHIVE_LOADER::loadShapeVertices(), PNS_KICAD_IFACE::modifyBoardItem(), operator<<(), kiapi::common::PackPolyLine(), SCH_EASYEDA_PARSER::ParseSymbolShapes(), PCB_ARC::PCB_ARC(), pickSegment(), GERBER_PLOTTER::plotArc(), OUTSET_ROUTINE::ProcessItem(), and LINE_FILLET_ROUTINE::ProcessLinePair().
const VECTOR2I & SHAPE_ARC::GetCenter | ( | ) | const |
Definition at line 849 of file shape_arc.cpp.
References m_center.
Referenced by SHAPE_LINE_CHAIN::amendArc(), approximateLineChainWithArcs(), PNS_LOG_VIEWER_OVERLAY::Arc(), PNS::ArcHull(), PNS::TOPOLOGY::AssembleDiffPair(), BOOST_AUTO_TEST_CASE(), CheckArcGeom(), Collide(), collideArc2Arc(), ConnectBoardShapes(), ConvertToPolyline(), ROUTER_PREVIEW_ITEM::drawLineChain(), ROUTER_PREVIEW_ITEM::drawShape(), GetCentralAngle(), GetEndAngle(), GetStartAngle(), Intersect(), IntersectLine(), FABMASTER::loadFootprints(), NearestPoint(), NearestPoints(), GERBER_PLOTTER::plotArc(), OUTSET_ROUTINE::ProcessItem(), SHAPE_LINE_CHAIN::SelfIntersectingWithArcs(), SHAPE_LINE_CHAIN::Slice(), sliceContainsPoint(), PNS::LINE_PLACER::SplitAdjacentArcs(), SHAPE_LINE_CHAIN::splitArc(), STROKE_PARAMS::Stroke(), and TransformArcToPolygon().
EDA_ANGLE SHAPE_ARC::GetCentralAngle | ( | ) | const |
Definition at line 864 of file shape_arc.cpp.
References ANGLE_360, center, GetCenter(), m_end, m_mid, m_start, and EDA_ANGLE::Normalize180().
Referenced by PNS_LOG_VIEWER_OVERLAY::Arc(), PNS::ArcHull(), CheckArcGeom(), Collide(), ComputeDogbone(), ConnectBoardShapes(), ConvertToPolyline(), ROUTER_PREVIEW_ITEM::drawLineChain(), ROUTER_PREVIEW_ITEM::drawShape(), GetLength(), sliceContainsPoint(), TransformArcToPolygon(), and update_values().
|
inline |
Definition at line 242 of file shape_arc.h.
References m_end, and m_start.
Referenced by PNS::ArcHull(), and CheckArcGeom().
|
inherited |
Return the actual minimum distance between two shapes.
distance | in IU |
POLY_SETs contain a bunch of polygons that are triangulated. But there are way more triangles than necessary for collision detection. Triangles check three vertices each but for the outline, we only need one. These are also fractured, so we don't need to worry about holes
Definition at line 55 of file shape.cpp.
References SHAPE_POLY_SET::COutline(), SHAPE_BASE::GetIndexableSubshapeCount(), SHAPE_BASE::GetIndexableSubshapes(), SHAPE_POLY_SET::OutlineCount(), and SHAPE_BASE::Type().
EDA_ANGLE SHAPE_ARC::GetEndAngle | ( | ) | const |
Definition at line 841 of file shape_arc.cpp.
References center, GetCenter(), m_end, and EDA_ANGLE::Normalize().
Referenced by CheckArcGeom(), Collide(), and commonParallelProjection().
|
inlinevirtualinherited |
Reimplemented in SHAPE_COMPOUND, and SHAPE_POLY_SET.
Definition at line 113 of file shape.h.
Referenced by SHAPE::GetClearance().
|
inlinevirtualinherited |
Reimplemented in SHAPE_COMPOUND, and SHAPE_POLY_SET.
Definition at line 115 of file shape.h.
Referenced by SHAPE_COMPOUND::AddShape(), SHAPE::GetClearance(), and ROUTER_PREVIEW_ITEM::ViewDraw().
double SHAPE_ARC::GetLength | ( | ) | const |
Definition at line 855 of file shape_arc.cpp.
References std::abs(), EDA_ANGLE::AsRadians(), GetCentralAngle(), GetRadius(), and radius.
Referenced by test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run().
|
inline |
Definition at line 116 of file shape_arc.h.
References m_start.
Referenced by PNS::NODE::Add(), CREEPAGE_GRAPH::Addshape(), PCB_GRID_HELPER::AlignToArc(), PNS::ARC::Anchor(), approximateLineChainWithArcs(), BOOST_AUTO_TEST_CASE(), DIRECTION_45::BuildInitialTrace(), Collide(), collideArc2Arc(), commonParallelProjection(), ComputeDogbone(), ConnectBoardShapes(), ConvertToPolyline(), FABMASTER::createBoardItems(), DIRECTION_45::DIRECTION_45(), DoDogboneTestChecks(), EDIT_TOOL::FilletTracks(), PCB_IO_KICAD_SEXPR::formatPolyPts(), PNS::getDanglingAnchor(), ALTIUM_PCB::HelperCreateBoardOutline(), SHAPE_LINE_CHAIN::IsArcStart(), GEOM_TEST::IsOutlineValid(), FABMASTER::loadFootprints(), CADSTAR_SCH_ARCHIVE_LOADER::loadShapeVertices(), CONVERT_TOOL::makePolysFromChainedSegs(), makeWireFromChain(), PNS_KICAD_IFACE::modifyBoardItem(), SHAPE_LINE_CHAIN::NearestPoint(), NearestPoints(), operator<<(), kiapi::common::PackPolyLine(), SCH_EASYEDA_PARSER::ParseSymbolShapes(), PCB_ARC::PCB_ARC(), GERBER_PLOTTER::plotArc(), OUTSET_ROUTINE::ProcessItem(), LINE_FILLET_ROUTINE::ProcessLinePair(), SHAPE_LINE_CHAIN::SelfIntersectingWithArcs(), SHAPE_LINE_CHAIN::Slice(), PNS::LINE_PLACER::SplitAdjacentArcs(), SHAPE_LINE_CHAIN::splitArc(), STROKE_PARAMS::Stroke(), and TransformArcToPolygon().
|
inline |
Definition at line 117 of file shape_arc.h.
References m_end.
Referenced by PNS::NODE::Add(), PNS::MEANDERED_LINE::AddArc(), PCB_POINT_EDITOR::addCorner(), CREEPAGE_GRAPH::Addshape(), PCB_GRID_HELPER::AlignToArc(), PNS::ARC::Anchor(), approximateLineChainWithArcs(), BOOST_AUTO_TEST_CASE(), DIRECTION_45::BuildInitialTrace(), CheckArcGeom(), Collide(), collideArc2Arc(), ComputeDogbone(), ConnectBoardShapes(), ConvertToPolyline(), FABMASTER::createBoardItems(), DIRECTION_45::DIRECTION_45(), DoDogboneTestChecks(), EDIT_TOOL::FilletTracks(), PCB_IO_KICAD_SEXPR::formatPolyPts(), PNS::getDanglingAnchor(), ALTIUM_PCB::HelperCreateBoardOutline(), SHAPE_LINE_CHAIN::IsArcEnd(), GEOM_TEST::IsOutlineValid(), FABMASTER::loadFootprints(), CADSTAR_SCH_ARCHIVE_LOADER::loadShapeVertices(), PNS::MEANDER_SHAPE::MakeArc(), makeWireFromChain(), PNS_KICAD_IFACE::modifyBoardItem(), SHAPE_LINE_CHAIN::NearestPoint(), NearestPoints(), operator<<(), kiapi::common::PackPolyLine(), SCH_EASYEDA_PARSER::ParseSymbolShapes(), PCB_ARC::PCB_ARC(), GERBER_PLOTTER::plotArc(), OUTSET_ROUTINE::ProcessItem(), LINE_FILLET_ROUTINE::ProcessLinePair(), SHAPE_LINE_CHAIN::SelfIntersectingWithArcs(), SHAPE_LINE_CHAIN::Slice(), PNS::LINE_PLACER::SplitAdjacentArcs(), SHAPE_LINE_CHAIN::splitArc(), STROKE_PARAMS::Stroke(), and TransformArcToPolygon().
double SHAPE_ARC::GetRadius | ( | ) | const |
Definition at line 880 of file shape_arc.cpp.
References m_radius.
Referenced by approximateLineChainWithArcs(), PNS_LOG_VIEWER_OVERLAY::Arc(), PNS::ArcHull(), PNS::TOPOLOGY::AssembleDiffPair(), CheckArcGeom(), ConnectBoardShapes(), ConvertToPolyline(), ROUTER_PREVIEW_ITEM::drawLineChain(), ROUTER_PREVIEW_ITEM::drawShape(), GetLength(), Intersect(), IntersectLine(), NearestPoint(), NearestPoints(), OUTSET_ROUTINE::ProcessItem(), SHAPE_LINE_CHAIN::SelfIntersectingWithArcs(), STROKE_PARAMS::Stroke(), and TransformArcToPolygon().
EDA_ANGLE SHAPE_ARC::GetStartAngle | ( | ) | const |
Definition at line 833 of file shape_arc.cpp.
References center, GetCenter(), m_start, and EDA_ANGLE::Normalize().
Referenced by PNS_LOG_VIEWER_OVERLAY::Arc(), CheckArcGeom(), Collide(), commonParallelProjection(), ConvertToPolyline(), ROUTER_PREVIEW_ITEM::drawLineChain(), ROUTER_PREVIEW_ITEM::drawShape(), sliceContainsPoint(), TransformArcToPolygon(), and update_values().
|
inline |
Definition at line 210 of file shape_arc.h.
References m_width.
Referenced by CREEPAGE_GRAPH::Addshape(), PNS_LOG_VIEWER_OVERLAY::Arc(), PNS::ArcHull(), BOOST_AUTO_TEST_CASE(), Collide(), SHAPE_LINE_CHAIN::Collide(), collideArc2Arc(), BOARD_ADAPTER::createPadWithMargin(), ROUTER_PREVIEW_ITEM::drawShape(), drawShapes(), operator<<(), PNS::LINE_PLACER::SplitAdjacentArcs(), TransformArcToPolygon(), and PNS::ARC::Width().
|
inlinevirtualinherited |
Reimplemented in SHAPE_COMPOUND, and SHAPE_POLY_SET.
Definition at line 108 of file shape.h.
Referenced by ROUTER_PREVIEW_ITEM::ViewDraw().
Find intersection points between this arc and a CIRCLE.
Ignores arc width.
aCircle | Circle to intersect against |
aIpsBuffer | Buffer to store the resulting intersection points (if any) |
Definition at line 326 of file shape_arc.cpp.
References GetCenter(), GetRadius(), CIRCLE::Intersect(), and sliceContainsPoint().
Referenced by collideArc2Arc(), and SHAPE_LINE_CHAIN::SelfIntersectingWithArcs().
Find intersection points between this arc and another arc.
Ignores arc width.
aArc | Arc to intersect against |
aIpsBuffer | Buffer to store the resulting intersection points (if any) |
Definition at line 344 of file shape_arc.cpp.
References GetCenter(), GetRadius(), CIRCLE::Intersect(), and sliceContainsPoint().
Find intersection points between this arc and aSeg, treating aSeg as an infinite line.
Ignores arc width.
aSeg | Line to intersect against (treated as an infinite line) |
aIpsBuffer | Buffer to store the resulting intersection points (if any) |
Definition at line 305 of file shape_arc.cpp.
References SEG::A, SEG::B, GetCenter(), GetRadius(), CIRCLE::IntersectLine(), and sliceContainsPoint().
Referenced by PCB_GRID_HELPER::AlignToArc(), collideArc2Arc(), and ConnectBoardShapes().
|
inline |
Definition at line 308 of file shape_arc.h.
References VECTOR3< T >::Cross(), m_end, m_mid, m_start, v1, and v2.
Referenced by IsClockwise().
|
inline |
Definition at line 317 of file shape_arc.h.
References IsCCW().
Referenced by CREEPAGE_GRAPH::Addshape(), SHAPE_LINE_CHAIN::amendArc(), BOOST_AUTO_TEST_CASE(), ConnectBoardShapes(), GERBER_PLOTTER::plotArc(), SHAPE_LINE_CHAIN::Slice(), PNS::LINE_PLACER::SplitAdjacentArcs(), and SHAPE_LINE_CHAIN::splitArc().
bool SHAPE_ARC::IsEffectiveLine | ( | ) | const |
Definition at line 245 of file shape_arc.cpp.
References m_end, m_mid, m_start, v1, and v2.
Referenced by Collide(), and PCB_ARC::GetEffectiveShape().
|
inlineinherited |
Return true if the shape is a null shape.
true | if null :-) |
Definition at line 166 of file shape.h.
References SHAPE_BASE::m_type, and SH_NULL.
|
inlineoverridevirtual |
void SHAPE_ARC::Mirror | ( | const SEG & | axis | ) |
Definition at line 990 of file shape_arc.cpp.
References m_end, m_mid, m_start, SEG::ReflectPoint(), and update_values().
void SHAPE_ARC::Mirror | ( | const VECTOR2I & | aRef, |
FLIP_DIRECTION | aFlipDirection | ||
) |
Definition at line 971 of file shape_arc.cpp.
References m_end, m_mid, m_start, update_values(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by FABMASTER::loadFootprints().
|
overridevirtual |
Implements SHAPE.
Definition at line 952 of file shape_arc.cpp.
References m_end, m_mid, m_start, and update_values().
Referenced by PNS::COMPONENT_DRAGGER::Drag().
Definition at line 427 of file shape_arc.cpp.
References GetCenter(), GetRadius(), m_end, m_start, CIRCLE::NearestPoint(), and sliceContainsPoint().
Referenced by PCB_POINT_EDITOR::addCorner(), pickSegment(), and snapToNearestTrack().
bool SHAPE_ARC::NearestPoints | ( | const SEG & | aSeg, |
VECTOR2I & | aPtA, | ||
VECTOR2I & | aPtB, | ||
int64_t & | aDistSq | ||
) | const |
Compute closest points between this arc and aSeg.
aPtA | point on this arc (output) |
aPtB | point on the segment (output) |
aDistSq | squared distance between points (output) |
Definition at line 498 of file shape_arc.cpp.
References SEG::A, SEG::B, GetCenter(), GetRadius(), CIRCLE::Intersect(), m_end, m_start, CIRCLE::NearestPoint(), SEG::NearestPoint(), sliceContainsPoint(), and VECTOR2< T >::SquaredDistance().
bool SHAPE_ARC::NearestPoints | ( | const SHAPE_ARC & | aArc, |
VECTOR2I & | aPtA, | ||
VECTOR2I & | aPtB, | ||
int64_t & | aDistSq | ||
) | const |
Compute closest points between this arc and aArc.
aPtA | point on this arc (output) |
aPtB | point on the other arc (output) |
aDistSq | squared distance between points (output) |
Definition at line 629 of file shape_arc.cpp.
References GetCenter(), GetP0(), GetP1(), GetRadius(), CIRCLE::Intersect(), m_end, m_start, CIRCLE::NearestPoint(), sliceContainsPoint(), and VECTOR2< T >::SquaredDistance().
Referenced by Collide(), and extractDiffPairCoupledItems().
bool SHAPE_ARC::NearestPoints | ( | const SHAPE_CIRCLE & | aCircle, |
VECTOR2I & | aPtA, | ||
VECTOR2I & | aPtB, | ||
int64_t & | aDistSq | ||
) | const |
Compute closest points between this arc and aCircle.
aPtA | point on this arc (output) |
aPtB | point on the circle (output) |
aDistSq | squared distance between points (output) |
Definition at line 450 of file shape_arc.cpp.
References GetCenter(), SHAPE_CIRCLE::GetCenter(), SHAPE_CIRCLE::GetCircle(), GetP0(), GetRadius(), SHAPE_CIRCLE::GetRadius(), CIRCLE::Intersect(), m_end, m_start, CIRCLE::NearestPoint(), sliceContainsPoint(), and VECTOR2< T >::SquaredDistance().
bool SHAPE_ARC::NearestPoints | ( | const SHAPE_RECT & | aRect, |
VECTOR2I & | aPtA, | ||
VECTOR2I & | aPtB, | ||
int64_t & | aDistSq | ||
) | const |
Compute closest points between this arc and aRect.
aPtA | point on this arc (output) |
aPtB | point on the rectangle (output) |
aDistSq | squared distance between points (output) |
Definition at line 568 of file shape_arc.cpp.
References SHAPE_RECT::BBox(), SHAPE_LINE_CHAIN::CPoint(), GetCenter(), GetRadius(), CIRCLE::Intersect(), m_end, m_start, BOX2< Vec >::NearestPoint(), CIRCLE::NearestPoint(), SHAPE_RECT::Outline(), sliceContainsPoint(), and VECTOR2< T >::SquaredDistance().
|
inherited |
Definition at line 695 of file wrlfacet.cpp.
References SHAPE::facets.
Referenced by WRL2FACESET::TranslateToSG(), X3DIFACESET::TranslateToSG(), and WRL1FACESET::TranslateToSG().
|
inline |
|
virtualinherited |
Reimplemented in SHAPE_LINE_CHAIN, and SHAPE_POLY_SET.
|
virtualinherited |
Check if point aP lies inside a closed shape.
Always returns false if this shape is not closed.
aPt | point to check |
aUseBBoxCache | gives better performance if the bounding box caches have been generated. |
Reimplemented in SHAPE_LINE_CHAIN_BASE, and SHAPE_POLY_SET.
Definition at line 127 of file shape.cpp.
References SHAPE_POLY_SET::COutline(), ERROR_INSIDE, SHAPE_POLY_SET::OutlineCount(), SHAPE_LINE_CHAIN_BASE::PointInside(), and SHAPE::TransformToPolygon().
void SHAPE_ARC::Reverse | ( | ) |
Definition at line 1000 of file shape_arc.cpp.
References m_end, and m_start.
Referenced by ComputeDogbone(), TEARDROP_MANAGER::findAnchorPointsOnTrack(), CADSTAR_PCB_ARCHIVE_LOADER::getLineChainFromShapes(), CADSTAR_PCB_ARCHIVE_LOADER::makeTracksFromShapes(), and SHAPE_LINE_CHAIN::Reverse().
SHAPE_ARC SHAPE_ARC::Reversed | ( | ) | const |
Definition at line 1006 of file shape_arc.cpp.
References m_end, m_mid, m_start, m_width, and SHAPE_ARC().
Referenced by PNS::NODE::AssembleLine(), BOOST_AUTO_TEST_CASE(), and CONVERT_TOOL::makePolysFromChainedSegs().
Rotate the arc by a given angle about a point.
aCenter | is the rotation center. |
aAngle | rotation angle. |
Implements SHAPE.
Definition at line 961 of file shape_arc.cpp.
References m_end, m_mid, m_start, RotatePoint(), and update_values().
Referenced by commonParallelProjection().
|
inline |
Definition at line 205 of file shape_arc.h.
References m_width.
Referenced by SHAPE_LINE_CHAIN::Insert(), and PNS::ARC::SetWidth().
|
private |
Definition at line 1012 of file shape_arc.cpp.
References ANGLE_0, ANGLE_360, GetCenter(), GetCentralAngle(), GetStartAngle(), and EDA_ANGLE::Normalize().
Referenced by Intersect(), IntersectLine(), NearestPoint(), and NearestPoints().
|
virtualinherited |
Reimplemented in SHAPE_LINE_CHAIN_BASE, and SHAPE_POLY_SET.
Definition at line 115 of file shape.cpp.
References SHAPE_POLY_SET::COutline(), VECTOR2< int32_t >::ECOORD_MAX, ERROR_INSIDE, SHAPE_POLY_SET::OutlineCount(), SHAPE_LINE_CHAIN_BASE::SquaredDistance(), and SHAPE::TransformToPolygon().
Referenced by SHAPE::Distance().
|
overridevirtual |
Fills a SHAPE_POLY_SET with a polygon representation of this shape.
aBuffer | [out] will be filled with the polygonal representation of this shape. |
aError | controls the maximum allowed deviation when converting rounded shapes to segments |
aErrorLoc | controls where the error is placed when approximating rounded shapes |
Implements SHAPE.
Definition at line 1038 of file shape_arc.cpp.
References m_end, m_mid, m_start, m_width, and TransformArcToPolygon().
|
inlineinherited |
Return the type of the shape.
the | type |
Definition at line 98 of file shape.h.
References SHAPE_BASE::m_type.
Referenced by CREEPAGE_GRAPH::Addshape(), PNS::DP_GATEWAYS::BuildFromPrimitivePair(), PNS::BuildHullForPrimitiveShape(), PNS_LOG_VIEWER_FRAME::buildListTree(), SHAPE_POLY_SET::Collide(), Collide(), collideShapes(), collideSingleShapes(), PNS::OPTIMIZER::computeBreakouts(), ROUTER_PREVIEW_ITEM::drawShape(), PNS_LOG_VIEWER_FRAME::drawSimpleShape(), EDA_SHAPE::EDA_SHAPE(), SHAPE::GetClearance(), PNS::HOLE::Hull(), PNS::SOLID::Hull(), DRC_RTREE::QueryColliding(), PNS::HOLE::Radius(), ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM(), PNS::HOLE::SetCenter(), PNS::HOLE::SetRadius(), STROKE_PARAMS::Stroke(), and SHAPE_FILE_IO::Write().
|
inlineinherited |
Definition at line 103 of file shape.h.
References SHAPE_BASE::m_type, and SHAPE_TYPE_asString().
Referenced by Collide().
|
private |
Definition at line 363 of file shape_arc.cpp.
References EDA_ANGLE::AsDegrees(), CalcArcCenter(), BOX2< Vec >::Compute(), GetCentralAngle(), GetStartAngle(), KiROUND(), m_bbox, m_center, m_end, m_mid, m_radius, m_start, and radius.
Referenced by ConstructFromStartEndAngle(), ConstructFromStartEndCenter(), Mirror(), Move(), Rotate(), and SHAPE_ARC().
|
privateinherited |
Definition at line 143 of file wrlfacet.h.
Referenced by SHAPE::CalcShape(), and SHAPE::NewFacet().
|
private |
Definition at line 330 of file shape_arc.h.
Referenced by BBox(), SHAPE_ARC(), and update_values().
|
private |
Definition at line 331 of file shape_arc.h.
Referenced by GetCenter(), SHAPE_ARC(), and update_values().
|
private |
Definition at line 327 of file shape_arc.h.
Referenced by Collide(), ConstructFromStartEndAngle(), ConstructFromStartEndCenter(), ConvertToPolyline(), GetCentralAngle(), GetChord(), GetEndAngle(), GetP1(), IsCCW(), IsEffectiveLine(), Mirror(), Move(), NearestPoint(), NearestPoints(), operator==(), Reverse(), Reversed(), Rotate(), SHAPE_ARC(), TransformToPolygon(), and update_values().
|
private |
Definition at line 326 of file shape_arc.h.
Referenced by ConstructFromStartEndAngle(), ConstructFromStartEndCenter(), GetArcMid(), GetCentralAngle(), IsCCW(), IsEffectiveLine(), Mirror(), Move(), operator==(), Reversed(), Rotate(), SHAPE_ARC(), TransformToPolygon(), and update_values().
|
private |
Definition at line 332 of file shape_arc.h.
Referenced by GetRadius(), SHAPE_ARC(), and update_values().
|
private |
Definition at line 325 of file shape_arc.h.
Referenced by Collide(), ConstructFromStartEndAngle(), ConstructFromStartEndCenter(), ConvertToPolyline(), GetCentralAngle(), GetChord(), GetP0(), GetStartAngle(), IsCCW(), IsEffectiveLine(), Mirror(), Move(), NearestPoint(), NearestPoints(), operator==(), Reverse(), Reversed(), Rotate(), SHAPE_ARC(), TransformToPolygon(), and update_values().
|
protectedinherited |
< type of our shape
Definition at line 119 of file shape.h.
Referenced by SHAPE::Format(), SHAPE::IsNull(), SHAPE_BASE::Type(), and SHAPE_BASE::TypeName().
|
private |
Definition at line 328 of file shape_arc.h.
Referenced by BBox(), Collide(), ConstructFromStartEndAngle(), ConvertToPolyline(), GetWidth(), operator==(), Reversed(), SetWidth(), SHAPE_ARC(), and TransformToPolygon().
|
staticinherited |
This is the minimum precision for all the points in a shape.
Definition at line 131 of file shape.h.
Referenced by DIRECTION_45::BuildInitialTrace(), CompareLength(), CIRCLE::Contains(), EDIT_TOOL::FilletTracks(), CIRCLE::IntersectLine(), and LINE_FILLET_ROUTINE::ProcessLinePair().