hexagon logo

Find the closest node to a point

Hi everyone,
 
I am looking for a solution for finding the node of a mesh that is the closest node to a specific point.
Currently, my solution is to export the mesh and writing a specific small code in matlab for doing it but it is not very efficient.
 
Thank you in advance.
 
Best regards
Parents
  • I never has seen this kind of error. Maybe thery is a misundertanding about the usage.
     
    If you copy the following lines in a file with the extension ".ses" and run it with "file-session-play, you get 100 nodes around the center of a tetmeshed cube:
     
    STRING ids[VIRTUAL]
    asm_const_hpat_xyz("1","<1 1 1>","[0 0 0]","Coord 0",ids)
    $# 1 Hpat created: Hpat 1
     
    INTEGER fem_create_mesh_solid_num_nodes
    INTEGER fem_create_mesh_solid_num_elems
    STRING fem_create_mesh_s_nodes_created[VIRTUAL]
    STRING fem_create_mesh_s_elems_created[VIRTUAL]
    fem_create_mesh_sol_5( "Solid 1", "TetHybrid", "Tet10", 4, ["0.03", "0.1", @
    "0.2", "0.0"], 49232, 0, 1, 0, 1, 0.0049999999, "", "#", "#", "Coord 0", @
    "Coord 0", fem_create_mesh_solid_num_nodes, fem_create_mesh_solid_num_elems, @
    fem_create_mesh_s_nodes_created, fem_create_mesh_s_elems_created )
     
    db_commit()
     
    STRING node_list2[VIRTUAL]
    bv_get_closest_nodes_4.get( [0.5 0.5 0.5], 0.05,100, node_list2 )
    dump node_list2
     
Reply
  • I never has seen this kind of error. Maybe thery is a misundertanding about the usage.
     
    If you copy the following lines in a file with the extension ".ses" and run it with "file-session-play, you get 100 nodes around the center of a tetmeshed cube:
     
    STRING ids[VIRTUAL]
    asm_const_hpat_xyz("1","<1 1 1>","[0 0 0]","Coord 0",ids)
    $# 1 Hpat created: Hpat 1
     
    INTEGER fem_create_mesh_solid_num_nodes
    INTEGER fem_create_mesh_solid_num_elems
    STRING fem_create_mesh_s_nodes_created[VIRTUAL]
    STRING fem_create_mesh_s_elems_created[VIRTUAL]
    fem_create_mesh_sol_5( "Solid 1", "TetHybrid", "Tet10", 4, ["0.03", "0.1", @
    "0.2", "0.0"], 49232, 0, 1, 0, 1, 0.0049999999, "", "#", "#", "Coord 0", @
    "Coord 0", fem_create_mesh_solid_num_nodes, fem_create_mesh_solid_num_elems, @
    fem_create_mesh_s_nodes_created, fem_create_mesh_s_elems_created )
     
    db_commit()
     
    STRING node_list2[VIRTUAL]
    bv_get_closest_nodes_4.get( [0.5 0.5 0.5], 0.05,100, node_list2 )
    dump node_list2
     
Children
No Data