Currently, Jiushao Kernel supports import/export of BREP files, mesh file reading/writing (OBJ, STL), import/export of IGES/IGS files, and import/export of STEP files.
BREP File Import/Export
Import
AMCAX::OCCTIO::OCCTTool::Read provides the functionality to import BREP files.
Base class of shape, containing an underlying shape with a location and an orientation.
Definition TopoShape.hpp:15
Export
AMCAX::OCCTIO::OCCTTool::Write provides the functionality to export BREP files.
Class of making a box.
Definition MakeBox.hpp:20
PointT< double, 3 > Point3
3D point
Definition PointT.hpp:459
Mesh File Reading/Writing
OBJ
AMCAX::Meshing::Mesh::OBJReader provides the functionality to read OBJ files; AMCAX::Meshing::Mesh::OBJWriter provides the functionality to write OBJ files.
obj_reader.
read(
"./data/cow.obj", io_options);
std::streamsize precision = 10;
obj_writer.
write(
"cow1.obj", io_options, precision);
Options about pre-described properties in mesh IO.
Definition IOOptions.hpp:19
Read triangle soup from an OBJ file.
Definition OBJReader.hpp:38
AMCAXMeshing_API bool read(const std::string &filename, IOOptions &opt)
Read triangle soup from the file. results will be stored in member variables of reader,...
Write triangle soup to an OBJ file.
Definition OBJWriter.hpp:38
AMCAXMeshing_API bool write(const std::string &filename, IOOptions &opt, std::streamsize precision)
Write triangle soup to file with given options and precison.
STL
AMCAX::Meshing::Mesh::STLReader provides the functionality to import STL files; AMCAX::Meshing::Mesh::STLWriter provides the functionality to export STL files.
stl_reader.
read(
"./data/cow.stl", io_options);
std::streamsize precision = 10;
stl_writer.
write(
"cow2.stl", io_options, precision);
Read triangle soup from an STL file.
Definition STLReader.hpp:33
AMCAXMeshing_API bool read(const std::string &filename, IOOptions &opt)
Read triangle soup from the file.
Write mesh to an STL file.
Definition STLWriter.hpp:33
AMCAXMeshing_API bool write(const std::string &filename, IOOptions &opt, std::streamsize precision=6)
Write mesh to file with given options and precison.
IGES/IGS Files
Import
AMCAX::IGES::IgesIO::Read provides the functionality to import IGES/IGS files.
Import TopoShape
Supports importing wires, faces, and solids.
Import from iges/igs file
static AMCAX_API bool Read(TopoShape &s, const std::string &file)
Read a shape from file.
Import from data stream
std::ifstream ist("./data/test.iges");
Import Label
Import from iges/igs file
The class of Label.
Definition Label.hpp:27
Import from data stream
std::ifstream ist("./data/test.iges");
Export
AMCAX::IGES::IgesIO::Write provides the functionality to export IGES/IGS files.
Before introducing the export functionality, let's explain the configuration parameters.
Configuration 1:
- FACE_MODE: Scattered face mode 【format=0】
- BREP_MODE: Brep mode 【format=1】
Configuration 2: Attribute inheritance strategy for WriteAF (export Label) 【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 【Prioritize using own attributes】
- WRITE_ATTR_SELF_LOW_PRI: Parent topology high priority 【Prioritize using parent topology attributes】
Note:
- WRITE_ATTR_SELF_HIGH_PRI and WRITE_ATTR_SELF_LOW_PRI configurations only take effect when attribute inheritance conflicts occur; when there is no conflict, parent topology attributes are automatically inherited.
- Bitwise OR is only used for combining different configurations, such as: FACE_MODE | WRITE_ATTR_NOT_INHERIT
Export TopoShape
Supports exporting points, wires, faces, and solids as discrete geometric entities.
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.
Export to data stream
std::ostringstream os_t;
if (!ret)
{
std::cout << "error" << std::endl;
}
if (!ret)
{
std::cout << "error" << std::endl;
}
Export Label
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;
}
STEP Files
Import
Supports importing part bodies, names, text descriptions, positions, orientations, and simple assembly information.
To be down.
Export
Supports exporting part bodies, names, positions, orientations, colors, and other information.
To be down.