AMCAX Kernel
Geometry kernel for CAD/CAE/CAM
AMCAX Kernel 1.0.0.0
A Iges File Reading And Writing Example

Overview

This tutorial introduces the basic usage of the AMCAX IGES module.

Usage

Import the header files

#include <iges/IgesIO.hpp>
Class of IgesIO.

Read TopoShape from iges/igs file

AMCAX::IGES::IgesIO::Read(ts, "./iges/test.igs");
static AMCAX_API bool Read(TopoShape &s, const std::string &file)
Read a shape from a file.
Base class of shape, containing an underlying shape with a location and an orientation.
Definition: TopoShape.hpp:15

Write TopoShape to iges/igs file

AMCAX::IGES::IgesIO::Write(ts, "./iges/test1.igs");
static AMCAX_API bool Write(TopoShape &s, const std::string &file, int format=0)
Write a file from TopoShape.

Appendix

The complete code of this sample is listed here:

#include <iges/IgesIO.hpp>
void test_all()
{
if (AMCAX::IGES::IgesIO::Read(ts, "./iges/test.igs"))
if (!ts.IsNull())
AMCAX::IGES::IgesIO::Write(ts, "./iges/test1.igs");
}
AMCAX_API bool IsNull() const
Is the shape null.