AMCAX Kernel 1.0.0.0
Loading...
Searching...
No Matches
Data Exchange

Currently, our kernel supports BREP files import and export, mesh file Read and Write (OBJ, STL), IGES file import and export, and STEP file import and export.

BREP File Import and Export

Import

AMCAX::OCCTIO::OCCTTool::Read provide the functionality to import files.

AMCAX::OCCTIO::OCCTTool::Read(shape1, "./data/box.brep");
static AMCAX_API bool Read(TopoShape &s, std::istream &is)
Read a shape from a stream.
Base class of shape, containing an underlying shape with a location and an orientation.
Definition TopoShape.hpp:15

Export

AMCAX::OCCTIO::OCCTTool::Write provide the functionality to export files.

AMCAX::TopoShape box = AMCAX::MakeBox(AMCAX::Point3(-5.0, -5.0, 0.0), AMCAX::Point3(5.0, 5.0, 3.0));
AMCAX::OCCTIO::OCCTTool::Write(box, "./box.brep");
Class of making a box.
Definition MakeBox.hpp:20
static AMCAX_API bool Write(const TopoShape &s, std::ostream &os, int format=3)
Write a shape to a stream.
PointT< double, 3 > Point3
3D point
Definition PointT.hpp:459

Mesh File Read and Write(OBJ, STL)

OBJ

AMCAX::Meshing::Mesh::OBJReader provides the functionality to read files;AMCAX::Meshing::Mesh::OBJWriter provides the functionality to write files.

//read
std::cout << obj_reader.read("./data/cow.obj", io_options) << std::endl;
//write
std::cout << obj_writer.write("cow1.obj", io_options, 10) << std::endl;
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 provide the functionality to import files;AMCAX::Meshing::Mesh::STLWriter provide the functionality to export files.

//read
std::cout << stl_reader.read("./data/cow.stl", io_options2) << std::endl;
//write
std::cout << stl_writer.write("cow2.stl", io_options2, 10) << std::endl;
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 File Import and Export

Import

Support import line, face, and solid. AMCAX::IGES::IgesIO::Read provide the functionality to import files.

//edge
std::cout << AMCAX::IGES::IgesIO::Read(ts1, "./data/edge.igs") << std::endl;
//face
std::cout << AMCAX::IGES::IgesIO::Read(ts2, "./data/face.igs") << std::endl;
//solid
std::cout << AMCAX::IGES::IgesIO::Read(ts1, "./data/solid.igs") << std::endl;
static AMCAX_API bool Read(TopoShape &s, const std::string &file)
Read a shape from a file.

Export

Support export point, line, face, and solid as discrete geometry. AMCAX::IGES::IgesIO::Write provide the functionality to export files.

//solid
s1 = AMCAX::MakeBox(1., 1., 1.);
AMCAX::IGES::IgesIO::Write(s1, "solid.igs");
//vertex
AMCAX::TopoExplorerTool::MapShapes(s1, AMCAX::ShapeType::Vertex, vertexset);
AMCAX::IGES::IgesIO::Write(vertex1, "vertex.igs");
//edge
AMCAX::TopoExplorerTool::MapShapes(s1, AMCAX::ShapeType::Edge, edgeset);
AMCAX::IGES::IgesIO::Write(edge1, "edge.igs");
//face
AMCAX::TopoExplorerTool::MapShapes(s1, AMCAX::ShapeType::Face, faceset);
AMCAX::IGES::IgesIO::Write(face1, "face.igs");
static AMCAX_API bool Write(const TopoShape &s, const std::string &file, int format=0)
Write a file from TopoShape.
Template class of indexed set.
Definition IndexSet.hpp:20
static AMCAX_API const TopoEdge & Edge(const TopoShape &s)
Cast shape to edge.
static AMCAX_API const TopoVertex & Vertex(const TopoShape &s)
Cast shape to vertex.
static AMCAX_API const TopoFace & Face(const TopoShape &s)
Cast shape to face.
Class of edge.
Definition TopoEdge.hpp:12
static AMCAX_API void MapShapes(const TopoShape &s, ShapeType t, IndexSet< TopoShape > &shapeSet)
Construct a set of sub-shapes of given type.
Class of face.
Definition TopoFace.hpp:12
Class of vertex.
Definition TopoVertex.hpp:12

STEP File Import and Export

Import

Support import part body, name, text description, position, orientation, and simple assembly information.
To be down.

Export

Support export part body, name, position, orientation, color, and other information.
To be down.