Skip to content
Snippets Groups Projects
Select Git revision
  • 3b5475d6288e12ff1794e3adcd5a6d0d38f61cdb
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

GModel.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    closest_point.py 523 B
    import gmsh
    import sys
    
    gmsh.initialize()
    
    # add a circle
    c = gmsh.model.occ.addCircle(0, 0, 0, 1)
    gmsh.model.occ.synchronize()
    
    # find closet point to (1.3, 1.3) by orthogonal projection on the curve c
    p, t = gmsh.model.getClosestPoint(1, c, [1.3, 1.3, 0])
    
    # add a point on the projection
    pp = gmsh.model.occ.addPoint(p[0], p[1], p[2])
    
    # fragment the curve with the new point
    gmsh.model.occ.fragment([(0, pp)], [(1, c)])
    
    gmsh.model.occ.synchronize()
    
    if '-nopopup' not in sys.argv:
        gmsh.fltk.run()
    
    gmsh.finalize()