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-2023 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
32// Default value to chain 2 shapes when creating the board outlines
33// from shapes on Edges.Cut layer
34#define BOARD_DEFAULT_CHAINING_EPSILON 0.01
35
36class PCBMODEL;
37class BOARD;
38class BOARD_ITEM;
39class FOOTPRINT;
40class PCB_TRACK;
42class STEP_PCB_MODEL;
43
45{
46public:
48 m_origin(),
49 m_overwrite( false ),
50 m_useGridOrigin( false ),
51 m_useDrillOrigin( false ),
53 m_includeDNP( true ),
54 m_substModels( true ),
56 m_boardOnly( false ),
57 m_exportTracks( false ),
58 m_exportZones( false ),
59 m_optimizeStep( true ),
61 {};
62
63 enum class FORMAT
64 {
65 STEP,
66 BREP,
67 GLB
68 };
69
70 wxString m_outputFile;
71
73
86
88 wxString GetFormatName();
89};
90
92{
93public:
94 EXPORTER_STEP( BOARD* aBoard, const EXPORTER_STEP_PARAMS& aParams );
96
97 bool Export();
98
99 wxString m_outputFile;
100
101 void SetError() { m_error = true; }
102 void SetFail() { m_fail = true; }
103 void SetWarn() { m_warn = true; }
104
107
108private:
109 bool buildBoard3DShapes();
110 bool buildFootprint3DShapes( FOOTPRINT* aFootprint, VECTOR2D aOrigin );
111 bool buildTrack3DShape( PCB_TRACK* aTrack, VECTOR2D aOrigin );
112 void buildZones3DShape( VECTOR2D aOrigin );
113 bool buildGraphic3DShape( BOARD_ITEM* aItem, VECTOR2D aOrigin );
115
117 std::unique_ptr<FILENAME_RESOLVER> m_resolver;
118
119private:
121 bool m_fail;
122 bool m_warn;
123
125 std::unique_ptr<STEP_PCB_MODEL> m_pcbModel;
126
130
132
135
138};
139
140#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:281
wxString GetDefaultExportExtension()
double m_BoardOutlinesChainingEpsilon
Definition: exporter_step.h:80
void buildZones3DShape(VECTOR2D aOrigin)
KIGFX::COLOR4D m_solderMaskColor
SHAPE_POLY_SET m_top_copper_shapes
SHAPE_POLY_SET m_bottom_copper_shapes
wxString m_outputFile
Definition: exporter_step.h:99
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 ExportTracksAndVias()
Return rue to export tracks and vias on top and bottom copper layers.
bool buildBoard3DShapes()
std::unique_ptr< STEP_PCB_MODEL > m_pcbModel
void calculatePcbThickness()
bool buildTrack3DShape(PCB_TRACK *aTrack, VECTOR2D aOrigin)
KIGFX::COLOR4D m_copperColor
double m_boardThickness
Provide an extensible class to resolve 3D model paths.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
Represent a set of closed polygons.
#define BOARD_DEFAULT_CHAINING_EPSILON
Definition: exporter_step.h:34