diff --git a/.gitignore b/.gitignore index 3b0b0b41d..e5e22cb45 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ doc tmp mod *.vtk -pyvista_script.py \ No newline at end of file +pyvista_script.py +*.pvsm \ No newline at end of file diff --git a/README.md b/README.md index a8d14376b..5c211954f 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,12 @@ [![License](https://img.shields.io/github/license/gha3mi/forcad?color=green)](https://github.com/gha3mi/forcad/blob/main/LICENSE) [![DOI](https://zenodo.org/badge/778032800.svg)](https://zenodo.org/doi/10.5281/zenodo.10904447) +![logo](logo/logo.png) + **ForCAD**: A Fortran library for Geometric Modeling using NURBS (Non-Uniform Rational B-Splines). ForCAD supports **B-Spline**, **NURBS**, **Bezier**, and **Rational Bezier** curves, surfaces, and volumes. -example_bezier - ## Main Features - Create NURBS objects by specifying control points, weights and knots. diff --git a/ford.yml b/ford.yml index fb5fd5e40..4e552f112 100644 --- a/ford.yml +++ b/ford.yml @@ -1,6 +1,8 @@ project: ForCAD version: 0.4.0 year: 2024 +summary: ![ForCAD](|media|/logo.png) + {: style="text-align: center" } project_github: https://github.com/gha3mi/forcad author: Seyed Ali Ghasemi email: info@gha3mi.com @@ -9,6 +11,7 @@ license: BSD 3-Clause src_dir: ./src ./example output_dir: ./doc +media_dir: ./logo source: true incl_src: true graph: true diff --git a/fpm.toml b/fpm.toml index a6c0db43c..f70521cf0 100644 --- a/fpm.toml +++ b/fpm.toml @@ -36,6 +36,11 @@ name = "demo_volume" source-dir = "example" main = "demo_volume.f90" +[[example]] +name = "logo" +source-dir = "logo" +main = "logo.f90" + [[example]] name = "example_curve_1" source-dir = "example" diff --git a/logo/logo.f90 b/logo/logo.f90 new file mode 100644 index 000000000..9d999a235 --- /dev/null +++ b/logo/logo.f90 @@ -0,0 +1,116 @@ +program logo + + use forcad, only: rk, nurbs_volume + + implicit none + type(nurbs_volume) :: shape + + !> F + call shape%set_hexahedron(L=[1.0_rk, 1.0_rk, 7.0_rk], nc=[2,2,2]) + call shape%export_Xc('vtk/logo_Xc_1.vtk') + call shape%create(3*3, 3*3, 21*3) + call shape%export_Xg('vtk/logo_Xg_1.vtk') + call shape%finalize() + + call shape%set_hexahedron(L=[2.0_rk, 1.0_rk, 1.0_rk], nc=[2,2,2]) + call shape%translate_Xc([1.0_rk, 0.0_rk, 6.0_rk]) + call shape%export_Xc('vtk/logo_Xc_2.vtk') + call shape%create(6*3, 3*3, 3*3) + call shape%export_Xg('vtk/logo_Xg_2.vtk') + call shape%finalize() + + call shape%set_hexahedron(L=[1.0_rk, 1.0_rk, 1.0_rk], nc=[2,2,2]) + call shape%translate_Xc([1.0_rk, 0.0_rk, 3.0_rk]) + call shape%export_Xc('vtk/logo_Xc_3.vtk') + call shape%create(3*3, 3*3, 3*3) + call shape%export_Xg('vtk/logo_Xg_3.vtk') + call shape%finalize() + + !> o + call shape%set_ring([0.0_rk, 0.0_rk, 0.0_rk], 1.0_rk, 2.0_rk, 1.0_rk) + call shape%rotate_Xc(90.0_rk, 0.0_rk, 0.0_rk) + call shape%translate_Xc([5.0_rk, 1.0_rk, 2.0_rk]) + call shape%export_Xc('vtk/logo_Xc_4.vtk') + call shape%create(60, 15, 10) + call shape%export_Xg('vtk/logo_Xg_4.vtk') + call shape%finalize() + + !> r + call shape%set_hexahedron(L=[1.0_rk, 1.0_rk, 4.0_rk], nc=[2,2,2]) + call shape%translate_Xc([8.0_rk, 0.0_rk, 0.0_rk]) + call shape%export_Xc('vtk/logo_Xc_5.vtk') + call shape%create(3*3, 3*3, 6*3) + call shape%export_Xg('vtk/logo_Xg_5.vtk') + call shape%finalize() + + call shape%set_hexahedron(L=[1.0_rk, 1.0_rk, 4.0_rk], nc=[2,2,4]) + call shape%modify_Xc(1.8_rk,13,1) + call shape%modify_Xc(2.8_rk,14,1) + call shape%modify_Xc(1.8_rk,15,1) + call shape%modify_Xc(2.8_rk,16,1) + call shape%modify_Xc(3.55_rk,13,3) + call shape%modify_Xc(3.55_rk,15,3) + + call shape%translate_Xc([8.0_rk, 0.0_rk, 0.0_rk]) + call shape%export_Xc('vtk/logo_Xc_6.vtk') + call shape%create(3*3, 3*3, 6*3) + call shape%export_Xg('vtk/logo_Xg_6.vtk') + call shape%finalize() + + !> C + call shape%set_half_ring([0.0_rk, 0.0_rk, 0.0_rk], 5.0_rk, 7.0_rk, 1.0_rk) + call shape%rotate_Xc(90.0_rk, -90.0_rk, 0.0_rk) + call shape%translate_Xc([15.0_rk, 1.0_rk, 3.5_rk]) + call shape%export_Xc('vtk/logo_Xc_7.vtk') + call shape%create(15*3, 3*3, 6*3) + call shape%export_Xg('vtk/logo_Xg_7.vtk') + call shape%finalize() + + + !> A + call shape%set_hexahedron(L=[1.0_rk, 1.0_rk, 7.0_rk], nc=[2,2,2]) + call shape%translate_Xc([16.0_rk, 0.0_rk, 0.0_rk]) + call shape%modify_Xc(17.0_rk,5,1) + call shape%modify_Xc(18.0_rk,6,1) + call shape%modify_Xc(17.0_rk,7,1) + call shape%modify_Xc(18.0_rk,8,1) + call shape%export_Xc('vtk/logo_Xc_8.vtk') + call shape%create(3*3, 3*3, 21*3) + call shape%export_Xg('vtk/logo_Xg_8.vtk') + call shape%finalize() + + call shape%set_hexahedron(L=[1.0_rk, 1.0_rk, 7.0_rk], nc=[2,2,2]) + call shape%translate_Xc([17.0_rk, 0.0_rk, 0.0_rk]) + call shape%modify_Xc(19.0_rk,1,1) + call shape%modify_Xc(20.0_rk,2,1) + call shape%modify_Xc(19.0_rk,3,1) + call shape%modify_Xc(20.0_rk,4,1) + call shape%export_Xc('vtk/logo_Xc_9.vtk') + call shape%create(3*3, 3*3, 21*3) + call shape%export_Xg('vtk/logo_Xg_9.vtk') + call shape%finalize() + + call shape%set_hexahedron(L=[1.5_rk, 1.0_rk, 1.0_rk], nc=[2,2,2]) + call shape%translate_Xc([17.0_rk, 0.0_rk, 3.0_rk]) + call shape%export_Xc('vtk/logo_Xc_10.vtk') + call shape%create(3*3, 3*3, 3*3) + call shape%export_Xg('vtk/logo_Xg_10.vtk') + call shape%finalize() + + !> D + call shape%set_hexahedron(L=[1.0_rk, 1.0_rk, 7.0_rk], nc=[2,2,2]) + call shape%translate_Xc([21.0_rk, 0.0_rk, 0.0_rk]) + call shape%export_Xc('vtk/logo_Xc_11.vtk') + call shape%create(3*3, 3*3, 21*3) + call shape%export_Xg('vtk/logo_Xg_11.vtk') + call shape%finalize() + + call shape%set_half_ring([0.0_rk, 0.0_rk, 0.0_rk], 5.0_rk, 7.0_rk, 1.0_rk) + call shape%rotate_Xc(90.0_rk, 90.0_rk, 0.0_rk) + call shape%translate_Xc([22.0_rk, 1.0_rk, 3.5_rk]) + call shape%export_Xc('vtk/logo_Xc_12.vtk') + call shape%create(15*3, 3*3, 6*3) + call shape%export_Xg('vtk/logo_Xg_12.vtk') + call shape%finalize() + +end program diff --git a/logo/logo.png b/logo/logo.png new file mode 100644 index 000000000..f440052c8 Binary files /dev/null and b/logo/logo.png differ