Commit 8cb932b8 by Christophe Geuzaine

sphere surf example

parent 8d618864
......@@ -37,7 +37,7 @@ include(CTest)
file(GLOB DEMOS *.cpp)
foreach(DEMO ${DEMOS})
get_filename_component(DEMONAME ${DEMO} NAME_WE)
if(${DEMONAME} MATCHES "(gui|adapt_mesh|spline)")
if(${DEMONAME} MATCHES "(gui|adapt_mesh|spline|spherical_surf)")
add_executable(${DEMONAME} WIN32 MACOSX_BUNDLE ${DEMO})
if(APPLE)
add_test(${DEMONAME} ${DEMONAME}.app/Contents/MacOS/${DEMONAME})
......
import gmsh
gmsh.initialize(ARGS)
gmsh.model.add("sphere_cut")
R = 1
R1 = 0.95
sph = gmsh.model.occ.addSphere(0,0,0, R, -1, 0, pi/2, pi/2)
b1 = gmsh.model.occ.addBox(R1,0,0, R,R,R)
b2 = gmsh.model.occ.addBox(0,R1,0, R,R,R)
b3 = gmsh.model.occ.addBox(0,0,R1, R,R,R)
gmsh.model.occ.cut([(3,sph)], [(3,b1), (3,b2), (3,b3)])
gmsh.model.occ.synchronize()
gmsh.model.removeEntities([(3,sph)])
gmsh.model.removeEntities([(2,2), (2,4), (2,6)], true)
gmsh.fltk.run()
gmsh.finalize()
import gmsh
import sys
import math
gmsh.initialize(sys.argv)
gmsh.model.add("sphere_cut")
R = 1
R1 = 0.95
sph = gmsh.model.occ.addSphere(0,0,0, R, -1, 0, math.pi/2, math.pi/2)
b1 = gmsh.model.occ.addBox(R1,0,0, R,R,R)
b2 = gmsh.model.occ.addBox(0,R1,0, R,R,R)
b3 = gmsh.model.occ.addBox(0,0,R1, R,R,R)
gmsh.model.occ.cut([(3,sph)], [(3,b1), (3,b2), (3,b3)])
gmsh.model.occ.synchronize()
gmsh.model.removeEntities([(3,sph)])
gmsh.model.removeEntities([(2,2), (2,4), (2,6)], True)
gmsh.fltk.run()
gmsh.finalize()
SetFactory("OpenCASCADE");
R = 1;
R1 = 0.95;
Sphere(1) = {0,0,0, R, 0, Pi/2, Pi/2};
Box(2) = {R1,0,0, R,R,R};
Box(3) = {0,R1,0, R,R,R};
Box(4) = {0,0,R1, R,R,R};
BooleanDifference{ Volume{1}; Delete; }{ Volume{2:4}; Delete; }
Delete{ Volume{1}; }
Recursive Delete{ Surface{2,4,6}; }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment