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, 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 <jobs/job_export_pcb_3d.h> // For EXPORTER_STEP_PARAMS
32#include <layer_ids.h>
33#include <lset.h>
34#include <reporter.h>
35
36
37class PCBMODEL;
38class BOARD;
39class BOARD_ITEM;
40class FOOTPRINT;
41class PCB_TRACK;
43class STEP_PCB_MODEL;
44
45
47{
48public:
49 EXPORTER_STEP( BOARD* aBoard, const EXPORTER_STEP_PARAMS& aParams, REPORTER* aReporter );
51
52 bool Export();
53
54 wxString m_outputFile;
55
56private:
57 bool buildBoard3DShapes();
58 bool buildFootprint3DShapes( FOOTPRINT* aFootprint, const VECTOR2D& aOrigin, SHAPE_POLY_SET* aClipPolygon );
59 bool buildTrack3DShape( PCB_TRACK* aTrack, const VECTOR2D& aOrigin );
60 void buildZones3DShape( VECTOR2D aOrigin );
61 bool buildGraphic3DShape( BOARD_ITEM* aItem, const VECTOR2D& aOrigin );
62 void initOutputVariant();
63
71 bool isLayerInBackdrillSpan( PCB_LAYER_ID aLayer, PCB_LAYER_ID aStartLayer,
72 PCB_LAYER_ID aEndLayer ) const;
73
75 std::unique_ptr<FILENAME_RESOLVER> m_resolver;
76
77private:
79
81 std::unique_ptr<STEP_PCB_MODEL> m_pcbModel;
82
85 wxString m_pcbBaseName;
86
87 // wxString key is netname
88 std::map<PCB_LAYER_ID, std::map<wxString, SHAPE_POLY_SET>> m_poly_shapes;
89 std::map<PCB_LAYER_ID, SHAPE_POLY_SET> m_poly_holes;
90
92
95
96 int m_platingThickness; // plating thickness for TH pads/vias
97};
98
99#endif
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:83
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:322
void buildZones3DShape(VECTOR2D aOrigin)
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).
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
Provide an extensible class to resolve 3D model paths.
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:105
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:73
Represent a set of closed polygons.
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60
VECTOR2< double > VECTOR2D
Definition vector2d.h:694