| 
    KiCad PCB EDA Suite
    
   | 
 
#include <algorithm>#include <cmath>#include <sstream>#include <string>#include <utility>#include <wx/file.h>#include <wx/filename.h>#include <wx/filefn.h>#include <wx/sstream.h>#include <wx/stdpaths.h>#include <wx/stream.h>#include <wx/string.h>#include <wx/zstream.h>#include <wx/wfstream.h>#include <wx/zipstrm.h>#include <wx/stdstream.h>#include <wx/crt.h>#include <decompress.hpp>#include <thread_pool.h>#include <board.h>#include <board_design_settings.h>#include <footprint.h>#include <pad.h>#include <pcb_track.h>#include <kiplatform/io.h>#include <string_utils.h>#include <build_version.h>#include <geometry/shape_segment.h>#include <geometry/shape_circle.h>#include <board_stackup_manager/board_stackup.h>#include <board_stackup_manager/stackup_predefined_prms.h>#include <reporter.h>#include <exporters/u3d/writer.h>#include <plotters/plotters_pslike.h>#include <pcb_painter.h>#include "step_pcb_model.h"#include "streamwrapper.h"#include <IGESCAFControl_Reader.hxx>#include <IGESCAFControl_Writer.hxx>#include <IGESControl_Controller.hxx>#include <IGESData_GlobalSection.hxx>#include <IGESData_IGESModel.hxx>#include <Interface_Static.hxx>#include <Quantity_Color.hxx>#include <STEPCAFControl_Reader.hxx>#include <STEPCAFControl_Writer.hxx>#include <APIHeaderSection_MakeHeader.hxx>#include <Standard_Failure.hxx>#include <Standard_Handle.hxx>#include <Standard_Version.hxx>#include <TCollection_ExtendedString.hxx>#include <TDocStd_Document.hxx>#include <TDocStd_XLinkTool.hxx>#include <TDataStd_Name.hxx>#include <TDataStd_TreeNode.hxx>#include <TDF_LabelSequence.hxx>#include <TDF_Tool.hxx>#include <TopExp_Explorer.hxx>#include <TopoDS.hxx>#include <XCAFApp_Application.hxx>#include <XCAFDoc.hxx>#include <XCAFDoc_DocumentTool.hxx>#include <XCAFDoc_ColorTool.hxx>#include <XCAFDoc_ShapeTool.hxx>#include <XCAFDoc_VisMaterialTool.hxx>#include <XCAFDoc_Area.hxx>#include <XCAFDoc_Centroid.hxx>#include <XCAFDoc_Location.hxx>#include <XCAFDoc_Volume.hxx>#include "kicad3d_info.h"#include "KI_XCAFDoc_AssemblyGraph.hxx"#include <BRep_Tool.hxx>#include <BRepMesh_IncrementalMesh.hxx>#include <BRepBuilderAPI_GTransform.hxx>#include <BRepBuilderAPI_MakeEdge.hxx>#include <BRepBuilderAPI_MakeWire.hxx>#include <BRepBuilderAPI_MakeFace.hxx>#include <BRepExtrema_DistShapeShape.hxx>#include <BRepPrimAPI_MakePrism.hxx>#include <BRepTools.hxx>#include <BRepLib_MakeWire.hxx>#include <BRepAdaptor_Surface.hxx>#include <BRepAlgoAPI_Check.hxx>#include <BRepAlgoAPI_Cut.hxx>#include <BRepAlgoAPI_Fuse.hxx>#include <ShapeUpgrade_UnifySameDomain.hxx>#include <BRepBndLib.hxx>#include <Bnd_BoundSortBox.hxx>#include <GProp_GProps.hxx>#include <BRepGProp.hxx>#include <Geom_Curve.hxx>#include <Geom_TrimmedCurve.hxx>#include <gp_Ax2.hxx>#include <gp_Dir.hxx>#include <gp_Pnt.hxx>#include <GC_MakeArcOfCircle.hxx>#include <GC_MakeCircle.hxx>#include <RWGltf_CafWriter.hxx>#include <StlAPI_Writer.hxx>#include <macros.h>#include <convert_basic_shapes_to_polygon.h>Go to the source code of this file.
Macros | |
| #define | APPROX_DBG(stmt) | 
Enumerations | |
| enum | MODEL3D_FORMAT_TYPE {  FMT_NONE , FMT_STEP , FMT_STEPZ , FMT_IGES , FMT_EMN , FMT_IDF , FMT_WRL , FMT_WRZ }  | 
Functions | |
| MODEL3D_FORMAT_TYPE | fileType (const char *aFileName) | 
| static VECTOR2D | CircleCenterFrom3Points (const VECTOR2D &p1, const VECTOR2D &p2, const VECTOR2D &p3) | 
| static SHAPE_LINE_CHAIN | approximateLineChainWithArcs (const SHAPE_LINE_CHAIN &aSrc) | 
| static TopoDS_Shape | getOneShape (Handle(XCAFDoc_ShapeTool) aShapeTool) | 
| static Standard_Boolean | rescaleShapes (const TDF_Label &theLabel, const gp_XYZ &aScale) | 
| static bool | fuseShapes (auto &aInputShapes, TopoDS_Shape &aOutShape, REPORTER *aReporter) | 
| static TopoDS_Compound | makeCompound (const auto &aInputShapes) | 
| static TopoDS_Shape | fuseShapesOrCompound (const TopTools_ListOfShape &aInputShapes, REPORTER *aReporter) | 
| static Standard_Boolean | prefixNames (const TDF_Label &aLabel, const TCollection_ExtendedString &aPrefix) | 
| static wxString | formatBBox (const BOX2I &aBBox) | 
| static bool | makeWireFromChain (BRepLib_MakeWire &aMkWire, const SHAPE_LINE_CHAIN &aChain, double aMergeOCCMaxDist, double aZposition, const VECTOR2D &aOrigin, REPORTER *aReporter) | 
| static bool | colorFromStackup (BOARD_STACKUP_ITEM_TYPE aType, const wxString &aColorStr, COLOR4D &aColorOut) | 
Variables | |
| static constexpr double | USER_PREC = 1e-4 | 
| static constexpr double | USER_ANGLE_PREC = 1e-6 | 
| static constexpr double | BOARD_OFFSET = 0.05 | 
| static std::vector< FAB_LAYER_COLOR > | s_soldermaskColors | 
| #define APPROX_DBG | ( | stmt | ) | 
Definition at line 270 of file step_pcb_model.cpp.
Referenced by approximateLineChainWithArcs().
| enum MODEL3D_FORMAT_TYPE | 
| Enumerator | |
|---|---|
| FMT_NONE | |
| FMT_STEP | |
| FMT_STEPZ | |
| FMT_IGES | |
| FMT_EMN | |
| FMT_IDF | |
| FMT_WRL | |
| FMT_WRZ | |
Definition at line 153 of file step_pcb_model.cpp.
      
  | 
  static | 
Definition at line 273 of file step_pcb_model.cpp.
References std::abs(), ANGLE_360, SHAPE_LINE_CHAIN::Append(), APPROX_DBG, SHAPE_LINE_CHAIN::Arc(), SHAPE_LINE_CHAIN::ArcIndex(), center, CircleCenterFrom3Points(), SHAPE_LINE_CHAIN::Clear(), SHAPE_LINE_CHAIN::CPoint(), VECTOR2< T >::EuclideanNorm(), SHAPE_ARC::GetArcMid(), SHAPE_ARC::GetCenter(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), SHAPE_ARC::GetRadius(), SHAPE_LINE_CHAIN::GetSegmentCount(), SHAPE_LINE_CHAIN::IsArcSegment(), SHAPE_LINE_CHAIN::IsClosed(), pcbIUScale, SHAPE_LINE_CHAIN::PointCount(), radius, SHAPE_LINE_CHAIN::RemoveShape(), SHAPE_LINE_CHAIN::SelfIntersectingWithArcs(), SHAPE_LINE_CHAIN::SetClosed(), and SHAPE_LINE_CHAIN::Slice().
Referenced by STEP_PCB_MODEL::MakeShapes().
      
  | 
  static | 
Definition at line 248 of file step_pcb_model.cpp.
References center, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by approximateLineChainWithArcs(), and CalcArcCenter().
      
  | 
  static | 
Definition at line 1886 of file step_pcb_model.cpp.
References BS_ITEM_TYPE_SILKSCREEN, BS_ITEM_TYPE_SOLDERMASK, GetStandardColors(), IsPrmSpecified(), and s_soldermaskColors.
Referenced by STEP_PCB_MODEL::CreatePCB().
| MODEL3D_FORMAT_TYPE fileType | ( | const char * | aFileName | ) | 
Definition at line 166 of file step_pcb_model.cpp.
References CLOSE_STREAM, FMT_EMN, FMT_IDF, FMT_IGES, FMT_NONE, FMT_STEP, FMT_STEPZ, FMT_WRL, FMT_WRZ, and OPEN_ISTREAM.
Referenced by PANEL_DESIGN_BLOCK_LIB_TABLE::browseLibrariesHandler(), PANEL_FP_LIB_TABLE::browseLibrariesHandler(), PANEL_SYM_LIB_TABLE::browseLibrariesHandler(), STEP_PCB_MODEL::getModelLabel(), GRAPHICS_IMPORT_MGR::GetPluginByExt(), SCH_IO_MGR::GuessPluginTypeFromLibPath(), SCH_IO_MGR::GuessPluginTypeFromSchPath(), SCH_EDIT_FRAME::importFile(), FOOTPRINT_EDIT_FRAME::ImportFootprint(), SYMBOL_EDIT_FRAME::ImportSymbol(), PCBNEW_JOBS_HANDLER::JobExportFpUpgrade(), EESCHEMA_JOBS_HANDLER::JobSymUpgrade(), SCH_EDIT_FRAME::OnImportProject(), PANEL_DESIGN_BLOCK_LIB_TABLE::PANEL_DESIGN_BLOCK_LIB_TABLE(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), GERBVIEW_CONTROL::ReloadAllLayers(), and SYMBOL_EDIT_FRAME::saveLibrary().
      
  | 
  static | 
Definition at line 1492 of file step_pcb_model.cpp.
References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), MM, pcbIUScale, and UNITS_PROVIDER::StringFromValue().
Referenced by STEP_PCB_MODEL::MakeShapes().
      
  | 
  static | 
Definition at line 637 of file step_pcb_model.cpp.
References _, REPORTER::Report(), RPT_SEVERITY_ERROR, and RPT_SEVERITY_WARNING.
Referenced by fuseShapesOrCompound().
      
  | 
  static | 
Definition at line 724 of file step_pcb_model.cpp.
References fuseShapes(), and makeCompound().
Referenced by STEP_PCB_MODEL::AddPadShape(), and STEP_PCB_MODEL::CreatePCB().
      
  | 
  static | 
Definition at line 497 of file step_pcb_model.cpp.
Referenced by STEP_PCB_MODEL::WriteBREP(), STEP_PCB_MODEL::WriteSTL(), and STEP_PCB_MODEL::WriteXAO().
      
  | 
  static | 
Definition at line 710 of file step_pcb_model.cpp.
Referenced by STEP_PCB_MODEL::CreatePCB(), and fuseShapesOrCompound().
      
  | 
  static | 
Definition at line 1506 of file step_pcb_model.cpp.
References _, SEG::A, addSegment(), ANGLE_360, SHAPE_LINE_CHAIN::Arc(), SHAPE_LINE_CHAIN::ArcIndex(), SEG::B, SHAPE_LINE_CHAIN::CPoint(), SHAPE_LINE_CHAIN::CSegment(), end, SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), Handle(), SHAPE_LINE_CHAIN::IsArcSegment(), SHAPE_LINE_CHAIN::IsArcStart(), SHAPE_LINE_CHAIN::NextShape(), pcbIUScale, SHAPE_LINE_CHAIN::PointCount(), REPORTER::Report(), RPT_SEVERITY_ERROR, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by STEP_PCB_MODEL::MakeShapes().
      
  | 
  static | 
Definition at line 740 of file step_pcb_model.cpp.
References Handle(), and name.
Referenced by STEP_PCB_MODEL::getModelLabel().
      
  | 
  static | 
Definition at line 530 of file step_pcb_model.cpp.
References Handle().
Referenced by STEP_PCB_MODEL::transferModel().
      
  | 
  staticconstexpr | 
Definition at line 150 of file step_pcb_model.cpp.
Referenced by STEP_PCB_MODEL::getModelLocation().
      
  | 
  static | 
Definition at line 1873 of file step_pcb_model.cpp.
Referenced by colorFromStackup().
      
  | 
  staticconstexpr | 
Definition at line 147 of file step_pcb_model.cpp.
Referenced by STEP_PCB_MODEL::STEP_PCB_MODEL().
      
  | 
  staticconstexpr | 
Definition at line 146 of file step_pcb_model.cpp.