Example program demonstrating how to sweep a straight, pipe-like NURBS volume into a cylindrical helix with a prescribed radius, pitch, and number of turns.
The program:
Creates a straight ring extruded along (a pipe segment),
Refines it along the axial direction (knot insertion + degree elevation),
Maps the control points onto a helix of radius rh
, pitch pitch
, with nturns
turns,
Exports the resulting NURBS volume to VTK,
Displays the geometry.
Type | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|
integer, | parameter | :: | N | = | 50 |
interior knots to insert along . |
real(kind=rk), | parameter | :: | center(3) | = | [0.0_rk, 0.0_rk, 0.0_rk] |
Pipe center . |
integer | :: | i | ||||
real(kind=rk), | parameter | :: | length | = | 1.0_rk |
Length of the straight segment. |
integer, | parameter | :: | nturns | = | 3 |
Number of full turns. |
real(kind=rk), | parameter | :: | pitch | = | 1.5_rk |
Helix pitch (axial rise per full turn). |
real(kind=rk), | parameter | :: | r1 | = | 0.1_rk |
Inner radius of the pipe. |
real(kind=rk), | parameter | :: | r2 | = | 0.2_rk |
Outer radius of the pipe. |
real(kind=rk), | parameter | :: | rh | = | 1.0_rk |
Helix radius. |
type(nurbs_volume) | :: | ring |
Straight pipe ring. |
|||
type(nurbs_volume) | :: | shape |
Helical pipe shape. |
Map a straight pipe-like NURBS volume onto a cylindrical helix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nurbs_volume), | intent(inout) | :: | this |
NURBS volume to be helicalized. |
||
real(kind=rk), | intent(in) | :: | c(3) |
Center , helix radius , pitch . |
||
real(kind=rk), | intent(in) | :: | rh |
Center , helix radius , pitch . |
||
real(kind=rk), | intent(in) | :: | p |
Center , helix radius , pitch . |
||
integer, | intent(in) | :: | n |
Number of turns. |