|
KiCad PCB EDA Suite
|
#include <tool/arc_tangent_seed.h>#include <array>#include <span>#include <bezier_curves.h>#include <eda_shape.h>#include <geometry/shape_arc.h>#include <geometry/shape_line_chain.h>#include <geometry/shape_poly_set.h>Go to the source code of this file.
Functions | |
| static std::optional< VECTOR2D > | normalized (const VECTOR2D &aVec) |
| static const VECTOR2I * | nearestEnd (const VECTOR2I &aFirst, const VECTOR2I &aLast, const VECTOR2I &aPoint, std::optional< int > aTolerance=std::nullopt) |
| static std::optional< VECTOR2D > | tangentAtEndpoint (const EDA_SHAPE &aShape, const VECTOR2I &aPoint) |
| std::optional< ARC_TANGENT_SEED > | ArcTangentSeedNear (const EDA_SHAPE &aShape, const VECTOR2I &aNear) |
| Seed the next tangent arc from whichever endpoint of aShape lies nearest aNear. | |
| static std::optional< ARC_TANGENT_SEED > | polylineSeedAt (std::span< const VECTOR2I > aVertices, bool aClosed, const VECTOR2I &aPoint, int aTolerance) |
| std::optional< ARC_TANGENT_SEED > | ArcTangentSeedAt (const SEG &aSegment, const VECTOR2I &aPoint, int aTolerance) |
| Tangent seed for a point on or near a segment, arc or Bezier shape. | |
| std::optional< ARC_TANGENT_SEED > | ArcTangentSeedAt (const EDA_SHAPE &aShape, const VECTOR2I &aPoint, int aTolerance) |
| Tangent seed for a point on or near a segment, arc or Bezier shape. | |
| std::optional< ARC_TANGENT_SEED > ArcTangentSeedAt | ( | const EDA_SHAPE & | aShape, |
| const VECTOR2I & | aPoint, | ||
| int | aTolerance ) |
Tangent seed for a point on or near a segment, arc or Bezier shape.
A point within aTolerance of an endpoint gives the outward direction at that endpoint, and the seed starts at the endpoint itself. Any other point within aTolerance of the shape gives the tangent axis at the nearest point of the shape, and the seed starts there.
| aTolerance | is the largest distance in IU between aPoint and the shape. |
Definition at line 163 of file arc_tangent_seed.cpp.
References ARC, ArcTangentSeedAt(), BEZIER, SHAPE_POLY_SET::CHole(), BOX2< Vec >::Contains(), SHAPE_POLY_SET::COutline(), end, EDA_SHAPE::GetArcMid(), EDA_SHAPE::GetBezierC1(), EDA_SHAPE::GetBezierC2(), SHAPE_ARC::GetCenter(), EDA_SHAPE::GetEnd(), BEZIER_POLY::GetPoly(), EDA_SHAPE::GetPolyShape(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), SHAPE_POLY_SET::HoleCount(), BOX2< Vec >::Inflate(), BOX2< Vec >::Merge(), nearestEnd(), SHAPE_ARC::NearestPoint(), normalized(), SHAPE_POLY_SET::OutlineCount(), POLY, polylineSeedAt(), radius, SEGMENT, and tangentAtEndpoint().
| std::optional< ARC_TANGENT_SEED > ArcTangentSeedAt | ( | const SEG & | aSegment, |
| const VECTOR2I & | aPoint, | ||
| int | aTolerance ) |
Tangent seed for a point on or near a segment, arc or Bezier shape.
A point within aTolerance of an endpoint gives the outward direction at that endpoint, and the seed starts at the endpoint itself. Any other point within aTolerance of the shape gives the tangent axis at the nearest point of the shape, and the seed starts there.
| aTolerance | is the largest distance in IU between aPoint and the shape. |
Definition at line 155 of file arc_tangent_seed.cpp.
References SEG::A, SEG::B, and polylineSeedAt().
Referenced by ArcTangentSeedAt(), DRAWING_TOOL::drawManagedShape(), and EE_GRAPHIC_TOOL::drawManagedShape().
| std::optional< ARC_TANGENT_SEED > ArcTangentSeedNear | ( | const EDA_SHAPE & | aShape, |
| const VECTOR2I & | aNear ) |
Seed the next tangent arc from whichever endpoint of aShape lies nearest aNear.
Used to chain arcs, where aNear is the last point the user clicked on the previous arc.
Definition at line 93 of file arc_tangent_seed.cpp.
References EDA_SHAPE::GetEnd(), EDA_SHAPE::GetStart(), nearestEnd(), and tangentAtEndpoint().
Referenced by DRAWING_TOOL::DrawArc(), and EE_GRAPHIC_TOOL::DrawArc().
|
static |
Definition at line 44 of file arc_tangent_seed.cpp.
Referenced by ArcTangentSeedAt(), ArcTangentSeedNear(), and polylineSeedAt().
Definition at line 32 of file arc_tangent_seed.cpp.
References VECTOR2< T >::EuclideanNorm().
Referenced by PADS_LAYER_MAPPER::AddLayerNameMapping(), PADS_ATTRIBUTE_MAPPER::AddMapping(), ArcTangentSeedAt(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), KIRTREE::PACKED_RTREE< DATATYPE, ELEMTYPE, NUMDIMS, FANOUT >::Builder::Build(), REMOTE_PROVIDER_SETTINGS::CreateProviderId(), findDirectionIndex(), calc_parser::ESERIES_UTILS::FindDown(), calc_parser::ESERIES_UTILS::FindNearest(), REMOTE_PROVIDER_SETTINGS::FindProviderByMetadataUrl(), calc_parser::ESERIES_UTILS::FindUp(), PADS_ATTRIBUTE_MAPPER::GetKiCadFieldName(), isInstalledPropertyName(), PADS_SCH_BINARY::NormalizeAngle(), PADS_ATTRIBUTE_MAPPER::normalizeAttrName(), PADS_LAYER_MAPPER::normalizeLayerName(), normalizeQueryFieldAliases(), normalizeRotation(), PCB_IO_EASYEDAPRO_PARSER::NormalizeSafeSpacing(), OleRenderWmf(), MARGIN_OFFSET_BINDER::parseInput(), PADS_LAYER_MAPPER::ParseLayerName(), polylineSeedAt(), SPRINT_LAYOUT_PARSER::processText(), SCH_CONNECTIVITY::BUS_PARSE_CACHE::SetAliases(), SNAP_LINE_MANAGER::SetDirections(), and tangentAtEndpoint().
|
static |
Definition at line 107 of file arc_tangent_seed.cpp.
References SEG::Distance(), end, nearestEnd(), and normalized().
Referenced by ArcTangentSeedAt(), and ArcTangentSeedAt().
|
static |
Definition at line 59 of file arc_tangent_seed.cpp.
References ARC, end, EDA_SHAPE::GetArcMid(), EDA_SHAPE::getCenter(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), normalized(), and SEGMENT.
Referenced by ArcTangentSeedAt(), and ArcTangentSeedNear().