Skip to content
Snippets Groups Projects
Select Git revision
  • d2922c38a8899458cb3095062c01f34c4d3f3303
  • master default protected
  • overlaps_tags_and_distributed_export
  • overlaps_tags_and_distributed_export_rebased
  • relaying
  • alphashapes
  • patches-4.14
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
41 results

t8.py

Blame
  • 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()