Skip to content

Commit

Permalink
Add logo
Browse files Browse the repository at this point in the history
  • Loading branch information
gha3mi committed Apr 18, 2024
1 parent 4ff6354 commit aeee0e2
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ doc
tmp
mod
*.vtk
pyvista_script.py
pyvista_script.py
*.pvsm
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<img alt="example_bezier" src="https://github.com/gha3mi/forcad/raw/main/vtk/example_bezier.png" width="750">

## Main Features

- Create NURBS objects by specifying control points, weights and knots.
Expand Down
3 changes: 3 additions & 0 deletions ford.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions fpm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
116 changes: 116 additions & 0 deletions logo/logo.f90
Original file line number Diff line number Diff line change
@@ -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
Binary file added logo/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aeee0e2

Please sign in to comment.