KiCad PCB EDA Suite
Loading...
Searching...
No Matches
step_pcb_model.cpp File Reference
#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_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.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepBuilderAPI_GTransform.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <BRepPrimAPI_MakePrism.hxx>
#include <BRepPrimAPI_MakeCylinder.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 <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 <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 Standard_Boolean prefixNames (const TDF_Label &aLabel, const TCollection_ExtendedString &aPrefix)
 
static wxString formatBBox (const BOX2I &aBBox)
 

Variables

static constexpr double USER_PREC = 1e-4
 
static constexpr double USER_ANGLE_PREC = 1e-6
 
static constexpr double BOARD_OFFSET = 0.05
 

Macro Definition Documentation

◆ APPROX_DBG

#define APPROX_DBG (   stmt)

Definition at line 234 of file step_pcb_model.cpp.

Enumeration Type Documentation

◆ MODEL3D_FORMAT_TYPE

Enumerator
FMT_NONE 
FMT_STEP 
FMT_STEPZ 
FMT_IGES 
FMT_EMN 
FMT_IDF 
FMT_WRL 
FMT_WRZ 

Definition at line 135 of file step_pcb_model.cpp.

Function Documentation

◆ approximateLineChainWithArcs()

◆ CircleCenterFrom3Points()

static VECTOR2D CircleCenterFrom3Points ( const VECTOR2D p1,
const VECTOR2D p2,
const VECTOR2D p3 
)
static

Definition at line 212 of file step_pcb_model.cpp.

References VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by approximateLineChainWithArcs(), and CalcArcCenter().

◆ fileType()

◆ formatBBox()

static wxString formatBBox ( const BOX2I aBBox)
static

◆ getOneShape()

static TopoDS_Shape getOneShape ( Handle(XCAFDoc_ShapeTool)  aShapeTool)
static

Definition at line 461 of file step_pcb_model.cpp.

Referenced by STEP_PCB_MODEL::WriteBREP(), and STEP_PCB_MODEL::WriteXAO().

◆ prefixNames()

static Standard_Boolean prefixNames ( const TDF_Label &  aLabel,
const TCollection_ExtendedString &  aPrefix 
)
static

Definition at line 600 of file step_pcb_model.cpp.

References name.

Referenced by STEP_PCB_MODEL::getModelLabel().

◆ rescaleShapes()

static Standard_Boolean rescaleShapes ( const TDF_Label &  theLabel,
const gp_XYZ &  aScale 
)
static

Definition at line 494 of file step_pcb_model.cpp.

Referenced by STEP_PCB_MODEL::transferModel().

Variable Documentation

◆ BOARD_OFFSET

constexpr double BOARD_OFFSET = 0.05
staticconstexpr

Definition at line 132 of file step_pcb_model.cpp.

Referenced by STEP_PCB_MODEL::getModelLocation().

◆ USER_ANGLE_PREC

constexpr double USER_ANGLE_PREC = 1e-6
staticconstexpr

Definition at line 129 of file step_pcb_model.cpp.

Referenced by STEP_PCB_MODEL::STEP_PCB_MODEL().

◆ USER_PREC

constexpr double USER_PREC = 1e-4
staticconstexpr

Definition at line 128 of file step_pcb_model.cpp.