{"id":22820862,"url":"https://github.com/gha3mi/forcad","last_synced_at":"2026-01-11T13:01:33.191Z","repository":{"id":230476065,"uuid":"778032800","full_name":"gha3mi/forcad","owner":"gha3mi","description":"ForCAD - A parallel Fortran library for geometric modeling using NURBS","archived":false,"fork":false,"pushed_at":"2025-10-03T14:33:55.000Z","size":414528,"stargazers_count":52,"open_issues_count":21,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-03T16:27:25.201Z","etag":null,"topics":["bezier","bsplines","cad","computer-aided-design","curves","do-concurrent","forcad","fortran","fortran-package-manager","mesh","nurbs","openmp","parallel","rational-bezier","surfaces","volumes","vtk"],"latest_commit_sha":null,"homepage":"https://gha3mi.github.io/forcad/","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gha3mi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-27T00:25:05.000Z","updated_at":"2025-09-18T02:59:36.000Z","dependencies_parsed_at":"2025-06-17T22:25:40.926Z","dependency_job_id":"342577f5-baa4-4a5f-a47d-f97a37d98b05","html_url":"https://github.com/gha3mi/forcad","commit_stats":null,"previous_names":["gha3mi/forcad"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/gha3mi/forcad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gha3mi%2Fforcad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gha3mi%2Fforcad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gha3mi%2Fforcad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gha3mi%2Fforcad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gha3mi","download_url":"https://codeload.github.com/gha3mi/forcad/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gha3mi%2Fforcad/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28304263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T11:18:18.743Z","status":"ssl_error","status_checked_at":"2026-01-11T11:07:56.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bezier","bsplines","cad","computer-aided-design","curves","do-concurrent","forcad","fortran","fortran-package-manager","mesh","nurbs","openmp","parallel","rational-bezier","surfaces","volumes","vtk"],"created_at":"2024-12-12T15:42:39.368Z","updated_at":"2026-01-11T13:01:33.145Z","avatar_url":"https://github.com/gha3mi.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub](https://img.shields.io/badge/GitHub-ForCAD-blue.svg?style=social\u0026logo=github)](https://github.com/gha3mi/forcad)\n[![Version](https://img.shields.io/github/v/tag/gha3mi/forcad?label=version\u0026sort=semver)](https://github.com/gha3mi/forcad/releases)\n[![Documentation](https://img.shields.io/badge/ford-Documentation%20-blueviolet.svg)](https://gha3mi.github.io/forcad/)\n[![Setup Fortran Conda CI/CD](https://github.com/gha3mi/forcad/actions/workflows/CI-CD.yml/badge.svg?branch=main)](https://github.com/gha3mi/forcad/actions/workflows/CI-CD.yml)\n[![codecov](https://codecov.io/gh/gha3mi/forcad/branch/main/graph/badge.svg?token=N69NG6C86I)](https://codecov.io/gh/gha3mi/forcad)\n[![License](https://img.shields.io/github/license/gha3mi/forcad?color=green)](https://github.com/gha3mi/forcad/blob/main/LICENSE)\n[![DOI](https://zenodo.org/badge/778032800.svg)](https://zenodo.org/doi/10.5281/zenodo.10904447)\n\n![](logo/logo.png)\n\n**ForCAD**: A parallel Fortran library for geometric modeling using NURBS (Non-Uniform Rational B-Splines).\n\nForCAD supports **B-Spline**, **NURBS**, **Bezier** and **Rational Bezier** curves, surfaces and volumes.\n\n## Table of Contents\n- [Table of Contents](#table-of-contents)\n- [Main Features](#main-features)\n- [Examples](#examples)\n- [Installation](#installation)\n  - [Requirements](#requirements)\n  - [Clone the repository](#clone-the-repository)\n  - [Install PyVista (Optional)](#install-pyvista-optional)\n  - [Using fpm](#using-fpm)\n    - [Running Examples with fpm](#running-examples-with-fpm)\n    - [Using ForCAD as a fpm Dependency](#using-forcad-as-a-fpm-dependency)\n  - [Using CMake](#using-cmake)\n    - [Install](#install)\n    - [Uninstall](#uninstall)\n    - [Using ForCAD with CMake](#using-forcad-with-cmake)\n- [Configuration](#configuration)\n  - [Do Concurrent Support](#do-concurrent-support)\n  - [Precision Configuration](#precision-configuration)\n- [Dependencies](#dependencies)\n- [CI Status](#ci-status)\n- [API documentation](#api-documentation)\n- [Contributing](#contributing)\n- [Citation](#citation)\n- [References](#references)\n\n\n## Main Features\n\n- Parallelized using `do concurrent`.\n- Create NURBS objects by specifying control points, weights and knots.\n- Refine NURBS objects by inserting or removing knots and elevating degree.\n- Compute analytical basis functions and their first and second derivatives for NURBS and B-Spline objects.\n- Generation of IGA-compatible element connectivity and shape functions.\n- Obtain visualized elements connectivity and coordinates for geometry and control geometry.\n- Mesh insertion into a NURBS object.\n- Export NURBS objects to VTK files for visualization.\n- Export of NURBS curves and surfaces to IGES format (volumes currently not supported).\n- Includes predefined NURBS shapes: Circle, Half Circle, Tetragon, Hexahedron, 2D Ring, Half 2D Ring, 3D Ring, Half 3D Ring, C-shapes.\n- Rotate and translate NURBS objects.\n- Visualization using provided python PyVista scripts.\n- Least squares fitting for NURBS curves, surfaces and volumes.\n- Numerical integration of: NURBS curve length, NURBS surface area and NURBS volume.\n\n## Examples\n\nBelow are some sample outputs from the `examples` directory:\n\n\u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/1.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/2.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/3.png\" width=\"30%\"\u003e\n\n\u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/4.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/5.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/6.png\" width=\"30%\"\u003e\n\n\u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/example_bend_pipe90.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/example_bend_pipe270.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/example_bend_pipe360.png\" width=\"30%\"\u003e\n\n\u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/example_helix_pipe.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/example_twist_taper.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/example_toroidal_pipe.png\" width=\"30%\"\u003e\n\n\u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/example_plate_hole_4_3d.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/example_plate_hole_1_3d.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/example_plate_hole_2_2d.png\" width=\"30%\"\u003e\n\n\u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/ppm/example_ppm1.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/ppm/example_ppm2.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/ppm/example_ppm3.png\" width=\"30%\"\u003e\n\n\u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/lsq_fit_bspline_3d.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/poisson_iga_solver_2d.png\" width=\"30%\"\u003e \u003cimg src=\"https://github.com/gha3mi/forcad/raw/main/vtk/poisson_iga_solver_3d.png\" width=\"30%\"\u003e\n\n## Installation\n\n### Requirements\n\n* Fortran compiler:\n\n  * [GNU Fortran (`gfortran`)](https://gcc.gnu.org/fortran/)\n  * [Intel Fortran Compiler (`ifx`)](https://www.intel.com/content/www/us/en/developer/tools/oneapi/hpc-toolkit.html)\n  * [NVIDIA HPC SDK Fortran Compiler (`nvfortran`)](https://developer.nvidia.com/hpc-sdk)\n  * [LLVM Flang (`flang`)](https://flang.llvm.org/)\n\n  **Note:** Latest compiler versions are required to ensure compatibility.\n\n* Build system:\n\n  * [Fortran Package Manager (`fpm`)](https://fpm.fortran-lang.org/) \n  * [CMake](https://cmake.org/)\n\n* Optional visualization tools:\n\n  * [PyVista](https://pyvista.org/) (recommended)\n  * [ParaView](https://www.paraview.org/)\n\n\n### Clone the repository\n\nClone the ForCAD repository from GitHub:\n\n```shell\ngit clone https://github.com/gha3mi/forcad.git\ncd forcad\n```\n\n### Install PyVista (Optional)\n\nTo install PyVista, run the following command:\n\n```shell\npip install pyvista\n```\n\nBy default PyVista visualization is enabled. To disable it, define the preprocessor flag `NOSHOW_PYVISTA` in the `fpm.toml` file or pass it as a compiler flag.\n\n### Using fpm\n\n#### Running Examples with fpm\n\n```shell\nfpm run --example \u003cfile name excluding the .f90 extension\u003e --compiler gfortran --profile release --flag \"-ftree-parallelize-loops=8 -march=native\"\n```\nAfter executing the examples, `.vtk` files will be generated in the `vtk` directory. To visualize these files, a `show()` method is provided which utilizes PyVista. Alternatively, other visualization tools like ParaView can also be used.\n\n\n#### Using ForCAD as a fpm Dependency\n\nIf you want to use ForCAD as a dependency in your own fpm project,\nyou can easily include it by adding the following line to your `fpm.toml` file:\n\n```toml\n[dependencies]\nforcad = {git=\"https://github.com/gha3mi/forcad.git\"}\n```\n\n### Using CMake\n\n#### Install\n\n```shell\ncmake -S . -B build/cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=. -G Ninja\ncmake --build build/cmake --config Release\ncmake --install build/cmake --config Release --verbose\n```\n\n#### Uninstall\n\n```shell\ncmake --build build/cmake --target uninstall\n```\n\n#### Using ForCAD with CMake\n\n```cmake\nfind_package(forcad REQUIRED)\nadd_executable(app main.f90)\ntarget_link_libraries(app PRIVATE forcad::forcad)\n```\n\n## Configuration\n\n### Do Concurrent Support\n\nCompiler flags for enabling `do concurrent` parallelism:\n\n| Compiler      | Flag(s)                                             |\n| ------------- | --------------------------------------------------- |\n| `gfortran`    | `-fopenmp -ftree-parallelize-loops=n`               |\n| `ifx`         | `-qopenmp -fopenmp-target-do-concurrent`            |\n| `nvfortran`   | `-stdpar=multicore,gpu -Minfo=stdpar,accel`         |\n| `flang(-new)` | `-fopenmp -fdo-concurrent-to-openmp=[host\\|device]` |\n| `lfortran`    | ?                                                   |\n\n*flang-new 21.1.0: warning: Mapping `do concurrent` to OpenMP is still experimental.*\n\nCompiler flags can be passed to fpm using the `--flag` option, for example:\n\n```shell\nfpm build --flag \"-stdpar=multicore,gpu -Minfo=stdpar,accel\"\n```\n\nAlternatively, flags can be added to a `fpm.rsp` file in the root directory of the project.\n\n### Precision Configuration\n\nThe library uses **double precision** (`real64`) by default for all real-valued computations. To change the precision, you can define one of the following preprocessor flags during compilation:\n\n| Preprocessor Flag    | Fortran Kind             | Description               |\n| -------------------- | ------------------------ | ------------------------- |\n| `REAL32`             | `selected_real_kind(6)`  | Single precision          |\n| `REAL64` *(default)* | `selected_real_kind(15)` | Double precision          |\n| `REALXDP`            | `selected_real_kind(18)` | Extended double precision |\n| `REAL128`            | `selected_real_kind(33)` | Quadruple precision       |\n\n**Note**: The examples `example_ppm1.f90`, `example_ppm2.f90` and `example_ppm3.f90` use the `ForColormap` library, which only supports `REAL64` precision.\n\nExample: Building with double precision\n\n```bash\nfpm build --profile release --flag \"-DREAL64\"\n```\n\n## Dependencies\n\n```mermaid\nflowchart LR\n  N1[forcad]\n  N2[forIGES]\n  N3[fordebug]\n  N4[forunittest]\n  N5[forimage]\n  N6[forcolormap]\n  N7[fortime]\n  N8[FACE]\n\n  click N1 href \"https://github.com/gha3mi/forcad\" \"A parallel Fortran library for geometric modeling using NURBS\"\n  click N2 href \"https://github.com/rweed/forIGES\" \"Modern Fortran Library for Reading and Writing IGES CAD Files\"\n  click N3 href \"https://github.com/gha3mi/fordebug\" \"A Fortran library for handling errors, warnings and info messages with debugging support in pure procedures\"\n  click N4 href \"https://github.com/gha3mi/forunittest\" \"A Fortran library for unit testing\"\n  click N5 href \"https://github.com/gha3mi/forimage\" \"A Fortran library for processing and editing images and managing colors\"\n  click N6 href \"https://github.com/vmagnin/forcolormap\" \"A Fortran colormap library\"\n  click N7 href \"https://github.com/gha3mi/fortime\" \"A Fortran library for measuring elapsed time, DATE_AND_TIME time, CPU time, OMP time and MPI time\"\n  click N8 href \"https://github.com/szaghi/FACE\" \"Fortran Ansi Colors (and Styles) Environment\"\n\n  %% core dependencies\n  N1 --\u003e N2\n  N1 --\u003e N3\n  N3 --\u003e N7\n  N7 --\u003e N8\n\n  %% example dependency (dashed line)\n  N1 -.-\u003e|example| N6\n  N6 --\u003e N5\n\n  %% test dependency (dotted line)\n  N1 ...-\u003e|test| N4\n  N4 --\u003e N8\n```\nGraph generated with [fpm-deps](https://github.com/ivan-pi/fpm-deps), modified to include example and test dependencies.\n\n## CI Status\n\n\u003c!-- STATUS:setup-fortran-conda:START --\u003e\n| Compiler   | macos | ubuntu | windows |\n|------------|----------------------|----------------------|----------------------|\n| `flang-new` | - | fpm ✅  cmake ✅ | fpm ✅  cmake ✅ |\n| `gfortran` | fpm ✅  cmake ✅ | fpm ✅  cmake ✅ | fpm ✅  cmake ✅ |\n| `ifx` | - | fpm ✅  cmake ✅ | fpm ✅  cmake ✅ |\n| `nvfortran` | - | fpm ✅  cmake ✅ | - |\n\u003c!-- STATUS:setup-fortran-conda:END --\u003e\n\nThis table is automatically generated by the CI workflow using [setup-fortran-conda](https://github.com/gha3mi/setup-fortran-conda).\n\n## API documentation\n\nThe most up-to-date API documentation for the master branch is available\n[here](https://gha3mi.github.io/forcad/).\nTo generate the API documentation for ForCAD using\n[ford](https://github.com/Fortran-FOSS-Programmers/ford) run the following\ncommand:\n\n```shell\nford README.md\n```\n\n## Contributing\n\nTo contribute to ForCAD, please review the [CONTRIBUTING.md](https://github.com/gha3mi/forcad/blob/main/CONTRIBUTING.md).\n\n## Citation\n\nIf you use ForCAD in your research, please cite it as follows:\n\n\n```bibtex\n@software{seyed_ali_ghasemi_2025_10904447,\n  author       = {Ghasemi, S. A.},\n  title        = {gha3mi/ForCAD},\n  year         = {2025},\n  publisher    = {Zenodo},\n  doi          = {10.5281/zenodo.10904447},\n  url          = {https://doi.org/10.5281/zenodo.10904447}\n}\n```\n\n## References\n\n- Piegl, L., \u0026 Tiller, W. (1995). The NURBS Book. In Monographs in Visual Communications. Springer Berlin Heidelberg. [https://doi.org/10.1007/978-3-642-97385-7](https://doi.org/10.1007/978-3-642-97385-7)\n\n- An Introduction to NURBS. (2001). Elsevier. [https://doi.org/10.1016/b978-1-55860-669-2.x5000-3](https://doi.org/10.1016/b978-1-55860-669-2.x5000-3)\n\n- Sullivan et al., (2019). PyVista: 3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK). Journal of Open Source Software, 4(37), 1450, https://doi.org/10.21105/joss.01450\n\n- Ahrens, James, Geveci, Berk, Law, Charles, ParaView: An End-User Tool for Large Data Visualization, Visualization Handbook, Elsevier, 2005, ISBN-13: 9780123875822\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgha3mi%2Fforcad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgha3mi%2Fforcad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgha3mi%2Fforcad/lists"}