KiCad PCB EDA Suite
|
#include <algorithm>
#include <cmath>
#include <sstream>
#include <string>
#include <utility>
#include <wx/filename.h>
#include <wx/filefn.h>
#include <wx/stdpaths.h>
#include <wx/wfstream.h>
#include <wx/zipstrm.h>
#include <wx/stdstream.h>
#include <decompress.hpp>
#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 "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 "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>
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) |
static TopoDS_Compound | makeCompound (auto &aInputShapes) |
static TopoDS_Shape | fuseShapesOrCompound (TopTools_ListOfShape &aInputShapes) |
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) |
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 260 of file step_pcb_model.cpp.
enum MODEL3D_FORMAT_TYPE |
Enumerator | |
---|---|
FMT_NONE | |
FMT_STEP | |
FMT_STEPZ | |
FMT_IGES | |
FMT_EMN | |
FMT_IDF | |
FMT_WRL | |
FMT_WRZ |
Definition at line 136 of file step_pcb_model.cpp.
|
static |
Definition at line 263 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(), 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(), EDA_IU_SCALE::mmToIU(), pcbIUScale, SHAPE_LINE_CHAIN::PointCount(), 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 238 of file step_pcb_model.cpp.
References VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by approximateLineChainWithArcs(), and CalcArcCenter().
|
static |
Definition at line 1767 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 149 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, OPEN_ISTREAM, and ReportMessage().
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(), SYMBOL_EDIT_FRAME::saveLibrary(), and PANEL_FP_LIB_TABLE::setupGrid().
|
static |
Definition at line 1385 of file step_pcb_model.cpp.
References BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), MILLIMETRES, pcbIUScale, and up.
Referenced by STEP_PCB_MODEL::MakeShapes().
|
static |
Definition at line 625 of file step_pcb_model.cpp.
References _, and ReportMessage().
Referenced by fuseShapesOrCompound().
|
static |
Definition at line 705 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 487 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 691 of file step_pcb_model.cpp.
Referenced by STEP_PCB_MODEL::CreatePCB(), and fuseShapesOrCompound().
|
static |
Definition at line 1399 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(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), SHAPE_LINE_CHAIN::IsArcSegment(), SHAPE_LINE_CHAIN::IsArcStart(), EDA_IU_SCALE::IUTomm(), SHAPE_LINE_CHAIN::NextShape(), pcbIUScale, SHAPE_LINE_CHAIN::PointCount(), ReportMessage(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by STEP_PCB_MODEL::MakeShapes().
|
static |
Definition at line 720 of file step_pcb_model.cpp.
References name.
Referenced by STEP_PCB_MODEL::getModelLabel().
|
static |
Definition at line 520 of file step_pcb_model.cpp.
Referenced by STEP_PCB_MODEL::transferModel().
|
staticconstexpr |
Definition at line 133 of file step_pcb_model.cpp.
Referenced by STEP_PCB_MODEL::getModelLocation().
|
static |
Definition at line 1754 of file step_pcb_model.cpp.
Referenced by colorFromStackup().
|
staticconstexpr |
Definition at line 130 of file step_pcb_model.cpp.
Referenced by STEP_PCB_MODEL::STEP_PCB_MODEL().
|
staticconstexpr |
Definition at line 129 of file step_pcb_model.cpp.