Define control points for the NURBS curve Define weights for the control points (optional) Define knot vector
Set knot vector, control points, and weights for the NURBS curve object. Wc is optional
Generate the NURBS curve with a resolution of 20
Find the nearest point on the curve to a given point Find the nearest point on the curve to a given point The optimization method is used to find the nearest point The optimization method is based on the Newton-Raphson method Finalize the NURBS curve object
Type | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|
real(kind=rk), | allocatable | :: | Wc(:) |
Arrays for control points and weights |
||
real(kind=rk), | allocatable | :: | Xc(:,:) |
Arrays for control points and weights |
||
integer | :: | id |
Variable for the id of the nearest point |
|||
real(kind=rk) | :: | knot(6) |
Array for knot vector |
|||
real(kind=rk), | allocatable | :: | nearest_Xg(:) |
Array for the nearest point on the curve |
||
real(kind=rk) | :: | nearest_Xt |
Array for the parametric coordinates of the nearest point |
|||
type(nurbs_curve) | :: | shape |
Declare a NURBS curve object |