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 (C) 2016-2024 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, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#ifndef EXPORTER_STEP_H
27#define EXPORTER_STEP_H
28
30#include <gal/color4d.h>
31#include <layer_ids.h>
32#include <lset.h>
33
34// Default value to chain 2 shapes when creating the board outlines
35// from shapes on Edges.Cut layer
36#define BOARD_DEFAULT_CHAINING_EPSILON 0.01
37
38class PCBMODEL;
39class BOARD;
40class BOARD_ITEM;
41class FOOTPRINT;
42class PCB_TRACK;
44class STEP_PCB_MODEL;
45
47{
48public:
50 m_origin(),
51 m_overwrite( false ),
52 m_useGridOrigin( false ),
53 m_useDrillOrigin( false ),
55 m_includeDNP( true ),
56 m_substModels( true ),
58 m_boardOnly( false ),
59 m_exportBoardBody( true ),
60 m_exportComponents( true ),
61 m_exportTracksVias( false ),
62 m_exportPads( false ),
63 m_exportZones( false ),
64 m_exportInnerCopper( false ),
65 m_exportSilkscreen( false ),
66 m_exportSoldermask( false ),
67 m_fuseShapes( false ),
68 m_optimizeStep( true ),
70 {};
71
72 enum class FORMAT
73 {
74 STEP,
75 BREP,
76 XAO,
77 GLB
78 };
79
80 wxString m_outputFile;
81 wxString m_netFilter;
82
84
104
105 wxString GetDefaultExportExtension();
106 wxString GetFormatName();
107};
108
110{
111public:
112 EXPORTER_STEP( BOARD* aBoard, const EXPORTER_STEP_PARAMS& aParams );
114
115 bool Export();
116
117 wxString m_outputFile;
118
119 void SetError() { m_error = true; }
120 void SetFail() { m_fail = true; }
121 void SetWarn() { m_warn = true; }
122
123private:
124 bool buildBoard3DShapes();
125 bool buildFootprint3DShapes( FOOTPRINT* aFootprint, VECTOR2D aOrigin );
126 bool buildTrack3DShape( PCB_TRACK* aTrack, VECTOR2D aOrigin );
127 void buildZones3DShape( VECTOR2D aOrigin );
128 bool buildGraphic3DShape( BOARD_ITEM* aItem, VECTOR2D aOrigin );
129
131 std::unique_ptr<FILENAME_RESOLVER> m_resolver;
132
133private:
135 bool m_fail;
136 bool m_warn;
137
139 std::unique_ptr<STEP_PCB_MODEL> m_pcbModel;
140
144
145 std::map<PCB_LAYER_ID, SHAPE_POLY_SET> m_poly_shapes;
146 std::map<PCB_LAYER_ID, SHAPE_POLY_SET> m_poly_holes;
147
149
152
153 int m_platingThickness; // plating thickness for TH pads/vias
154};
155
156#endif
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:289
wxString GetDefaultExportExtension()
double m_BoardOutlinesChainingEpsilon
Definition: exporter_step.h:91
void buildZones3DShape(VECTOR2D aOrigin)
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_poly_holes
wxString m_outputFile
bool buildGraphic3DShape(BOARD_ITEM *aItem, VECTOR2D aOrigin)
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
bool buildFootprint3DShapes(FOOTPRINT *aFootprint, VECTOR2D aOrigin)
std::unique_ptr< FILENAME_RESOLVER > m_resolver
bool buildBoard3DShapes()
std::unique_ptr< STEP_PCB_MODEL > m_pcbModel
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_poly_shapes
bool buildTrack3DShape(PCB_TRACK *aTrack, VECTOR2D aOrigin)
KIGFX::COLOR4D m_copperColor
KIGFX::COLOR4D m_padColor
Provide an extensible class to resolve 3D model paths.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
LSET is a set of PCB_LAYER_IDs.
Definition: lset.h:35
#define BOARD_DEFAULT_CHAINING_EPSILON
Definition: exporter_step.h:36