Example program demonstrating how to bend a straight pipe-like NURBS volume into a circular arc.
The program: Creates a straight pipe segment (as a ring extruded in ), Refines the shape, Applies bending with different bend angles (90°, 270°, 360°), Exports the resulting NURBS volumes to VTK, Displays the geometry.
Type | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|
real(kind=rk), | parameter | :: | a(3) | = | [90.0_rk, 270.0_rk, 360.0_rk] |
Bend angles (degrees). |
real(kind=rk), | parameter | :: | c(3) | = | [0.0_rk, 0.0_rk, 0.0_rk] |
Center of the ring. |
real(kind=rk), | parameter | :: | l | = | 1.0_rk |
Length of the straight segment. |
real(kind=rk), | parameter | :: | r1 | = | 0.3_rk |
Inner radius of the pipe. |
real(kind=rk), | parameter | :: | r2 | = | 0.5_rk |
Outer radius of the pipe. |
real(kind=rk), | parameter | :: | rb | = | 1.5_rk |
Bend radius. |
type(nurbs_volume) | :: | ring |
Straight pipe ring |
|||
type(nurbs_volume) | :: | shape |
Bent pipe shape |
Bend a straight pipe-like NURBS volume into a circular arc. Each control point is transformed relative to the center . Let the total bend angle in degrees be (input), and define the total bend angle in radians For each control point: Mapping: Knots and weights are preserved; only the control lattice is updated.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(nurbs_volume), | intent(inout) | :: | this |
NURBS volume to be bent. |
||
real(kind=rk), | intent(in) | :: | center(3) |
Pipe center coordinates . |
||
real(kind=rk), | intent(in) | :: | radius1 |
Inner radius of the pipe (not used in bending). |
||
real(kind=rk), | intent(in) | :: | radius2 |
Outer radius of the pipe (not used in bending). |
||
real(kind=rk), | intent(in) | :: | length |
Length of the straight pipe segment before bending. |
||
real(kind=rk), | intent(in) | :: | rbend |
Bend radius , i.e. distance from the bend centerline. |
||
real(kind=rk), | intent(in) | :: | angle_deg |
Bend angle in degrees . |