Overview
This tutorial introduces the basic usage of the AMCAX IGES module.
Import Section
Import TopoShape
Include header file
Read file/data stream
Read from iges/igs file
static AMCAX_API bool Read(TopoShape &s, const std::string &file)
Read a shape from file.
Base class of shape, containing an underlying shape with a location and an orientation.
Definition TopoShape.hpp:15
Read from data stream
std::ifstream ist("./data/test.iges");
Import Label
Include header file
Read file/data stream
Read from iges/igs file
The class of Label.
Definition Label.hpp:27
Read from data stream
std::ifstream ist("./data/test.iges");
Export Section
Before introducing export functions, first explain the configuration parameters.
Configuration 1:
- FACE_MODE: Scattered face mode 【format=0】
- BREP_MODE: Brep mode 【format=1】
Configuration 2: WriteAF (export Label) attribute delegation strategy 【Only effective when Configuration 1 is FACE_MODE】
- WRITE_ATTR_DEFAULT: Default strategy configuration (currently equivalent to WRITE_ATTR_SELF_HIGH_PRI)
- WRITE_ATTR_NOT_INHERIT: Parent topology attributes do not affect child topology
- WRITE_ATTR_SELF_HIGH_PRI: Child topology high priority 【Prefer to use own attributes】
- WRITE_ATTR_SELF_LOW_PRI: Parent topology high priority 【Prefer to use parent topology attributes】
Note:
- WRITE_ATTR_SELF_HIGH_PRI and WRITE_ATTR_SELF_LOW_PRI configurations only take effect when attribute delegation conflicts occur; when there is no conflict, they automatically inherit parent topology attributes.
- Bitwise OR is only used for behaviors between different configurations, such as: FACE_MODE | WRITE_ATTR_NOT_INHERIT
Export TopoShape
Include header file
Export to file/data stream
Export to iges/igs file
std::string filePath = "./iges/Outpute_TopoToFile.iges";
if (!ret)
{
std::cout << "error" << std::endl;
}
if (!ret)
{
std::cout << "error" << std::endl;
}
#define BREP_MODE
The BREP_MODE macro is only applicable to the IGES::IgesIO::Write interface. It uses the 186 entities...
Definition IGESConfig.hpp:20
static AMCAX_API bool Write(const TopoShape &s, const std::string &file, int format=FACE_MODE|WRITE_ATTR_DEFAULT)
Write a TopoShape to file.
Class of making a box.
Definition MakeBox.hpp:20
PointT< double, 3 > Point3
3D point
Definition PointT.hpp:459
Export to data stream
std::ostringstream os_t;
if (!ret)
{
std::cout << "error" << std::endl;
}
if (!ret)
{
std::cout << "error" << std::endl;
}
Export Label
Include header file
#include<iostream>
The classes of WithAttrModeling.
Export to file/data stream
Export to file
auto makeBox = WithAttr<MakeBox>(1.0, 1.0, 1.0);
makeBox.Build();
std::string filePath = "./iges/Outpute_LabelToFile.iges";
if (!ret)
{
std::cout << "error" << std::endl;
}
if (!ret)
{
std::cout << "error" << std::endl;
}
if (!ret)
{
std::cout << "error" << std::endl;
}
#define FACE_MODE
The FACE_MODE macro is only applicable to the IGES::IgesIO::Write interface. and BREP_MODE represent ...
Definition IGESConfig.hpp:14
#define WRITE_ATTR_SELF_LOW_PRI
This configurations are only applicable to IGES::IgesIO::Write(Label&, Face_Mode| XXXX) form,...
Definition IGESConfig.hpp:48
#define WRITE_ATTR_NOT_INHERIT
This configurations are only applicable to IGES::IgesIO::Write(Label&, Face_Mode| XXXX) form,...
Definition IGESConfig.hpp:34
Export to data stream
auto makeBox = WithAttr<MakeBox>(1.0, 1.0, 1.0);
makeBox.Build();
std::ostringstream os_l;
if (!ret)
{
std::cout << "error" << std::endl;
}
if (!ret)
{
std::cout << "error" << std::endl;
}
if (!ret)
{
std::cout << "error" << std::endl;
}