KiCad PCB EDA Suite
Loading...
Searching...
No Matches
odb_feature.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 * Author: SYSUEric <[email protected]>.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include "odb_feature.h"
22
23#include <sstream>
24#include <map>
25
26#include <wx/log.h>
27
28#include "footprint.h"
29#include "pad.h"
30#include "pcb_shape.h"
31#include "odb_defines.h"
32#include "pcb_track.h"
33#include "pcb_textbox.h"
34#include "pcb_table.h"
35#include "zone.h"
36#include "board.h"
38#include "geometry/eda_angle.h"
39#include "odb_eda_data.h"
40#include "pcb_io_odbpp.h"
41#include <callback_gal.h>
42#include <string_utils.h>
43
44
45void FEATURES_MANAGER::AddFeatureLine( const VECTOR2I& aStart, const VECTOR2I& aEnd,
46 uint64_t aWidth )
47{
48 AddFeature<ODB_LINE>( ODB::AddXY( aStart ), ODB::AddXY( aEnd ),
50}
51
52
53void FEATURES_MANAGER::AddFeatureArc( const VECTOR2I& aStart, const VECTOR2I& aEnd,
54 const VECTOR2I& aCenter, uint64_t aWidth,
55 ODB_DIRECTION aDirection )
56{
57 AddFeature<ODB_ARC>( ODB::AddXY( aStart ), ODB::AddXY( aEnd ), ODB::AddXY( aCenter ),
58 AddCircleSymbol( ODB::SymDouble2String( aWidth ) ), aDirection );
59}
60
61
62void FEATURES_MANAGER::AddPadCircle( const VECTOR2I& aCenter, uint64_t aDiameter,
63 const EDA_ANGLE& aAngle, bool aMirror,
64 double aResize /*= 1.0 */ )
65{
67 AddCircleSymbol( ODB::SymDouble2String( aDiameter ) ), aAngle, aMirror,
68 aResize );
69}
70
71
72bool FEATURES_MANAGER::AddContour( const SHAPE_POLY_SET& aPolySet, int aOutline /*= 0*/,
73 FILL_T aFillType /*= FILL_T::FILLED_SHAPE*/ )
74{
75 // todo: args modify aPolySet.Polygon( aOutline ) instead of aPolySet
76
77 if( aPolySet.OutlineCount() < ( aOutline + 1 ) )
78 return false;
79
80 AddFeatureSurface( aPolySet.Polygon( aOutline ), aFillType );
81
82 return true;
83}
84
85
87{
88 int stroke_width = aShape.GetWidth();
89
90 switch( aShape.GetShape() )
91 {
92 case SHAPE_T::CIRCLE:
93 {
94 int diameter = aShape.GetRadius() * 2;
96 wxString innerDim = ODB::SymDouble2String( ( diameter - stroke_width / 2 ) );
97 wxString outerDim = ODB::SymDouble2String( ( stroke_width + diameter ) );
98
99 if( aShape.IsSolidFill() )
101 else
102 AddFeature<ODB_PAD>( ODB::AddXY( center ), AddRoundDonutSymbol( outerDim, innerDim ) );
103
104 break;
105 }
106
108 {
109 // ODB++ donut_rc symbols degenerate when the corner radius is smaller than half the
110 // line width, and some viewers drop the feature entirely. Emit the rectangle as a
111 // filled pad for the fill (if any) plus four line segments for the stroke, matching
112 // how a rectangle drawn with the line tool is exported.
113 if( aShape.IsSolidFill() )
114 {
115 int width = std::abs( aShape.GetRectangleWidth() );
116 int height = std::abs( aShape.GetRectangleHeight() );
118
121 ODB::SymDouble2String( height ) ) );
122 }
123
124 if( stroke_width > 0 )
125 {
126 std::vector<VECTOR2I> corners = aShape.GetRectCorners();
127
128 for( size_t ii = 0; ii < corners.size(); ++ii )
129 AddFeatureLine( corners[ii], corners[( ii + 1 ) % corners.size()], stroke_width );
130 }
131
132 break;
133 }
134
135 case SHAPE_T::POLY:
136 {
137 int soldermask_min_thickness = 0;
138
139 // TODO: check if soldermask_min_thickness should be Stroke width
140
141 if( aLayer != UNDEFINED_LAYER && LSET( { F_Mask, B_Mask } ).Contains( aLayer ) )
142 soldermask_min_thickness = stroke_width;
143
144 int maxError = m_board->GetDesignSettings().m_MaxError;
145 SHAPE_POLY_SET poly_set;
146
147 if( soldermask_min_thickness == 0 )
148 {
149 poly_set = aShape.GetPolyShape().CloneDropTriangulation();
150 poly_set.Fracture();
151 }
152 else
153 {
154 SHAPE_POLY_SET initialPolys;
155
156 // add shapes inflated by aMinThickness/2 in areas
157 aShape.TransformShapeToPolygon( initialPolys, aLayer, 0, maxError, ERROR_OUTSIDE );
158 aShape.TransformShapeToPolygon( poly_set, aLayer, soldermask_min_thickness / 2 - 1,
159 maxError, ERROR_OUTSIDE );
160
161 poly_set.Simplify();
162 poly_set.Deflate( soldermask_min_thickness / 2 - 1,
164 poly_set.BooleanAdd( initialPolys );
165 poly_set.Fracture();
166 }
167
168 // ODB++ surface features can only represent closed polygons. We add a surface for
169 // the fill of the shape, if present, and add line segments for the outline, if present.
170 if( aShape.IsSolidFill() )
171 {
172 for( int ii = 0; ii < poly_set.OutlineCount(); ++ii )
173 {
174 AddContour( poly_set, ii, FILL_T::FILLED_SHAPE );
175
176 if( stroke_width != 0 )
177 {
178 for( int jj = 0; jj < poly_set.COutline( ii ).SegmentCount(); ++jj )
179 {
180 const SEG& seg = poly_set.COutline( ii ).CSegment( jj );
181 AddFeatureLine( seg.A, seg.B, stroke_width );
182 }
183 }
184 }
185 }
186 else
187 {
188 for( int ii = 0; ii < poly_set.OutlineCount(); ++ii )
189 {
190 for( int jj = 0; jj < poly_set.COutline( ii ).SegmentCount(); ++jj )
191 {
192 const SEG& seg = poly_set.COutline( ii ).CSegment( jj );
193 AddFeatureLine( seg.A, seg.B, stroke_width );
194 }
195 }
196 }
197
198 break;
199 }
200
201 case SHAPE_T::ARC:
202 {
204
205 AddFeatureArc( aShape.GetStart(), aShape.GetEnd(), aShape.GetCenter(), stroke_width, dir );
206 break;
207 }
208
209 case SHAPE_T::BEZIER:
210 {
211 const std::vector<VECTOR2I>& points = aShape.GetBezierPoints();
212
213 for( size_t i = 0; i < points.size() - 1; i++ )
214 AddFeatureLine( points[i], points[i + 1], stroke_width );
215
216 break;
217 }
218
219 case SHAPE_T::SEGMENT:
220 AddFeatureLine( aShape.GetStart(), aShape.GetEnd(), stroke_width );
221 break;
222
223 default:
224 wxLogError( wxT( "Unknown shape when adding ODB++ layer feature" ) );
225 break;
226 }
227
228 if( aShape.IsHatchedFill() )
229 {
230 for( int ii = 0; ii < aShape.GetHatching().OutlineCount(); ++ii )
232 }
233}
234
235
237 FILL_T aFillType /*= FILL_T::FILLED_SHAPE */ )
238{
239 AddFeature<ODB_SURFACE>( aPolygon, aFillType );
240}
241
242
244{
245 FOOTPRINT* fp = aPad.GetParentFootprint();
246 bool mirror = false;
247
248 if( aPad.GetOrientation() != ANGLE_0 )
249 {
250 if( fp && fp->IsFlipped() )
251 mirror = true;
252 }
253
254 int maxError = m_board->GetDesignSettings().m_MaxError;
255
256 VECTOR2I expansion{ 0, 0 };
257
258 if( aLayer != UNDEFINED_LAYER && LSET( { F_Mask, B_Mask } ).Contains( aLayer ) )
259 expansion.x = expansion.y = aPad.GetSolderMaskExpansion( aLayer );
260
261 if( aLayer != UNDEFINED_LAYER && LSET( { F_Paste, B_Paste } ).Contains( aLayer ) )
262 expansion = aPad.GetSolderPasteMargin( aLayer );
263
264 int mask_clearance = expansion.x;
265
266 VECTOR2I plotSize = aPad.GetSize( aLayer ) + 2 * expansion;
267
268 VECTOR2I center = aPad.ShapePos( aLayer );
269
270 wxString width = ODB::SymDouble2String( std::abs( plotSize.x ) );
271 wxString height = ODB::SymDouble2String( std::abs( plotSize.y ) );
272
273 switch( aPad.GetShape( aLayer ) )
274 {
276 {
277 wxString diam = ODB::SymDouble2String( plotSize.x );
278
280 mirror );
281
282 break;
283 }
285 {
286 if( mask_clearance > 0 )
287 {
288 wxString rad = ODB::SymDouble2String( mask_clearance );
289
290 AddFeature<ODB_PAD>( ODB::AddXY( center ), AddRoundRectSymbol( width, height, rad ),
291 aPad.GetOrientation(), mirror );
292 }
293 else
294 {
296 aPad.GetOrientation(), mirror );
297 }
298
299 break;
300 }
301 case PAD_SHAPE::OVAL:
302 {
304 aPad.GetOrientation(), mirror );
305 break;
306 }
308 {
309 wxString rad = ODB::SymDouble2String( aPad.GetRoundRectCornerRadius( aLayer ) );
310
311 AddFeature<ODB_PAD>( ODB::AddXY( center ), AddRoundRectSymbol( width, height, rad ),
312 aPad.GetOrientation(), mirror );
313
314 break;
315 }
317 {
318 int shorterSide = std::min( plotSize.x, plotSize.y );
319 int chamfer = std::max(
320 0, KiROUND( aPad.GetChamferRectRatio( aLayer ) * shorterSide ) );
321 wxString rad = ODB::SymDouble2String( chamfer );
322 int positions = aPad.GetChamferPositions( aLayer );
323
325 AddChamferRectSymbol( width, height, rad, positions ),
326 aPad.GetOrientation(), mirror );
327
328 break;
329 }
331 {
332 SHAPE_POLY_SET outline;
333
334 aPad.TransformShapeToPolygon( outline, aLayer, 0, maxError, ERROR_INSIDE );
335
336 // Shape polygon can have holes so use InflateWithLinkedHoles(), not Inflate()
337 // which can create bad shapes if margin.x is < 0
338
339 if( mask_clearance )
340 {
342 maxError );
343 }
344
345 for( int ii = 0; ii < outline.OutlineCount(); ++ii )
346 AddContour( outline, ii );
347
348 break;
349 }
351 {
352 SHAPE_POLY_SET shape;
353 aPad.MergePrimitivesAsPolygon( aLayer, &shape );
354
355 // as for custome shape, odb++ don't rotate the polygon,
356 // so we rotate the polygon in kicad anticlockwise
357
358 shape.Rotate( aPad.GetOrientation() );
359 shape.Move( center );
360
361 if( expansion != VECTOR2I( 0, 0 ) )
362 {
363 shape.InflateWithLinkedHoles( std::max( expansion.x, expansion.y ),
365 }
366
367 for( int ii = 0; ii < shape.OutlineCount(); ++ii )
368 AddContour( shape, ii );
369
370 break;
371 }
372 default: wxLogError( wxT( "Unknown pad type" ) ); break;
373 }
374}
375
376
377void FEATURES_MANAGER::InitFeatureList( PCB_LAYER_ID aLayer, std::vector<BOARD_ITEM*>& aItems )
378{
379 auto add_track = [&]( PCB_TRACK* track )
380 {
381 auto iter = GetODBPlugin()->GetViaTraceSubnetMap().find( track );
382
383 if( iter == GetODBPlugin()->GetViaTraceSubnetMap().end() )
384 {
385 wxLogError( wxT( "Failed to get subnet track data" ) );
386 return;
387 }
388
389 auto subnet = iter->second;
390
391 if( track->Type() == PCB_TRACE_T )
392 {
393 PCB_SHAPE shape( nullptr, SHAPE_T::SEGMENT );
394 shape.SetStart( track->GetStart() );
395 shape.SetEnd( track->GetEnd() );
396 shape.SetWidth( track->GetWidth() );
397
398 AddShape( shape );
399 subnet->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::COPPER, m_layerName,
400 m_featuresList.size() - 1 );
401 }
402 else if( track->Type() == PCB_ARC_T )
403 {
404 PCB_ARC* arc = static_cast<PCB_ARC*>( track );
405 PCB_SHAPE shape( nullptr, SHAPE_T::ARC );
406 shape.SetArcGeometry( arc->GetStart(), arc->GetMid(), arc->GetEnd() );
407 shape.SetWidth( arc->GetWidth() );
408
409 AddShape( shape );
410
411 subnet->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::COPPER, m_layerName,
412 m_featuresList.size() - 1 );
413 }
414 else
415 {
416 // add via
417 PCB_VIA* via = static_cast<PCB_VIA*>( track );
418
419 bool hole = false;
420
421 if( aLayer != PCB_LAYER_ID::UNDEFINED_LAYER )
422 {
423 hole = m_layerName.Contains( "plugging" );
424 }
425 else
426 {
427 hole = m_layerName.Contains( "drill" ) || m_layerName.Contains( "filling" )
428 || m_layerName.Contains( "capping" );
429 }
430
431 if( hole )
432 {
433 AddViaDrillHole( via, aLayer );
434 subnet->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::HOLE, m_layerName,
435 m_featuresList.size() - 1 );
436
437 // TODO: confirm TOOLING_HOLE
438 // AddSystemAttribute( *m_featuresList.back(), ODB_ATTR::PAD_USAGE::TOOLING_HOLE );
439
440 if( !m_featuresList.empty() )
441 {
444 *m_featuresList.back(),
445 ODB_ATTR::GEOMETRY{ "VIA_RoundD" + std::to_string( via->GetWidth( aLayer ) ) } );
446 }
447 }
448 else
449 {
450 // to draw via copper shape on copper layer
451 AddVia( via, aLayer );
452 subnet->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::COPPER, m_layerName,
453 m_featuresList.size() - 1 );
454
455 if( !m_featuresList.empty() )
456 {
459 *m_featuresList.back(),
460 ODB_ATTR::GEOMETRY{ "VIA_RoundD" + std::to_string( via->GetWidth( aLayer ) ) } );
461 }
462 }
463 }
464 };
465
466 auto add_zone = [&]( ZONE* zone )
467 {
468 SHAPE_POLY_SET zone_shape = zone->GetFilledPolysList( aLayer )->CloneDropTriangulation();
469
470 for( int ii = 0; ii < zone_shape.OutlineCount(); ++ii )
471 {
472 AddContour( zone_shape, ii );
473
474 auto iter = GetODBPlugin()->GetPlaneSubnetMap().find( std::make_pair( aLayer, zone ) );
475
476 if( iter == GetODBPlugin()->GetPlaneSubnetMap().end() )
477 {
478 wxLogError( wxT( "Failed to get subnet plane data" ) );
479 return;
480 }
481
482 iter->second->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::COPPER, m_layerName,
483 m_featuresList.size() - 1 );
484
485 if( zone->IsTeardropArea() && !m_featuresList.empty() )
486 AddSystemAttribute( *m_featuresList.back(), ODB_ATTR::TEAR_DROP{ true } );
487 }
488 };
489
490 auto add_text = [&]( BOARD_ITEM* item )
491 {
492 EDA_TEXT* text_item = nullptr;
493
494 if( PCB_TEXT* tmp_text = dynamic_cast<PCB_TEXT*>( item ) )
495 text_item = static_cast<EDA_TEXT*>( tmp_text );
496 else if( PCB_TEXTBOX* tmp_textbox = dynamic_cast<PCB_TEXTBOX*>( item ) )
497 text_item = static_cast<EDA_TEXT*>( tmp_textbox );
498
499 if( !text_item || !text_item->IsVisible() || text_item->GetShownText( false ).empty() )
500 return;
501
502 auto plot_text = [&]( const VECTOR2I& aPos, const wxString& aTextString,
503 const TEXT_ATTRIBUTES& aAttributes, KIFONT::FONT* aFont,
504 const KIFONT::METRICS& aFontMetrics )
505 {
507
508 TEXT_ATTRIBUTES attributes = aAttributes;
509 int penWidth = attributes.m_StrokeWidth;
510
511 if( penWidth == 0 && attributes.m_Bold ) // Use default values if aPenWidth == 0
512 penWidth =
513 GetPenSizeForBold( std::min( attributes.m_Size.x, attributes.m_Size.y ) );
514
515 if( penWidth < 0 )
516 penWidth = -penWidth;
517
518 attributes.m_StrokeWidth = penWidth;
519
520 std::list<VECTOR2I> pts;
521
522 auto push_pts = [&]()
523 {
524 if( pts.size() < 2 )
525 return;
526
527 // Polylines are only allowed for more than 3 points.
528 // Otherwise, we have to use a line
529
530 if( pts.size() < 3 )
531 {
532 PCB_SHAPE shape( nullptr, SHAPE_T::SEGMENT );
533 shape.SetStart( pts.front() );
534 shape.SetEnd( pts.back() );
535 shape.SetWidth( attributes.m_StrokeWidth );
536
537 AddShape( shape );
539 ODB_ATTR::STRING{ aTextString.ToStdString() } );
540 }
541 else
542 {
543 for( auto it = pts.begin(); std::next( it ) != pts.end(); ++it )
544 {
545 auto it2 = std::next( it );
546 PCB_SHAPE shape( nullptr, SHAPE_T::SEGMENT );
547 shape.SetStart( *it );
548 shape.SetEnd( *it2 );
549 shape.SetWidth( attributes.m_StrokeWidth );
550 AddShape( shape );
551
552 if( !m_featuresList.empty() )
553 {
555 ODB_ATTR::STRING{ aTextString.ToStdString() } );
556 }
557 }
558 }
559
560 pts.clear();
561 };
562
563 CALLBACK_GAL callback_gal(
564 empty_opts,
565 // Stroke callback
566 [&]( const VECTOR2I& aPt1, const VECTOR2I& aPt2 )
567 {
568 if( !pts.empty() )
569 {
570 if( aPt1 == pts.back() )
571 pts.push_back( aPt2 );
572 else if( aPt2 == pts.front() )
573 pts.push_front( aPt1 );
574 else if( aPt1 == pts.front() )
575 pts.push_front( aPt2 );
576 else if( aPt2 == pts.back() )
577 pts.push_back( aPt1 );
578 else
579 {
580 push_pts();
581 pts.push_back( aPt1 );
582 pts.push_back( aPt2 );
583 }
584 }
585 else
586 {
587 pts.push_back( aPt1 );
588 pts.push_back( aPt2 );
589 }
590 },
591 // Polygon callback
592 [&]( const SHAPE_LINE_CHAIN& aPoly )
593 {
594 if( aPoly.PointCount() < 3 )
595 return;
596
597 SHAPE_POLY_SET poly_set;
598 poly_set.AddOutline( aPoly );
599
600 for( int ii = 0; ii < poly_set.OutlineCount(); ++ii )
601 {
602 AddContour( poly_set, ii, FILL_T::FILLED_SHAPE );
603
604 if( !m_featuresList.empty() )
605 {
607 ODB_ATTR::STRING{ aTextString.ToStdString() } );
608 }
609 }
610 } );
611
612 aFont->Draw( &callback_gal, aTextString, aPos, aAttributes, aFontMetrics );
613
614 if( !pts.empty() )
615 push_pts();
616 };
617
618 bool isKnockout = false;
619
620 if( item->Type() == PCB_TEXT_T || item->Type() == PCB_FIELD_T )
621 isKnockout = static_cast<PCB_TEXT*>( item )->IsKnockout();
622 else if( item->Type() == PCB_TEXTBOX_T )
623 isKnockout = static_cast<PCB_TEXTBOX*>( item )->IsKnockout();
624
625 const KIFONT::METRICS& fontMetrics = item->GetFontMetrics();
626 KIFONT::FONT* font = text_item->GetDrawFont( nullptr );
627 wxString shownText( text_item->GetShownText( true ) );
628
629 if( shownText.IsEmpty() )
630 return;
631
632 VECTOR2I pos = text_item->GetTextPos();
633
634 TEXT_ATTRIBUTES attrs = text_item->GetAttributes();
635 attrs.m_StrokeWidth = text_item->GetEffectiveTextPenWidth();
636 attrs.m_Angle = text_item->GetDrawRotation();
637 attrs.m_Multiline = false;
638
639 if( isKnockout )
640 {
641 PCB_TEXT* text = static_cast<PCB_TEXT*>( item );
642 SHAPE_POLY_SET finalpolyset;
643
644 text->TransformTextToPolySet( finalpolyset, 0, m_board->GetDesignSettings().m_MaxError,
645 ERROR_INSIDE );
646 finalpolyset.Fracture();
647
648 for( int ii = 0; ii < finalpolyset.OutlineCount(); ++ii )
649 {
650 AddContour( finalpolyset, ii, FILL_T::FILLED_SHAPE );
651
652 if( !m_featuresList.empty() )
653 {
655 ODB_ATTR::STRING{ shownText.ToStdString() } );
656 }
657 }
658 }
659 else if( text_item->IsMultilineAllowed() )
660 {
661 std::vector<VECTOR2I> positions;
662 wxArrayString strings_list;
663 wxStringSplit( shownText, strings_list, '\n' );
664 positions.reserve( strings_list.Count() );
665
666 text_item->GetLinePositions( nullptr, positions, strings_list.Count() );
667
668 for( unsigned ii = 0; ii < strings_list.Count(); ii++ )
669 {
670 wxString& txt = strings_list.Item( ii );
671 plot_text( positions[ii], txt, attrs, font, fontMetrics );
672 }
673 }
674 else
675 {
676 plot_text( pos, shownText, attrs, font, fontMetrics );
677 }
678 };
679
680
681 auto add_shape = [&]( PCB_SHAPE* shape )
682 {
683 // FOOTPRINT* fp = shape->GetParentFootprint();
684 AddShape( *shape, aLayer );
685 };
686
687 auto add_pad = [&]( PAD* pad )
688 {
689 auto iter = GetODBPlugin()->GetPadSubnetMap().find( pad );
690
691 if( iter == GetODBPlugin()->GetPadSubnetMap().end() )
692 {
693 wxLogError( wxT( "Failed to get subnet top data" ) );
694 return;
695 }
696
697 if( aLayer != PCB_LAYER_ID::UNDEFINED_LAYER )
698 {
699 // FOOTPRINT* fp = pad->GetParentFootprint();
700
701 AddPadShape( *pad, aLayer );
702
703 iter->second->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::COPPER, m_layerName,
704 m_featuresList.size() - 1 );
705 if( !m_featuresList.empty() )
707
708 if( !pad->HasHole() && !m_featuresList.empty() )
709 AddSystemAttribute( *m_featuresList.back(), ODB_ATTR::SMD{ true } );
710 }
711 else
712 {
713 // drill layer round hole or slot hole
714 if( m_layerName.Contains( "drill" ) )
715 {
716 // here we exchange round hole or slot hole into pad to draw in drill layer
717 PAD dummy( *pad );
718 dummy.Padstack().SetMode( PADSTACK::MODE::NORMAL );
719
720 if( pad->GetDrillSizeX() == pad->GetDrillSizeY() )
721 dummy.SetShape( PADSTACK::ALL_LAYERS, PAD_SHAPE::CIRCLE ); // round hole shape
722 else
723 dummy.SetShape( PADSTACK::ALL_LAYERS, PAD_SHAPE::OVAL ); // slot hole shape
724
725 dummy.SetOffset( PADSTACK::ALL_LAYERS,
726 VECTOR2I( 0, 0 ) ); // use hole position not pad position
727 dummy.SetSize( PADSTACK::ALL_LAYERS, pad->GetDrillSize() );
728
729 AddPadShape( dummy, aLayer );
730
731 if( pad->GetAttribute() == PAD_ATTRIB::PTH )
732 {
733 // only plated holes link to subnet
734 iter->second->AddFeatureID( EDA_DATA::FEATURE_ID::TYPE::HOLE, m_layerName,
735 m_featuresList.size() - 1 );
736
737 if( !m_featuresList.empty() )
739 }
740 else
741 {
742 if( !m_featuresList.empty() )
744 }
745 }
746 }
747 // AddSystemAttribute( *m_featuresList.back(),
748 // ODB_ATTR::GEOMETRY{ "PAD_xxxx" } );
749 };
750
751 for( BOARD_ITEM* item : aItems )
752 {
753 switch( item->Type() )
754 {
755 case PCB_TRACE_T:
756 case PCB_ARC_T:
757 case PCB_VIA_T:
758 add_track( static_cast<PCB_TRACK*>( item ) );
759 break;
760
761 case PCB_ZONE_T:
762 add_zone( static_cast<ZONE*>( item ) );
763 break;
764
765 case PCB_PAD_T:
766 add_pad( static_cast<PAD*>( item ) );
767 break;
768
769 case PCB_SHAPE_T:
770 add_shape( static_cast<PCB_SHAPE*>( item ) );
771 break;
772
773 case PCB_TEXT_T:
774 case PCB_FIELD_T:
775 add_text( item );
776 break;
777
778 case PCB_TEXTBOX_T:
779 add_text( item );
780
781 if( static_cast<PCB_TEXTBOX*>( item )->IsBorderEnabled() )
782 add_shape( static_cast<PCB_TEXTBOX*>( item ) );
783
784 break;
785
786 case PCB_TABLE_T:
787 {
788 PCB_TABLE* table = static_cast<PCB_TABLE*>( item );
789
790 for( PCB_TABLECELL* cell : table->GetCells() )
791 add_text( cell );
792
793 table->DrawBorders(
794 [&]( const VECTOR2I& aPt1, const VECTOR2I& aPt2, const STROKE_PARAMS& aStroke )
795 {
796 int lineWidth = aStroke.GetWidth();
797
798 if( lineWidth > 0 )
799 AddFeatureLine( aPt1, aPt2, lineWidth );
800 } );
801
802 break;
803 }
804
805 case PCB_DIMENSION_T:
806 case PCB_TARGET_T:
808 case PCB_DIM_LEADER_T:
809 case PCB_DIM_CENTER_T:
810 case PCB_DIM_RADIAL_T:
812 //TODO: Add support for dimensions
813 break;
814
815 case PCB_BARCODE_T:
816 //TODO: Add support for barcodes
817 break;
818
819 default:
820 break;
821 }
822 }
823}
824
825
827{
828 if( !aVia->FlashLayer( aLayer ) )
829 return;
830
831 PAD dummy( nullptr ); // default pad shape is circle
832 dummy.SetPadstack( aVia->Padstack() );
833 dummy.SetPosition( aVia->GetStart() );
834
835 AddPadShape( dummy, aLayer );
836}
837
838
840{
841 PAD dummy( nullptr ); // default pad shape is circle
842 int hole = aVia->GetDrillValue();
843 dummy.SetPosition( aVia->GetStart() );
844 dummy.SetSize( PADSTACK::ALL_LAYERS, VECTOR2I( hole, hole ) );
845
846 AddPadShape( dummy, aLayer );
847}
848
849
850void FEATURES_MANAGER::GenerateProfileFeatures( std::ostream& ost ) const
851{
852 ost << "UNITS=" << PCB_IO_ODBPP::m_unitsStr << std::endl;
853 ost << "#\n#Num Features\n#" << std::endl;
854 ost << "F " << m_featuresList.size() << std::endl;
855
856 if( m_featuresList.empty() )
857 return;
858
859 ost << "#\n#Layer features\n#" << std::endl;
860
861 for( const auto& feat : m_featuresList )
862 {
863 feat->WriteFeatures( ost );
864 }
865}
866
867
868void FEATURES_MANAGER::GenerateFeatureFile( std::ostream& ost ) const
869{
870 ost << "UNITS=" << PCB_IO_ODBPP::m_unitsStr << std::endl;
871 ost << "#\n#Num Features\n#" << std::endl;
872 ost << "F " << m_featuresList.size() << std::endl << std::endl;
873
874 if( m_featuresList.empty() )
875 return;
876
877 ost << "#\n#Feature symbol names\n#" << std::endl;
878
879 for( const auto& [n, name] : m_allSymMap )
880 {
881 ost << "$" << n << " " << name << std::endl;
882 }
883
884 WriteAttributes( ost );
885
886 ost << "#\n#Layer features\n#" << std::endl;
887
888 for( const auto& feat : m_featuresList )
889 {
890 feat->WriteFeatures( ost );
891 }
892}
893
894
895void ODB_FEATURE::WriteFeatures( std::ostream& ost )
896{
897 switch( GetFeatureType() )
898 {
899 case FEATURE_TYPE::LINE: ost << "L "; break;
900
901 case FEATURE_TYPE::ARC: ost << "A "; break;
902
903 case FEATURE_TYPE::PAD: ost << "P "; break;
904
905 case FEATURE_TYPE::SURFACE: ost << "S "; break;
906 default: return;
907 }
908
909 WriteRecordContent( ost );
910 ost << std::endl;
911}
912
913
914void ODB_LINE::WriteRecordContent( std::ostream& ost )
915{
916 ost << m_start.first << " " << m_start.second << " " << m_end.first << " " << m_end.second
917 << " " << m_symIndex << " P 0";
918
919 WriteAttributes( ost );
920}
921
922
923void ODB_ARC::WriteRecordContent( std::ostream& ost )
924{
925 ost << m_start.first << " " << m_start.second << " " << m_end.first << " " << m_end.second
926 << " " << m_center.first << " " << m_center.second << " " << m_symIndex << " P 0 "
927 << ( m_direction == ODB_DIRECTION::CW ? "Y" : "N" );
928
929 WriteAttributes( ost );
930}
931
932
933void ODB_PAD::WriteRecordContent( std::ostream& ost )
934{
935 ost << m_center.first << " " << m_center.second << " ";
936
937 // TODO: support resize symbol
938 // ost << "-1" << " " << m_symIndex << " "
939 // << m_resize << " P 0 ";
940
941 ost << m_symIndex << " P 0 ";
942
943 if( m_mirror )
944 ost << "9 " << ODB::Double2String( m_angle.Normalize().AsDegrees() );
945 else
946 ost << "8 " << ODB::Double2String( ( ANGLE_360 - m_angle ).Normalize().AsDegrees() );
947
948 WriteAttributes( ost );
949}
950
951
952ODB_SURFACE::ODB_SURFACE( uint32_t aIndex, const SHAPE_POLY_SET::POLYGON& aPolygon,
953 FILL_T aFillType /*= FILL_T::FILLED_SHAPE*/ ) : ODB_FEATURE( aIndex )
954{
955 if( !aPolygon.empty() && aPolygon[0].PointCount() >= 3 )
956 {
957 m_surfaces = std::make_unique<ODB_SURFACE_DATA>( aPolygon );
958 if( aFillType != FILL_T::NO_FILL )
959 {
960 m_surfaces->AddPolygonHoles( aPolygon );
961 }
962 }
963 else
964 {
965 delete this;
966 }
967}
968
969
970void ODB_SURFACE::WriteRecordContent( std::ostream& ost )
971{
972 ost << "P 0";
973 WriteAttributes( ost );
974 ost << std::endl;
975 m_surfaces->WriteData( ost );
976 ost << "SE";
977}
978
979
981{
982 const std::vector<VECTOR2I>& pts = aPolygon[0].CPoints();
983 if( !pts.empty() )
984 {
985 if( m_polygons.empty() )
986 {
987 m_polygons.resize( 1 );
988 }
989
990 m_polygons.at( 0 ).reserve( pts.size() );
991 m_polygons.at( 0 ).emplace_back( pts.back() );
992
993 for( size_t jj = 0; jj < pts.size(); ++jj )
994 {
995 m_polygons.at( 0 ).emplace_back( pts.at( jj ) );
996 }
997 }
998}
999
1000
1002{
1003 for( size_t ii = 1; ii < aPolygon.size(); ++ii )
1004 {
1005 wxCHECK2( aPolygon[ii].PointCount() >= 3, continue );
1006
1007 const std::vector<VECTOR2I>& hole = aPolygon[ii].CPoints();
1008
1009 if( hole.empty() )
1010 continue;
1011
1012 if( m_polygons.size() <= ii )
1013 {
1014 m_polygons.resize( ii + 1 );
1015
1016 m_polygons[ii].reserve( hole.size() );
1017 }
1018
1019 m_polygons.at( ii ).emplace_back( hole.back() );
1020
1021 for( size_t jj = 0; jj < hole.size(); ++jj )
1022 {
1023 m_polygons.at( ii ).emplace_back( hole[jj] );
1024 }
1025 }
1026}
1027
1028
1029void ODB_SURFACE_DATA::WriteData( std::ostream& ost ) const
1030{
1031 ODB::CHECK_ONCE is_island;
1032
1033 for( const auto& contour : m_polygons )
1034 {
1035 if( contour.empty() )
1036 continue;
1037
1038 ost << "OB " << ODB::AddXY( contour.back().m_end ).first << " "
1039 << ODB::AddXY( contour.back().m_end ).second << " ";
1040
1041 if( is_island() )
1042 ost << "I";
1043 else
1044 ost << "H";
1045 ost << std::endl;
1046
1047 for( const auto& line : contour )
1048 {
1049 if( SURFACE_LINE::LINE_TYPE::SEGMENT == line.m_type )
1050 ost << "OS " << ODB::AddXY( line.m_end ).first << " "
1051 << ODB::AddXY( line.m_end ).second << std::endl;
1052 else
1053 ost << "OC " << ODB::AddXY( line.m_end ).first << " "
1054 << ODB::AddXY( line.m_end ).second << " " << ODB::AddXY( line.m_center ).first
1055 << " " << ODB::AddXY( line.m_center ).second << " "
1056 << ( line.m_direction == ODB_DIRECTION::CW ? "Y" : "N" ) << std::endl;
1057 }
1058 ost << "OE" << std::endl;
1059 }
1060}
const char * name
@ ERROR_OUTSIDE
@ ERROR_INSIDE
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition box2.h:990
void WriteAttributes(std::ostream &ost, const std::string &prefix="") const
void AddSystemAttribute(Tr &r, Ta v)
void WriteAttributes(std::ostream &ost) const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:84
FOOTPRINT * GetParentFootprint() const
const SHAPE_POLY_SET & GetHatching() const
int GetRectangleWidth() const
SHAPE_POLY_SET & GetPolyShape()
int GetRadius() const
SHAPE_T GetShape() const
Definition eda_shape.h:185
bool IsHatchedFill() const
Definition eda_shape.h:140
bool IsSolidFill() const
Definition eda_shape.h:133
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition eda_shape.h:232
void SetStart(const VECTOR2I &aStart)
Definition eda_shape.h:194
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
Definition eda_shape.h:190
std::vector< VECTOR2I > GetRectCorners() const
const std::vector< VECTOR2I > & GetBezierPoints() const
Definition eda_shape.h:337
void SetEnd(const VECTOR2I &aEnd)
Definition eda_shape.h:236
void SetArcGeometry(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Set the three controlling points for an arc.
int GetRectangleHeight() const
bool IsClockwiseArc() const
void SetWidth(int aWidth)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition eda_text.h:93
const VECTOR2I & GetTextPos() const
Definition eda_text.h:298
bool IsMultilineAllowed() const
Definition eda_text.h:222
virtual bool IsVisible() const
Definition eda_text.h:212
virtual EDA_ANGLE GetDrawRotation() const
Definition eda_text.h:404
virtual KIFONT::FONT * GetDrawFont(const RENDER_SETTINGS *aSettings) const
Definition eda_text.cpp:666
const TEXT_ATTRIBUTES & GetAttributes() const
Definition eda_text.h:256
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
Definition eda_text.cpp:465
void GetLinePositions(const RENDER_SETTINGS *aSettings, std::vector< VECTOR2I > &aPositions, int aLineCount) const
Populate aPositions with the position of each line of a multiline text, according to the vertical jus...
Definition eda_text.cpp:941
virtual wxString GetShownText(bool aAllowExtraText, int aDepth=0) const
Return the string actually shown after processing of the base text.
Definition eda_text.h:125
void AddPadShape(const PAD &aPad, PCB_LAYER_ID aLayer)
void AddShape(const PCB_SHAPE &aShape, PCB_LAYER_ID aLayer=UNDEFINED_LAYER)
uint32_t AddRectSymbol(const wxString &aWidth, const wxString &aHeight)
void AddVia(const PCB_VIA *aVia, PCB_LAYER_ID aLayer)
PCB_IO_ODBPP * GetODBPlugin()
void InitFeatureList(PCB_LAYER_ID aLayer, std::vector< BOARD_ITEM * > &aItems)
void AddFeatureLine(const VECTOR2I &aStart, const VECTOR2I &aEnd, uint64_t aWidth)
void AddFeatureArc(const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, uint64_t aWidth, ODB_DIRECTION aDirection)
std::map< uint32_t, wxString > m_allSymMap
void GenerateFeatureFile(std::ostream &ost) const
void AddViaDrillHole(const PCB_VIA *aVia, PCB_LAYER_ID aLayer)
void AddPadCircle(const VECTOR2I &aCenter, uint64_t aDiameter, const EDA_ANGLE &aAngle, bool aMirror, double aResize=1.0)
void AddFeatureSurface(const SHAPE_POLY_SET::POLYGON &aPolygon, FILL_T aFillType=FILL_T::FILLED_SHAPE)
uint32_t AddRoundRectSymbol(const wxString &aWidth, const wxString &aHeight, const wxString &aRadius)
wxString m_layerName
uint32_t AddOvalSymbol(const wxString &aWidth, const wxString &aHeight)
void GenerateProfileFeatures(std::ostream &ost) const
std::list< std::unique_ptr< ODB_FEATURE > > m_featuresList
void AddFeature(Args &&... args)
uint32_t AddCircleSymbol(const wxString &aDiameter)
Definition odb_feature.h:96
uint32_t AddChamferRectSymbol(const wxString &aWidth, const wxString &aHeight, const wxString &aRadius, int aPositions)
uint32_t AddRoundDonutSymbol(const wxString &aOuterDim, const wxString &aInnerDim)
bool AddContour(const SHAPE_POLY_SET &aPolySet, int aOutline=0, FILL_T aFillType=FILL_T::FILLED_SHAPE)
bool IsFlipped() const
Definition footprint.h:602
FONT is an abstract base class for both outline and stroke fonts.
Definition font.h:98
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
Definition lset.h:63
std::pair< wxString, wxString > m_end
std::pair< wxString, wxString > m_start
uint32_t m_symIndex
virtual void WriteRecordContent(std::ostream &ost) override
ODB_DIRECTION m_direction
std::pair< wxString, wxString > m_center
virtual void WriteRecordContent(std::ostream &ost)=0
virtual void WriteFeatures(std::ostream &ost)
virtual FEATURE_TYPE GetFeatureType()=0
ODB_FEATURE(uint32_t aIndex)
virtual void WriteRecordContent(std::ostream &ost) override
std::pair< wxString, wxString > m_start
std::pair< wxString, wxString > m_end
uint32_t m_symIndex
uint32_t m_symIndex
virtual void WriteRecordContent(std::ostream &ost) override
bool m_mirror
EDA_ANGLE m_angle
std::pair< wxString, wxString > m_center
void WriteData(std::ostream &ost) const
std::vector< std::vector< SURFACE_LINE > > m_polygons
ODB_SURFACE_DATA(const SHAPE_POLY_SET::POLYGON &aPolygon)
void AddPolygonHoles(const SHAPE_POLY_SET::POLYGON &aPolygon)
std::unique_ptr< ODB_SURFACE_DATA > m_surfaces
virtual void WriteRecordContent(std::ostream &ost) override
ODB_SURFACE(uint32_t aIndex, const SHAPE_POLY_SET::POLYGON &aPolygon, FILL_T aFillType=FILL_T::FILLED_SHAPE)
@ NORMAL
Shape is the same on all layers.
Definition padstack.h:171
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
Definition padstack.h:177
Definition pad.h:55
void MergePrimitivesAsPolygon(PCB_LAYER_ID aLayer, SHAPE_POLY_SET *aMergedPolygon, ERROR_LOC aErrorLoc=ERROR_INSIDE) const
Merge all basic shapes to a SHAPE_POLY_SET.
Definition pad.cpp:3256
int GetRoundRectCornerRadius(PCB_LAYER_ID aLayer) const
Definition pad.cpp:890
PAD_SHAPE GetShape(PCB_LAYER_ID aLayer) const
Definition pad.h:196
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc=ERROR_INSIDE, bool ignoreLineWidth=false) const override
Convert the pad shape to a closed polygon.
Definition pad.cpp:2590
int GetSolderMaskExpansion(PCB_LAYER_ID aLayer) const
Definition pad.cpp:1679
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
Definition pad.h:420
int GetChamferPositions(PCB_LAYER_ID aLayer) const
Definition pad.h:845
double GetChamferRectRatio(PCB_LAYER_ID aLayer) const
Definition pad.h:828
VECTOR2I GetSolderPasteMargin(PCB_LAYER_ID aLayer) const
Usually < 0 (mask shape smaller than pad)because the margin can be dependent on the pad size,...
Definition pad.cpp:1742
VECTOR2I ShapePos(PCB_LAYER_ID aLayer) const
Definition pad.cpp:1558
const VECTOR2I & GetSize(PCB_LAYER_ID aLayer) const
Definition pad.h:264
const VECTOR2I & GetMid() const
Definition pcb_track.h:290
std::map< std::pair< PCB_LAYER_ID, ZONE * >, EDA_DATA::SUB_NET_PLANE * > & GetPlaneSubnetMap()
std::map< PCB_TRACK *, EDA_DATA::SUB_NET * > & GetViaTraceSubnetMap()
std::map< const PAD *, EDA_DATA::SUB_NET_TOEPRINT * > & GetPadSubnetMap()
static std::string m_unitsStr
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
Definition pcb_shape.h:81
int GetWidth() const override
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the shape to a closed polygon.
const VECTOR2I & GetStart() const
Definition pcb_track.h:97
const VECTOR2I & GetEnd() const
Definition pcb_track.h:94
virtual int GetWidth() const
Definition pcb_track.h:91
bool FlashLayer(int aLayer) const
Check to see whether the via should have a pad on the specific layer.
const PADSTACK & Padstack() const
Definition pcb_track.h:406
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
Definition seg.h:42
VECTOR2I A
Definition seg.h:49
VECTOR2I B
Definition seg.h:50
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
const SEG CSegment(int aIndex) const
Return a constant copy of the aIndex segment in the line chain.
Represent a set of closed polygons.
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.
void BooleanAdd(const SHAPE_POLY_SET &b)
Perform boolean polyset union.
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index.
POLYGON & Polygon(int aIndex)
Return the aIndex-th subpolygon in the set.
void Simplify()
Simplify the polyset (merges overlapping polys, eliminates degeneracy/self-intersections)
std::vector< SHAPE_LINE_CHAIN > POLYGON
represents a single polygon outline with holes.
void Deflate(int aAmount, CORNER_STRATEGY aCornerStrategy, int aMaxError)
int OutlineCount() const
Return the number of outlines in the set.
void InflateWithLinkedHoles(int aFactor, CORNER_STRATEGY aCornerStrategy, int aMaxError)
Perform outline inflation/deflation, using round corners.
void Move(const VECTOR2I &aVector) override
void Fracture(bool aSimplify=true)
Convert a set of polygons with holes to a single outline with "slits"/"fractures" connecting the oute...
SHAPE_POLY_SET CloneDropTriangulation() const
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
Simple container to manage line stroke parameters.
int GetWidth() const
Handle a list of polygons defining a copper zone.
Definition zone.h:74
@ CHAMFER_ALL_CORNERS
All angles are chamfered.
@ ROUND_ALL_CORNERS
All angles are rounded.
static constexpr EDA_ANGLE ANGLE_0
Definition eda_angle.h:411
static constexpr EDA_ANGLE ANGLE_360
Definition eda_angle.h:417
@ SEGMENT
Definition eda_shape.h:48
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
Definition eda_shape.h:49
FILL_T
Definition eda_shape.h:59
@ FILLED_SHAPE
Fill with object color.
Definition eda_shape.h:61
int GetPenSizeForBold(int aTextSize)
Definition gr_text.cpp:37
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60
@ F_Paste
Definition layer_ids.h:104
@ B_Mask
Definition layer_ids.h:98
@ F_Mask
Definition layer_ids.h:97
@ B_Paste
Definition layer_ids.h:105
@ UNDEFINED_LAYER
Definition layer_ids.h:61
std::pair< wxString, wxString > AddXY(const VECTOR2I &aVec)
Definition odb_util.cpp:191
wxString Double2String(double aVal)
Definition odb_util.cpp:151
wxString SymDouble2String(double aVal)
Definition odb_util.cpp:179
VECTOR2I GetShapePosition(const PCB_SHAPE &aShape)
Definition odb_util.cpp:202
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition eda_angle.h:400
ODB_DIRECTION
Definition odb_feature.h:34
@ PTH
Plated through hole pad.
Definition padstack.h:98
@ CHAMFERED_RECT
Definition padstack.h:60
@ ROUNDRECT
Definition padstack.h:57
@ TRAPEZOID
Definition padstack.h:56
@ RECTANGLE
Definition padstack.h:54
std::vector< FAB_LAYER_COLOR > dummy
void wxStringSplit(const wxString &aText, wxArrayString &aStrings, wxChar aSplitter)
Split aString to a string list separated at aSplitter.
std::vector< std::vector< std::string > > table
VECTOR2I center
VECTOR2I end
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition typeinfo.h:85
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition typeinfo.h:103
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition typeinfo.h:100
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition typeinfo.h:94
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition typeinfo.h:101
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition typeinfo.h:90
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition typeinfo.h:105
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition typeinfo.h:89
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
Definition typeinfo.h:87
@ PCB_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
Definition typeinfo.h:98
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
Definition typeinfo.h:104
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition typeinfo.h:99
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition typeinfo.h:84
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition typeinfo.h:95
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition typeinfo.h:97
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
Definition typeinfo.h:91
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition typeinfo.h:93
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
Definition typeinfo.h:102
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:687