Hello,

I'm trying to build a preprocessor for a FE calculation, and I'm running
into a bit of trouble with the mesh generation.  Using the smesh module
in Salome, I could do something like this:

    tetra = smesh.Mesh(part, "Sqmesh")
    algo1D = tetra.Segment()
    algo1D.LocalLength(2.0)
    algo2D = tetra.Triangle()
    algo2D.MaxElementArea(5.0)
    algo3d = tetra.Tetrahedron()
    algo3D.MaxElementVolume(25.0)
    ret = tetra.Compute()

>From the writeup at
http://www.pythonocc.org/resources/meshing/pythonocc-and-smesh/, it
looks like I ought to be able to do essentially the same thing in
pythonocc, but there seems to be a disconnect between the way the code
in the writeup access the mesh generator and its algorithms (i.e.,
meshgen = MT.MeshGen(), etc.) and the module hierarchy present in my
version (0.6-alpha) of pythonocc.  In particular, I can't find a module
called MT, and the SMESH module doesn't have all the same parts.

By looking at the code in the examples directory, I've made a function
to generate a surface mesh for a compound object:

def mesh_compound(comp):
    meshgen = SMESH_Gen()
    themesh = meshgen.CreateMesh(0,True)
    an1DHypothesis = StdMeshers_Arithmetic1D(0,0,meshgen)
    an1DHypothesis.SetLength(0.01, False)
    an1DHypothesis.SetLength(1., True)
    an1dAlgo = StdMeshers_Regular_1D(1,0,meshgen)

    a2dHypothesis = StdMeshers_QuadranglePreference(2,0,meshgen)
    a2dAlgo = StdMeshers_Quadrangle_2D(3,0,meshgen)

    themesh.ShapeToMesh(comp)
    # assign hypotheses
    themesh.AddHypothesis(comp,0)
    themesh.AddHypothesis(comp,1)
    themesh.AddHypothesis(comp,2)
    themesh.AddHypothesis(comp,3)
    #compute
    meshgen.Compute(themesh, themesh.GetShapeToMesh())
    return themesh

My questions are these:
1. Where is the Netgen mesher located?  I can't find it in
OCC.StdMeshers or OCC.SMESH (or anywhere else I've looked, for that matter).
2. There doesn't seem to be a StdMeshers_Triangle_2D. Is that correct?
3. Am I missing something?  I'd prefer to be able to use the
Salome-style syntax, as it is clearer to me, but I can't figure out how
to do so.

Again, I'm using OCE version 0.12, pythonocc version 0.6dev, python
2.7.2 on os X 10.8

Thanks,
Cavendish

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to