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
33// Default value to chain 2 shapes when creating the board outlines
34// from shapes on Edges.Cut layer
35#define BOARD_DEFAULT_CHAINING_EPSILON 0.01
36
37class PCBMODEL;
38class BOARD;
39class BOARD_ITEM;
40class FOOTPRINT;
41class PCB_TRACK;
43class STEP_PCB_MODEL;
44
46{
47public:
49 m_origin(),
50 m_overwrite( false ),
51 m_useGridOrigin( false ),
52 m_useDrillOrigin( false ),
54 m_includeDNP( true ),
55 m_substModels( true ),
57 m_boardOnly( false ),
58 m_exportBoardBody( true ),
59 m_exportComponents( true ),
60 m_exportTracksVias( false ),
61 m_exportZones( false ),
62 m_exportInnerCopper( false ),
63 m_fuseShapes( false ),
64 m_optimizeStep( true ),
66 {};
67
68 enum class FORMAT
69 {
70 STEP,
71 BREP,
72 XAO,
73 GLB
74 };
75
76 wxString m_outputFile;
77 wxString m_netFilter;
78
80
97
99 wxString GetFormatName();
100};
101
103{
104public:
105 EXPORTER_STEP( BOARD* aBoard, const EXPORTER_STEP_PARAMS& aParams );
107
108 bool Export();
109
110 wxString m_outputFile;
111
112 void SetError() { m_error = true; }
113 void SetFail() { m_fail = true; }
114 void SetWarn() { m_warn = true; }
115
116private:
117 bool buildBoard3DShapes();
118 bool buildFootprint3DShapes( FOOTPRINT* aFootprint, VECTOR2D aOrigin );
119 bool buildTrack3DShape( PCB_TRACK* aTrack, VECTOR2D aOrigin );
120 void buildZones3DShape( VECTOR2D aOrigin );
121 bool buildGraphic3DShape( BOARD_ITEM* aItem, VECTOR2D aOrigin );
122
124 std::unique_ptr<FILENAME_RESOLVER> m_resolver;
125
126private:
128 bool m_fail;
129 bool m_warn;
130
132 std::unique_ptr<STEP_PCB_MODEL> m_pcbModel;
133
137
138 std::map<PCB_LAYER_ID, SHAPE_POLY_SET> m_poly_copper_shapes;
139
142};
143
144#endif
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:77
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:282
wxString GetDefaultExportExtension()
double m_BoardOutlinesChainingEpsilon
Definition: exporter_step.h:87
void buildZones3DShape(VECTOR2D aOrigin)
KIGFX::COLOR4D m_solderMaskColor
wxString m_outputFile
bool buildGraphic3DShape(BOARD_ITEM *aItem, VECTOR2D aOrigin)
std::map< PCB_LAYER_ID, SHAPE_POLY_SET > m_poly_copper_shapes
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
bool buildTrack3DShape(PCB_TRACK *aTrack, VECTOR2D aOrigin)
KIGFX::COLOR4D m_copperColor
Provide an extensible class to resolve 3D model paths.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
#define BOARD_DEFAULT_CHAINING_EPSILON
Definition: exporter_step.h:35