Skip to content
Snippets Groups Projects
Select Git revision
  • a760bf78ebacfcfbba6d7f33e1dc4be082d7cebf
  • master default protected
  • alphashapes
  • quadMeshingTools
  • cygwin_conv_path
  • macos_arm64
  • add-transfiniteautomatic-to-geo
  • patch_releases_4_10
  • HierarchicalHDiv
  • isuruf-master-patch-63355
  • hyperbolic
  • hexdom
  • hxt_update
  • jf
  • 1618-pythonocc-and-gmsh-api-integration
  • octreeSizeField
  • hexbl
  • alignIrregularVertices
  • getEdges
  • patch_releases_4_8
  • isuruf-master-patch-51992
  • 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
  • gmsh_4_8_4
  • gmsh_4_8_3
  • gmsh_4_8_2
  • gmsh_4_8_1
  • gmsh_4_8_0
  • gmsh_4_7_1
  • gmsh_4_7_0
41 results

wikipedia.py

Blame
  • Forked from gmsh / gmsh
    13825 commits behind the upstream repository.
    Christophe Geuzaine's avatar
    Christophe Geuzaine authored
    No commit message
    a760bf78
    History
    wikipedia.py 695 B
    #!/usr/bin/env python
    
    from gmshpy import *
    
    # from http://en.wikipedia.org/wiki/Constructive_solid_geometry
    
    R = 1.4;
    s = .7;
    t = 1.25;
    myModel = GModel();
    myModel.addBlock([-R,-R,-R],[R,R,R]);
    
    myTool = GModel();
    myTool.addSphere(0,0,0,R*t);
    
    myModel.computeBooleanIntersection(myTool);
    
    myTool2 = GModel();
    myTool2.addCylinder([-2*R,0,0],[2*R,0,0],R*s);
    
    myTool3 = GModel();
    myTool3.addCylinder([0,-2*R,0],[0,2*R,0],R*s);
    
    myModel2 = GModel();
    myModel2.addCylinder([0,0,-2*R],[0,0,2*R],R*s);
    myModel2.computeBooleanUnion(myTool2);
    myModel2.computeBooleanUnion(myTool3);
    
    myModel.computeBooleanDifference(myModel2);
    
    myModel.setAsCurrent();
    
    myModel.mesh(3);
    
    #FlGui.instance();
    #FlGui.run();