KiCad PCB EDA Suite
Loading...
Searching...
No Matches
exporter_step.h
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 (C) 2022 Mark Roszko <[email protected]>
5 * Copyright (C) 2016 Cirilo Bernardo <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#ifndef EXPORTER_STEP_H
23#define EXPORTER_STEP_H
24
26#include <gal/color4d.h>
27#include <jobs/job_export_pcb_3d.h> // For EXPORTER_STEP_PARAMS
28#include <layer_ids.h>
29#include <lset.h>
30#include <reporter.h>
31
32
33class PCBMODEL;
34class BOARD;
35class BOARD_ITEM;
36class FOOTPRINT;
37class PCB_TRACK;
39class STEP_PCB_MODEL;
40
41
43{
44public:
45 EXPORTER_STEP( BOARD* aBoard, const EXPORTER_STEP_PARAMS& aParams, REPORTER* aReporter );
47
48 bool Export();
49
50 wxString m_outputFile;
51
52private:
53 bool buildBoard3DShapes();
54 bool buildFootprint3DShapes( FOOTPRINT* aFootprint, const VECTOR2D& aOrigin, SHAPE_POLY_SET* aClipPolygon );
55 bool buildTrack3DShape( PCB_TRACK* aTrack, const VECTOR2D& aOrigin );
56 void buildZones3DShape( VECTOR2D aOrigin, bool aSolderMaskOnly = false );
57 bool buildGraphic3DShape( BOARD_ITEM* aItem, const VECTOR2D& aOrigin );
58 void initOutputVariant();
59
67 bool isLayerInBackdrillSpan( PCB_LAYER_ID aLayer, PCB_LAYER_ID aStartLayer,
68 PCB_LAYER_ID aEndLayer ) const;
69
70 bool netFilterMatches( const wxString& netname ) const;
71
73 std::unique_ptr<FILENAME_RESOLVER> m_resolver;
74
75private:
77
79 std::unique_ptr<STEP_PCB_MODEL> m_pcbModel;
80
83 wxString m_pcbBaseName;
84
85 // wxString key is netname
86 std::map<PCB_LAYER_ID, std::map<wxString, SHAPE_POLY_SET>> m_poly_shapes;
87 std::map<PCB_LAYER_ID, SHAPE_POLY_SET> m_poly_holes;
88
90
93
94 int m_platingThickness; // plating thickness for TH pads/vias
95};
96
97#endif
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:81
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
REPORTER * m_reporter
bool buildTrack3DShape(PCB_TRACK *aTrack, const VECTOR2D &aOrigin)
bool buildFootprint3DShapes(FOOTPRINT *aFootprint, const VECTOR2D &aOrigin, SHAPE_POLY_SET *aClipPolygon)
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_poly_holes
bool isLayerInBackdrillSpan(PCB_LAYER_ID aLayer, PCB_LAYER_ID aStartLayer, PCB_LAYER_ID aEndLayer) const
Check if a copper layer is within a backdrill layer span (inclusive).
bool netFilterMatches(const wxString &netname) const
wxString m_outputFile
EXPORTER_STEP_PARAMS m_params
wxString m_pcbBaseName
the name of the project (board short filename (no path, no ext) used to identify items in step file
std::unique_ptr< FILENAME_RESOLVER > m_resolver
std::unique_ptr< STEP_PCB_MODEL > m_pcbModel
std::map< PCB_LAYER_ID, std::map< wxString, SHAPE_POLY_SET > > m_poly_shapes
KIGFX::COLOR4D m_copperColor
EXPORTER_STEP(BOARD *aBoard, const EXPORTER_STEP_PARAMS &aParams, REPORTER *aReporter)
bool buildGraphic3DShape(BOARD_ITEM *aItem, const VECTOR2D &aOrigin)
KIGFX::COLOR4D m_padColor
void buildZones3DShape(VECTOR2D aOrigin, bool aSolderMaskOnly=false)
Provide an extensible class to resolve 3D model paths.
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:71
Represent a set of closed polygons.
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
VECTOR2< double > VECTOR2D
Definition vector2d.h:682