# sfepy.mesh.geom_tools module

class sfepy.mesh.geom_tools.geometry(dim=3)

  The geometry is given by a sets of points (d0), lines (d1), surfaces (d2) and volumes (d3). A lines are constructed from 2 points, a surface from any number of lines, a volume from any number of surfaces.

  Physical volumes are contruted from any number of volumes.

  The self.d0, self.d1, self.d2 and self.d3 are dictionaries holding a map

  geometry element number -> instance of point,line,surface of volume

  Examples

  To get all the points which define a surface 5, use:

  self.d2[5].getpoints()

  This would give you a list [..] of point() instances.

  addline(n, l)

    l=[p1,p2]

  addlines(ls, off=1)

    ls=[l1, l2, …]

  addphysicalsurface(n, surfacelist)

    surfacelist=[s1,s2,s3,…]

  addphysicalvolume(n, volumelist)

    volumelist=[v1,v2,v3,…]

  addpoint(n, p)

    p=[x,y,z]

  addpoints(ps, off=1)

    ps=[p1, p2, …]

  addsurface(n, s, is_hole=False)

    s=[l1,l2,l3,…]

  addsurfaces(ss, off=1)

    s=[s1,s2,s3,…]

  addvolume(n, v)

    v=[s1,s2,s3,…]

  addvolumes(vs, off=1)

    v=[v1,v2,v3,…]

  static from_gmsh_file(filename)

    Import geometry - Gmsh geometry format.

    Parameters:
      filename string

        file name

    Returns:
      geo geometry

        geometry description

  getBCnum(snum)
  leaveonlyphysicalsurfaces()
  leaveonlyphysicalvolumes()
  printinfo(verbose=False)
  splitlines(ls, n)
  to_poly_file(filename)

    Export geometry to poly format (tetgen and triangle geometry format).

    Parameters:
      geo geometry

        geometry description

      filename string

        file name

class sfepy.mesh.geom_tools.geomobject
  getn()

class sfepy.mesh.geom_tools.line(g, n, l)
  getpoints()

class sfepy.mesh.geom_tools.physicalsurface(g, n, s)
  getsurfaces()

class sfepy.mesh.geom_tools.physicalvolume(g, n, v)
  getvolumes()

class sfepy.mesh.geom_tools.point(g, n, p)
  getstr()
  getxyz()

class sfepy.mesh.geom_tools.surface(g, n, s, is_hole=False)
  getcenterpoint()
  getholepoints()
  getinsidepoint()
  getlines()
  getpoints()
  separate(s)

class sfepy.mesh.geom_tools.volume(g, n, v)
  getinsidepoint()
  getsurfaces()