ForCAD - A Fortran library for Geometric Modeling

Recently, I created a project called ForCAD, which generates Bezier, Rational Bezier, B-spline, and NURBS curves, surfaces, and volumes. ForCAD functions as a mesh generation tool, applicable for Finite Element Method (FEM) and Isogeometric Analysis (IGA).

13 Likes

This looks promising. I would suggest you add the following in future releases (particularly if you want to support IGA).

  1. Derivatives of objects (curves, surfaces, volumes) along with derivatives of basis functions
  2. Parametrization of objects (knot vectors)
  3. Merging of curves and surfaces with at least C1 continuity.
  4. Extraction of piecewise Bezier objects from NURBS
  5. degree elevation and deflation (knot insertion).

There are a host of other things that will be required (and probably several years work) if you want to match openCascade or the SINTEF GO tools but this is a good start.

1 Like

Thanks @rwmsu for your feedback.

I have implementations for derivatives; this will be added soon.

I tried achieving C^0 continuity for multiple patches, but achieving higher continuity for multiple patches seems not easy. Actually, I’ve been looking for such an algorithm for a while. If you know of any algorithm or references for that, I would be happy to learn about it.

Yes, this is very much needed. Degree elevation for Bezier and rational Bezier curves is supported. It must be extended for surfaces and volumes. Degree elevation and reduction, as well as knot insertion and removal, are on the to-do list.

Do you mean a derived type for knot vectors? Actually, I have a more complicated implementation for NURBS, which sometimes makes development very difficult. I thought of simplifying it for ForCAD. But a derived type for knot vectors is a good idea! I will add it to the to-do list.

This is also a good idea. Since I haven’t used it within IGA, I never thought to implement it. I will add it to the to-do list.

Yes, there are many features that can be added to ForCAD. If there is any interest in contribution, I would be happy.

By parameterization, I mean generating the normalized (or parameterized) knot vector based on some distribution in physical space, normally some measure of arc length for curves. The idea is to find something approaching an optimum knot vector spacing that minimizes errors in the resulting object. For surfaces and volumes it gets more complicated and will involve techniques like solving a harmonic (elliptic) system of equations to get something near to an optimum distribution. See the parameterization code based on the work of Michael Floater in the SINTEF GOtools software. I do recommend a separate knotVector class. About 15 years ago I started writing my own Fortran NURBS package to support IGA but gave it up when I couldn’t convince anybody to fund me to complete it. I’m retired now so maybe I’ll give it another look

2 Likes

This is great, the Fortran open source community keeps growing! I’ve been looking on and off for a package to calculate FEA element volumes for a while now, seem like this would be able to do that?

1 Like

Thank you, @rwmsu. It’s great to hear that you’ve worked on NURBS and IGA. I also have an implementation for IGA, but at the moment, I don’t have time to create a repository for it. I will check out SINTEF GOtools.

@Chuckyvt , ForCAD is currently focused on describing geometries using NURBS. However, if you have FEM or IGA software, it can be used as a preprocessor to generate meshes. ForCAD provides you with element connectivity.

ForCAD v0.2.0 now supports knot insertion, degree elevation, and calculation of derivatives for NURBS curves, surfaces and volumes. To help test the functionalities and improve the library, please submit any NURBS examples if you already have as pull requests (PRs). Your contributions will greatly enhance ForCAD. Thank you!

3 Likes

ForCAD now supports knot removal, embedding meshes into NURBS, retrieving IGA element connectivity, and includes some predefined NURBS shapes such as circle, half circle, tetragon, hexahedron, 2D ring, half 2D ring, 3D ring, half 3D ring. It also includes rotatation and translation of geometry and control geometry, along with visualization using PyVista. Below is an example of embedding meshes into a NURBS volume and visualizing it using PyVista.

A logo has also been designed using ForCAD and visualized using ParaView.

Additionally, I have added new examples that convert NURBS surfaces to PPM images using ForImage and colorize them using ForColormap.



12 Likes