KiCad PCB EDA Suite
Loading...
Searching...
No Matches
microwave_inductor.cpp File Reference
#include <base_units.h>
#include <board_commit.h>
#include <board_design_settings.h>
#include <pad.h>
#include <pcb_shape.h>
#include <footprint.h>
#include <confirm.h>
#include <dialogs/dialog_text_entry.h>
#include <geometry/geometry_utils.h>
#include <math/util.h>
#include <microwave/microwave_tool.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <pcb_edit_frame.h>
#include <validators.h>

Go to the source code of this file.

Macros

#define ADJUST_SIZE   0.988
 

Enumerations

enum class  INDUCTOR_S_SHAPE_RESULT { OK , TOO_LONG , TOO_SHORT , NO_REPR }
 

Functions

static void gen_arc (std::vector< VECTOR2I > &aBuffer, const VECTOR2I &aStartPoint, const VECTOR2I &aCenter, const EDA_ANGLE &a_ArcAngle)
 Function gen_arc generates an arc using arc approximation by lines: Center aCenter Angle "angle" (in 0.1 deg)
 
static INDUCTOR_S_SHAPE_RESULT BuildCornersList_S_Shape (std::vector< VECTOR2I > &aBuffer, const VECTOR2I &aStartPoint, const VECTOR2I &aEndPoint, int aLength, int aWidth)
 Function BuildCornersList_S_Shape Create a path like a S-shaped coil.
 

Macro Definition Documentation

◆ ADJUST_SIZE

#define ADJUST_SIZE   0.988

Enumeration Type Documentation

◆ INDUCTOR_S_SHAPE_RESULT

enum class INDUCTOR_S_SHAPE_RESULT
strong
Enumerator
OK 
TOO_LONG 

S-shape constructed.

TOO_SHORT 

Requested length too long.

NO_REPR 

Requested length too short.

Definition at line 77 of file microwave_inductor.cpp.

Function Documentation

◆ BuildCornersList_S_Shape()

static INDUCTOR_S_SHAPE_RESULT BuildCornersList_S_Shape ( std::vector< VECTOR2I > &  aBuffer,
const VECTOR2I aStartPoint,
const VECTOR2I aEndPoint,
int  aLength,
int  aWidth 
)
static

Function BuildCornersList_S_Shape Create a path like a S-shaped coil.

Parameters
aBuffer= a buffer where to store points (ends of segments)
aStartPoint= starting point of the path
aEndPoint= ending point of the path
aLength= full length of the path
aWidth= segment width

Definition at line 95 of file microwave_inductor.cpp.

References ADJUST_SIZE, ANGLE_180, ANGLE_90, gen_arc(), KiROUND(), NO_REPR, OK, RotatePoint(), sign(), TOO_LONG, TOO_SHORT, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by MICROWAVE_TOOL::createMicrowaveInductor().

◆ gen_arc()

static void gen_arc ( std::vector< VECTOR2I > &  aBuffer,
const VECTOR2I aStartPoint,
const VECTOR2I aCenter,
const EDA_ANGLE a_ArcAngle 
)
static

Function gen_arc generates an arc using arc approximation by lines: Center aCenter Angle "angle" (in 0.1 deg)

Parameters
aBuffer= a buffer to store points.
aStartPoint= starting point of arc.
aCenter= arc centre.
a_ArcAngle= arc length in 0.1 degrees.

Definition at line 50 of file microwave_inductor.cpp.

References ARC_HIGH_DEF, EDA_ANGLE::AsRadians(), VECTOR2< T >::EuclideanNorm(), GetArcToSegmentCount(), KiROUND(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BuildCornersList_S_Shape().