forIGES - Modern Fortran library for reading and creating IGES CAD files

Introduction

I would like to announce for your enlightenment, edification, possible amusement, and probable befuddlement forIGES , a Modern Fortran library of utilities for reading and creating IGES CAD files for a selected subset of IGES CAD file entities described in the IGES 5.3 specification. The focus of forIGES is on geometric entities such as NURBS curves and surfaces. Therefore, the complete IGES specification is not supported. This release of forIGES should be considered a first beta release and potential users are requested to report any bugs they find and requests for additional support on the projects github site. The project README gives an overview of the project and lists the 38 entities currently supported. A more complete users guide in Markdown and PDF form can be found in the ./doc subdirectory.

Overview

The forIGES library code base consists of nine Fortran modules with utilities for reading the five sections of data found in standard ASCII IGES CAD files along with other utilities that will allow users to create IGES files from their own data. These nine modules comprise 16064 lines of code. A complete description of the function of routines in each module is given in the users guide. The code was tested using over 60 IGES files borrowed from the pyIGES project. These files were selected because they provided test data for a large number of the entiities supported by forIGES. However, not all entities supported by forIGES have been tested due to lack of data. Output files created by forIGES were verified by reading and displaying the results with FreeCad. Six tests programs that also serve as examples of how to do basic tasks with forIGES can be found in the ./test directory. A complete set of HTML documentation of the forIGES API can be generated using FORD.

Building forIGES

Currently forIGES is set up to build on Linux systems using recent versions of Intel, gfortran, and NVIDIA compilers. Attempts were made to use AMD AOCC flang but it failed to generate correct output files and is blacklisted for now. forIGES can be built using either my tried and true set of make files or FPM. Building with make will generate a shared object library (libforIGES.so) along with an archive (libforIGES.a). FPM appears to only generate an archive. However, due to the relatively small number of files that make up forIGES, Windows users should be able to create their own Visual Studio projects or use FPM. Also, if someone wishes to create some CMake files I wonā€™t object. That someone will not be me.

Requested User Feedback

  1. As I just stated I donā€™t do Windows but am willing to accept contributions from users to add Windows support to the project.
  2. If someone can provide some more IGES files that exercise some of the untested entities, I would be grateful.
  3. I would also be grateful if someone with access to the NAG compiler would try building forIGES with NAG and let me know the results
  4. Users with access to commercial CAD programs such as AutoCAD, Solidworks etc are requested to check if those systems will also read files created by forIGES
  5. Currently the workflow required to create an IGES file is very manual (mostly due to a strange circular ā€œpointerā€ dependency in IGES files where Parameter Section data will reference entries in the Directory Entry section that then points back to a Parameter Section entity). Iā€™m looking for ideas on how to improve that process.
  6. Finally I would like to hear about any user issues with the code, documentation and build systems. Iā€™m always open to ideas on how to improve things.

Please post any comments, questions, etc you have about forIGES either here or as a github issue. I request bug reports and change request be only posted on the github site

Future Plans

My ultimate goal for this project is that it will support the translation of IGES non-NURBS entities into NURBS representations where possible and enable users to create their own NURBS specific CAD files. As shown in the References listed in the documentation, the techniques for doing this have been known for several decades now.

All for now,
RW

6 Likes

testGenNURBSsurf
Great job.
I have build it under Windows 10 the 6 tests.
testGenNURBSsurf generates a RogersBsurf.igs.
Very nice. Thank you very much.

Edit:

I have made a pull request to add CMakeLists.txt file.

Very nice!

Do you have any plans to support NURBS volume? Currently, ForCAD supports .vtk files for NURBS curves, surfaces and volumes. Do you think forIGES could be used as an fpm dependency for ForCAD in the future?

Thank you very very much!!!. I presume CMake will create new Makefiles that will overwrite my current ones. No problem. I would like to keep my current make build process in place for a little while longer (but have no problems with removing it once we get CMake in place) so Iā€™ll just rename them something like Makefile_rw and require people who want to use them to do make -f Makefile_rw.

Let me look this over (and to be honest figure out how to handle a pull request on Github :smile:.) Also, thanks for being considerate of other users and setting the minimum required CMake version to 3.20 (I have 3.22 on my Linux Mint system). Not a lot of people who build projects around CMake are that considerate (one of the reasons I avoid using it). I will also be updating the documentation to reflect the addition of CMake

The IGES 5.3 standard defines support for a Manifold Solid B-rep object as well as Constructive Solid Geometry (CSG) objects. Iā€™m already supporting some of the topology entities (edge, face, face loop etc) because they were in GoTools list of supported entities. I donā€™t think adding support for full MSBO would be to hard. The big issue is the user needs to have an understanding of basic topology principles as they apply to MSBO (and CGS). Iā€™ll look at adding full support for MSBO for now.

Also, you have my permission to incorporate forIGES as an integral part of forCAD if you wish. No need to force users to deal with another dependency if it can be avoided.

Note: to do solids you probably need to use STEP instead of IGES. The IGES 5.3 specification is 650 pages long. I believe STEP is even more complicated.

1 Like

I think under Linux, you just:
1.create a folder named for example ā€˜Buildā€™. Same level as SRC folder.
2. Change into that Build folder
3. Key in:
cmake ā€¦
This is to config. The makefile will generate in this folder. (There were two dots after cmake. But show up with three here. Donā€™t know how to correct it. Two dots means get cmakelusts.txt from upper folder.)
4. Key in:
Make
This is to compile. The generated lib file will save into lib folder. Test exes save into bin folder.

Under windows 10, similar if use gfortran. Just need to specify a few things for cmake.

If use Intel Fortran, can do this with cmake-gui.

I have no idea which minimal version of cmake to set. Just copied from my old cmakelists.txt. before it is 3.0. you can change whatever you think is more favorable.

You can just take that cmakelists.txt file and change as you like. I am ok with that.