nearest_point_2d Program

Uses

  • program~~nearest_point_2d~~UsesGraph program~nearest_point_2d nearest_point_2d module~forcad forcad program~nearest_point_2d->module~forcad module~forcad_kinds forcad_kinds module~forcad->module~forcad_kinds module~forcad_nurbs_curve forcad_nurbs_curve module~forcad->module~forcad_nurbs_curve module~forcad_nurbs_surface forcad_nurbs_surface module~forcad->module~forcad_nurbs_surface module~forcad_nurbs_volume forcad_nurbs_volume module~forcad->module~forcad_nurbs_volume module~forcad_utils forcad_utils module~forcad->module~forcad_utils module~forcad_nurbs_curve->module~forcad_kinds module~forcad_nurbs_curve->module~forcad_utils module~forcad_nurbs_surface->module~forcad_kinds module~forcad_nurbs_surface->module~forcad_utils module~forcad_nurbs_volume->module~forcad_kinds module~forcad_nurbs_volume->module~forcad_utils module~forcad_utils->module~forcad_kinds

Set a surface with 4 control points The weights of the control points (Wc) are optional.

Generate the NURBS surface with resolutions of 30 in both dimensions

Find the nearest point on the surface to a given point Find the nearest point on the surface 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 surface object


Calls

program~~nearest_point_2d~~CallsGraph program~nearest_point_2d nearest_point_2d none~set nurbs_surface%set program~nearest_point_2d->none~set proc~create nurbs_surface%create program~nearest_point_2d->proc~create proc~finalize nurbs_surface%finalize program~nearest_point_2d->proc~finalize proc~nearest_point nurbs_surface%nearest_point program~nearest_point_2d->proc~nearest_point proc~nearest_point2 nurbs_surface%nearest_point2 program~nearest_point_2d->proc~nearest_point2 proc~set1 nurbs_surface%set1 none~set->proc~set1 proc~set2 nurbs_surface%set2 none~set->proc~set2 proc~set3 nurbs_surface%set3 none~set->proc~set3 proc~set4 nurbs_surface%set4 none~set->proc~set4 interface~compute_xg compute_Xg proc~create->interface~compute_xg interface~ndgrid ndgrid proc~create->interface~ndgrid proc~is_rational nurbs_surface%is_rational proc~create->proc~is_rational proc~nearest_point_help_2d nearest_point_help_2d proc~nearest_point->proc~nearest_point_help_2d proc~nearest_point2->proc~create proc~nearest_point2->proc~finalize proc~nearest_point2->proc~nearest_point none~derivative2 nurbs_surface%derivative2 proc~nearest_point2->none~derivative2 proc~cmp_xg nurbs_surface%cmp_Xg proc~nearest_point2->proc~cmp_xg proc~inv inv proc~nearest_point2->proc~inv proc~compute_xg_bspline_2d compute_Xg_bspline_2d interface~compute_xg->proc~compute_xg_bspline_2d proc~compute_xg_bspline_2d_1point compute_Xg_bspline_2d_1point interface~compute_xg->proc~compute_xg_bspline_2d_1point proc~compute_xg_nurbs_2d compute_Xg_nurbs_2d interface~compute_xg->proc~compute_xg_nurbs_2d proc~compute_xg_nurbs_2d_1point compute_Xg_nurbs_2d_1point interface~compute_xg->proc~compute_xg_nurbs_2d_1point proc~ndgrid2 ndgrid2 interface~ndgrid->proc~ndgrid2 proc~ndgrid3 ndgrid3 interface~ndgrid->proc~ndgrid3 proc~derivative2_scalar nurbs_surface%derivative2_scalar none~derivative2->proc~derivative2_scalar proc~derivative2_vector nurbs_surface%derivative2_vector none~derivative2->proc~derivative2_vector proc~cmp_xg->interface~compute_xg proc~cmp_xg->proc~is_rational proc~inv->proc~inv proc~det det proc~inv->proc~det proc~cmp_degree nurbs_surface%cmp_degree proc~set1->proc~cmp_degree proc~cmp_nc nurbs_surface%cmp_nc proc~set1->proc~cmp_nc proc~set2->proc~cmp_nc proc~compute_knot_vector compute_knot_vector proc~set2->proc~compute_knot_vector proc~set3->proc~cmp_degree proc~get_multiplicity nurbs_surface%get_multiplicity proc~cmp_degree->proc~get_multiplicity interface~compute_multiplicity compute_multiplicity proc~cmp_nc->interface~compute_multiplicity proc~repelem repelem proc~compute_knot_vector->proc~repelem proc~basis_bspline basis_bspline proc~compute_xg_bspline_2d->proc~basis_bspline proc~kron kron proc~compute_xg_bspline_2d->proc~kron proc~compute_xg_bspline_2d_1point->proc~basis_bspline proc~compute_xg_bspline_2d_1point->proc~kron proc~cmp_tgc_2d cmp_Tgc_2d proc~compute_xg_nurbs_2d->proc~cmp_tgc_2d proc~compute_xg_nurbs_2d_1point->proc~basis_bspline proc~compute_xg_nurbs_2d_1point->proc~kron proc~derivative2_scalar->proc~is_rational interface~compute_d2tgc compute_d2Tgc proc~derivative2_scalar->interface~compute_d2tgc proc~derivative2_vector->interface~ndgrid proc~derivative2_vector->proc~is_rational proc~derivative2_vector->interface~compute_d2tgc proc~compute_d2tgc_bspline_2d_scalar compute_d2Tgc_bspline_2d_scalar interface~compute_d2tgc->proc~compute_d2tgc_bspline_2d_scalar proc~compute_d2tgc_bspline_2d_vector compute_d2Tgc_bspline_2d_vector interface~compute_d2tgc->proc~compute_d2tgc_bspline_2d_vector proc~compute_d2tgc_nurbs_2d_scalar compute_d2Tgc_nurbs_2d_scalar interface~compute_d2tgc->proc~compute_d2tgc_nurbs_2d_scalar proc~compute_d2tgc_nurbs_2d_vector compute_d2Tgc_nurbs_2d_vector interface~compute_d2tgc->proc~compute_d2tgc_nurbs_2d_vector proc~compute_multiplicity1 compute_multiplicity1 interface~compute_multiplicity->proc~compute_multiplicity1 proc~compute_multiplicity2 compute_multiplicity2 interface~compute_multiplicity->proc~compute_multiplicity2 proc~cmp_tgc_2d->proc~basis_bspline proc~cmp_tgc_2d->proc~kron proc~get_multiplicity->interface~compute_multiplicity proc~compute_d2tgc_bspline_2d_scalar->proc~kron proc~basis_bspline_2der basis_bspline_2der proc~compute_d2tgc_bspline_2d_scalar->proc~basis_bspline_2der proc~compute_d2tgc_bspline_2d_vector->proc~kron proc~compute_d2tgc_bspline_2d_vector->proc~basis_bspline_2der proc~compute_d2tgc_nurbs_2d_scalar->proc~kron proc~compute_d2tgc_nurbs_2d_scalar->proc~basis_bspline_2der proc~compute_d2tgc_nurbs_2d_vector->proc~kron proc~compute_d2tgc_nurbs_2d_vector->proc~basis_bspline_2der

Variables

Type Attributes Name Initial
real(kind=rk) :: Wc(4)

Weights of the control points

real(kind=rk) :: Xc(4,3)

Control points

integer :: id

id of the nearest point

real(kind=rk), allocatable :: nearest_Xg(:)

Coordinates of the nearest point on the surface

real(kind=rk), allocatable :: nearest_Xt(:)

Corresponding parametric coordinates of the nearest point

type(nurbs_surface) :: shape

Declare a NURBS surface object