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 | 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 |
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 37 of file shape_arc.h.
|
protectedinherited |
|
inline |
Definition at line 41 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 44 of file shape_arc.cpp.
References 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 65 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 77 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 82 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 403 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 84 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 244 of file shape_arc.cpp.
References SEG::A, SEG::B, Collide(), SHAPE_CIRCLE::Collide(), VECTOR2< T >::EuclideanNorm(), GetCenter(), GetCentralAngle(), SHAPE_CIRCLE::GetCircle(), CIRCLE::Intersect(), m_end, m_start, SEG::NearestPoint(), 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 1172 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 440 of file shape_arc.cpp.
References ANGLE_0, BBox(), CIRCLE::Center, VECTOR2< T >::Distance(), VECTOR2< T >::EuclideanNorm(), GetCenter(), GetCentralAngle(), GetEndAngle(), GetStartAngle(), KiROUND(), m_end, m_start, m_width, CIRCLE::NearestPoint(), EDA_ANGLE::Normalize(), 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 194 of file shape_arc.cpp.
References CalcArcCenter(), 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 212 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 560 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 232 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 108 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 46 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 116 of file shape_arc.h.
References m_mid.
Referenced by CreepageGraph::Addshape(), approximateLineChainWithArcs(), BOOST_AUTO_TEST_CASE(), 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 523 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(), Collide(), collideArc2Arc(), ConnectBoardShapes(), ConvertToPolyline(), ROUTER_PREVIEW_ITEM::drawLineChain(), ROUTER_PREVIEW_ITEM::drawShape(), GetCentralAngle(), GetEndAngle(), GetStartAngle(), Intersect(), IntersectLine(), FABMASTER::loadFootprints(), NearestPoint(), 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 538 of file shape_arc.cpp.
References ANGLE_360, 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 198 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 54 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 515 of file shape_arc.cpp.
References 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 529 of file shape_arc.cpp.
References std::abs(), EDA_ANGLE::AsRadians(), GetCentralAngle(), and GetRadius().
|
inline |
Definition at line 114 of file shape_arc.h.
References m_start.
Referenced by PNS::NODE::Add(), CreepageGraph::Addshape(), PCB_GRID_HELPER::AlignToArc(), PNS::ARC::Anchor(), approximateLineChainWithArcs(), BOOST_AUTO_TEST_CASE(), DIRECTION_45::BuildInitialTrace(), 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::IsArcStart(), GEOM_TEST::IsOutlineValid(), FABMASTER::loadFootprints(), CADSTAR_SCH_ARCHIVE_LOADER::loadShapeVertices(), CONVERT_TOOL::makePolysFromChainedSegs(), makeWireFromChain(), PNS_KICAD_IFACE::modifyBoardItem(), SHAPE_LINE_CHAIN::NearestPoint(), 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 115 of file shape_arc.h.
References m_end.
Referenced by PNS::NODE::Add(), PNS::MEANDERED_LINE::AddArc(), PCB_POINT_EDITOR::addCorner(), CreepageGraph::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(), 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 554 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(), extractDiffPairCoupledItems(), GetLength(), Intersect(), IntersectLine(), NearestPoint(), OUTSET_ROUTINE::ProcessItem(), SHAPE_LINE_CHAIN::SelfIntersectingWithArcs(), STROKE_PARAMS::Stroke(), and TransformArcToPolygon().
EDA_ANGLE SHAPE_ARC::GetStartAngle | ( | ) | const |
Definition at line 507 of file shape_arc.cpp.
References 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 168 of file shape_arc.h.
References m_width.
Referenced by CreepageGraph::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 316 of file shape_arc.cpp.
References GetCenter(), GetRadius(), CIRCLE::Intersect(), and sliceContainsPoint().
Referenced by Collide(), 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 334 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 295 of file shape_arc.cpp.
References SEG::A, SEG::B, GetCenter(), GetRadius(), CIRCLE::IntersectLine(), and sliceContainsPoint().
Referenced by PCB_GRID_HELPER::AlignToArc(), Collide(), collideArc2Arc(), and ConnectBoardShapes().
|
inline |
Definition at line 264 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 273 of file shape_arc.h.
References IsCCW().
Referenced by CreepageGraph::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().
|
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 664 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 645 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 626 of file shape_arc.cpp.
References m_end, m_mid, m_start, and update_values().
Referenced by PNS::COMPONENT_DRAGGER::Drag().
Definition at line 417 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().
|
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 126 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 674 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 680 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 635 of file shape_arc.cpp.
References m_end, m_mid, m_start, RotatePoint(), and update_values().
Referenced by commonParallelProjection().
|
inline |
Definition at line 163 of file shape_arc.h.
References m_width.
Referenced by BOOST_AUTO_TEST_CASE(), SHAPE_LINE_CHAIN::Insert(), and PNS::ARC::SetWidth().
|
private |
Definition at line 686 of file shape_arc.cpp.
References ANGLE_0, ANGLE_360, GetCenter(), GetCentralAngle(), GetStartAngle(), and EDA_ANGLE::Normalize().
Referenced by Intersect(), IntersectLine(), and NearestPoint().
|
virtualinherited |
Reimplemented in SHAPE_LINE_CHAIN_BASE, and SHAPE_POLY_SET.
Definition at line 114 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 712 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 CreepageGraph::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 353 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, and m_start.
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 286 of file shape_arc.h.
Referenced by BBox(), SHAPE_ARC(), and update_values().
|
private |
Definition at line 287 of file shape_arc.h.
Referenced by GetCenter(), SHAPE_ARC(), and update_values().
|
private |
Definition at line 283 of file shape_arc.h.
Referenced by Collide(), ConstructFromStartEndAngle(), ConstructFromStartEndCenter(), ConvertToPolyline(), GetCentralAngle(), GetChord(), GetEndAngle(), GetP1(), IsCCW(), Mirror(), Move(), NearestPoint(), operator==(), Reverse(), Reversed(), Rotate(), SHAPE_ARC(), TransformToPolygon(), and update_values().
|
private |
Definition at line 282 of file shape_arc.h.
Referenced by ConstructFromStartEndAngle(), ConstructFromStartEndCenter(), GetArcMid(), GetCentralAngle(), IsCCW(), Mirror(), Move(), operator==(), Reversed(), Rotate(), SHAPE_ARC(), TransformToPolygon(), and update_values().
|
private |
Definition at line 288 of file shape_arc.h.
Referenced by GetRadius(), SHAPE_ARC(), and update_values().
|
private |
Definition at line 281 of file shape_arc.h.
Referenced by Collide(), ConstructFromStartEndAngle(), ConstructFromStartEndCenter(), ConvertToPolyline(), GetCentralAngle(), GetChord(), GetP0(), GetStartAngle(), IsCCW(), Mirror(), Move(), NearestPoint(), 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 284 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 BOOST_AUTO_TEST_CASE(), DIRECTION_45::BuildInitialTrace(), CompareLength(), CIRCLE::Contains(), EDIT_TOOL::FilletTracks(), CIRCLE::IntersectLine(), and LINE_FILLET_ROUTINE::ProcessLinePair().