IDFstepper
IDF to STEP converter
|
The StepGenerator can produce 3D models in STEP format based on IDF descriptions. More...
#include <StepGenerator.hpp>
Classes | |
class | Silence |
Public Types | |
enum | OverwritePolicy { ASK, NEVER, ALWAYS, YES, NO } |
Controls the behaviour if an output file already exists. More... | |
Public Member Functions | |
StepGenerator (std::ostringstream &eBuf) | |
Default constructor for initialization. | |
void | setComponentOverwritePolicy (OverwritePolicy policy) |
Sets the overwrite policy for components, i.e. | |
void | setBoardOverwritePolicy (OverwritePolicy policy) |
Sets the overwrite policy for boards, i.e. | |
void | setPanelOverwritePolicy (OverwritePolicy policy) |
Sets the overwrite policy for panels, i.e. | |
void | setLibraryPath (const std::string &path) |
Sets the path to store the component library. | |
void | setLibraryNamePattern (const std::string &pattern) |
Sets the file name pattern to use when handling file names for library components. | |
void | setMinSolidHeight (double minHeight) |
Sets the minimum height of a solid. | |
void | setBoardPath (const std::string &path) |
Sets the path to store the generated boards. | |
void | setBoardNamePattern (const std::string &pattern) |
Sets the file name pattern to use when handling file names for boards. | |
void | setPanelPath (const std::string &path) |
Sets the path to store the generated panels. | |
void | setPanelNamePattern (const std::string &pattern) |
Sets the file name pattern to use when handling file names for panels. | |
void | setMinHoleDiameter (double dia) |
Sets the minimum hole diameter which generates holes in a board/panel model. | |
bool | setConfigOption (const std::string &key, const config::Value &value) throw (boost::bad_get) |
Uses the given key/value pair to set an internal config option. | |
void | generateLibrary (const idf::LibraryStruct &lib) const |
Generates 3D models from a library structure. | |
void | generateBoard (const idf::BoardPanelStruct &board) const |
Generates a 3D assembly from a board. | |
void | generatePanel (const idf::BoardPanelStruct &panel) const |
Generates a 3D assembly from a panel. | |
Static Public Attributes | |
static const double | EQUAL_PT_DIST = .001 |
The maximum distance in mm to treat two vertices as equal. |
The StepGenerator can produce 3D models in STEP format based on IDF descriptions.
Basic operation involves generating Components (single solids) from idf::Component descriptions. If components are generated, boards can be created based on the board outline and a set of components, which then results in a STEP assembly. Multiple boards can finally be stored in a panel assembly.
Definition at line 38 of file StepGenerator.hpp.
Controls the behaviour if an output file already exists.
Definition at line 48 of file StepGenerator.hpp.
stepper::StepGenerator::StepGenerator | ( | std::ostringstream & | eBuf | ) | [inline] |
Default constructor for initialization.
This creates a StepGenerator with default settings. Use the setXY functions for configuration.
eBuf | Stringstream to use as a buffer for error messages, all messages will then be placed into this buffer as well as being output to stderr. |
Definition at line 71 of file StepGenerator.hpp.
void stepper::StepGenerator::generateBoard | ( | const idf::BoardPanelStruct & | board | ) | const |
Generates a 3D assembly from a board.
board | Board structure to use. |
Definition at line 99 of file StepGenerator.cpp.
void stepper::StepGenerator::generateLibrary | ( | const idf::LibraryStruct & | lib | ) | const |
Generates 3D models from a library structure.
lib | Library structure to use. |
Definition at line 82 of file StepGenerator.cpp.
void stepper::StepGenerator::generatePanel | ( | const idf::BoardPanelStruct & | panel | ) | const |
Generates a 3D assembly from a panel.
panel | Board/Panel structure to use. |
Definition at line 224 of file StepGenerator.cpp.
void stepper::StepGenerator::setBoardNamePattern | ( | const std::string & | pattern | ) | [inline] |
Sets the file name pattern to use when handling file names for boards.
The pattern may include the placeholder 'n' for the IDF "Board name" field. The same pattern is used when generating files from boards and when searching for files to be used in panels. Default is "%n.stp".
pattern | File name pattern to use. |
Definition at line 184 of file StepGenerator.hpp.
void stepper::StepGenerator::setBoardOverwritePolicy | ( | OverwritePolicy | policy | ) | [inline] |
Sets the overwrite policy for boards, i.e.
what to do if a board file already exists. Default value is "ASK".
policy | Desired behaviour, ASK, NEVER or ALWAYS. |
Definition at line 98 of file StepGenerator.hpp.
void stepper::StepGenerator::setBoardPath | ( | const std::string & | path | ) | [inline] |
Sets the path to store the generated boards.
Default value is "", i.e. the current directory.
path | Board path. |
Definition at line 166 of file StepGenerator.hpp.
void stepper::StepGenerator::setComponentOverwritePolicy | ( | OverwritePolicy | policy | ) | [inline] |
Sets the overwrite policy for components, i.e.
what to do if a component file already exists. Default value is "ASK".
policy | Desired behaviour, ASK, NEVER or ALWAYS. |
Definition at line 84 of file StepGenerator.hpp.
bool stepper::StepGenerator::setConfigOption | ( | const std::string & | key, |
const config::Value & | value | ||
) | throw (boost::bad_get) |
Uses the given key/value pair to set an internal config option.
key | The key string, see idfstepper.conf for details. |
value | The option's value, see idfstepper.conf for details. |
boost::bad_get | if the value is of the wrong type. |
Definition at line 13 of file StepGenerator.cpp.
void stepper::StepGenerator::setLibraryNamePattern | ( | const std::string & | pattern | ) | [inline] |
Sets the file name pattern to use when handling file names for library components.
The pattern may include the placeholders 'n' for the IDF "Geometry name" field and 'p' for the "Part number" field. The same pattern is used when generating files from libraries and when searching for files to be used in boards. Default is "%n.stp".
pattern | File name pattern to use. |
Definition at line 144 of file StepGenerator.hpp.
void stepper::StepGenerator::setLibraryPath | ( | const std::string & | path | ) | [inline] |
Sets the path to store the component library.
Default value is "", i.e. the current directory.
path | Library path. |
Definition at line 126 of file StepGenerator.hpp.
void stepper::StepGenerator::setMinHoleDiameter | ( | double | dia | ) | [inline] |
Sets the minimum hole diameter which generates holes in a board/panel model.
Pass 0.0 to drill all holes. Default value is 1mm.
dia | Minimum diameter in mm. |
Definition at line 221 of file StepGenerator.hpp.
void stepper::StepGenerator::setMinSolidHeight | ( | double | minHeight | ) | [inline] |
Sets the minimum height of a solid.
This avoids invalid solids if a component/board is specified with zero height/thickness, in which case the dimension is extended to this value. Default value is 0.1mm.
minHeight | Minimum height in mm. |
Definition at line 156 of file StepGenerator.hpp.
void stepper::StepGenerator::setPanelNamePattern | ( | const std::string & | pattern | ) | [inline] |
Sets the file name pattern to use when handling file names for panels.
The pattern may include the placeholder 'n' for the IDF "Board name" field. Default is "%n.stp".
pattern | File name pattern to use. |
Definition at line 210 of file StepGenerator.hpp.
void stepper::StepGenerator::setPanelOverwritePolicy | ( | OverwritePolicy | policy | ) | [inline] |
Sets the overwrite policy for panels, i.e.
what to do if a panel file already exists. Default value is "ASK".
policy | Desired behaviour, ASK, NEVER or ALWAYS. |
Definition at line 112 of file StepGenerator.hpp.
void stepper::StepGenerator::setPanelPath | ( | const std::string & | path | ) | [inline] |
Sets the path to store the generated panels.
Default value is "", i.e. the current directory.
path | Panel path. |
Definition at line 194 of file StepGenerator.hpp.
const double stepper::StepGenerator::EQUAL_PT_DIST = .001 [static] |
The maximum distance in mm to treat two vertices as equal.
Definition at line 43 of file StepGenerator.hpp.