Back to index

salome-smesh  6.5.0
Functions | Variables
ex24_cylinder Namespace Reference

Functions

def group
def discretize

Variables

 geo = geompy
int radius = 50
int height = 200
tuple base = geo.MakeVertex(0, 0, 0)
tuple direction = geo.MakeVectorDXDYDZ(0, 0, 1)
tuple cylinder = geo.MakeCylinder(base, direction, radius, height)
float size = 2.0
tuple box_rot = geo.MakeBox(-size, -size, 0, +size, +size, height)
tuple box_axis = geo.MakeLine(base, direction)
tuple box = geo.MakeRotation(box_rot, box_axis, math.pi/4)
tuple hole = geo.MakeCut(cylinder, box)
int plane_trim = 2000
tuple plane_a = geo.MakePlane(base, geo.MakeVectorDXDYDZ(1, 0, 0), plane_trim)
tuple plane_b = geo.MakePlane(base, geo.MakeVectorDXDYDZ(0, 1, 0), plane_trim)
tuple blocks_part = geo.MakePartition([hole], [plane_a, plane_b], [], [], geo.ShapeType["SOLID"])
list blocks_list = [box]
tuple blocks_all = geo.MakeCompound(blocks_list)
tuple blocks = geo.MakeGlueFaces(blocks_all, 0.0001)
tuple group_a = group("baseA", blocks, "FACE", base, direction)
tuple base_b = geo.MakeVertex(0, 0, height)
tuple group_b = group("baseB", blocks, "FACE", base_b, direction)
tuple group_1 = group("limit", blocks, "SOLID")
tuple group_1_all = geo.SubShapeAllIDs(blocks, geo.ShapeType["SOLID"])
tuple group_1_box = geo.GetBlockNearPoint(blocks, base)
tuple hexa = smesh.Mesh(blocks)
tuple hexa_1d = hexa.Segment()

Function Documentation

def ex24_cylinder.discretize (   x,
  y,
  z,
  n,
  s = blocks 
)

Definition at line 101 of file ex24_cylinder.py.

00101 
00102 def discretize(x, y, z,  n, s=blocks):
00103     p = geo.MakeVertex(x, y, z)
00104     e = geo.GetEdgeNearPoint(s, p)
00105     a = hexa.Segment(e)
00106     a.NumberOfSegments(n)
00107     a.Propagation()

def ex24_cylinder.group (   name,
  shape,
  type,
  base = None,
  direction = None 
)

Definition at line 72 of file ex24_cylinder.py.

00072 
00073 def group(name, shape, type, base=None, direction=None):
00074     t = geo.ShapeType[type]
00075     g = geo.CreateGroup(shape, t)
00076 
00077     geo.addToStudy(g, name)
00078     g.SetName(name)
00079 
00080     if base!=None:
00081         l = geo.GetShapesOnPlaneWithLocationIDs(shape, t, direction, base, geo.GEOM.ST_ON)
00082         geo.UnionIDs(g, l)
00083 
00084     return g


Variable Documentation

tuple ex24_cylinder.base = geo.MakeVertex(0, 0, 0)

Definition at line 39 of file ex24_cylinder.py.

tuple ex24_cylinder.base_b = geo.MakeVertex(0, 0, height)

Definition at line 87 of file ex24_cylinder.py.

tuple ex24_cylinder.blocks = geo.MakeGlueFaces(blocks_all, 0.0001)

Definition at line 65 of file ex24_cylinder.py.

tuple ex24_cylinder.blocks_all = geo.MakeCompound(blocks_list)

Definition at line 64 of file ex24_cylinder.py.

Definition at line 63 of file ex24_cylinder.py.

tuple ex24_cylinder.blocks_part = geo.MakePartition([hole], [plane_a, plane_b], [], [], geo.ShapeType["SOLID"])

Definition at line 62 of file ex24_cylinder.py.

tuple ex24_cylinder.box = geo.MakeRotation(box_rot, box_axis, math.pi/4)

Definition at line 53 of file ex24_cylinder.py.

tuple ex24_cylinder.box_axis = geo.MakeLine(base, direction)

Definition at line 52 of file ex24_cylinder.py.

tuple ex24_cylinder.box_rot = geo.MakeBox(-size, -size, 0, +size, +size, height)

Definition at line 51 of file ex24_cylinder.py.

tuple ex24_cylinder.cylinder = geo.MakeCylinder(base, direction, radius, height)

Definition at line 42 of file ex24_cylinder.py.

tuple ex24_cylinder.direction = geo.MakeVectorDXDYDZ(0, 0, 1)

Definition at line 40 of file ex24_cylinder.py.

Definition at line 28 of file ex24_cylinder.py.

tuple ex24_cylinder.group_1 = group("limit", blocks, "SOLID")

Definition at line 90 of file ex24_cylinder.py.

tuple ex24_cylinder.group_1_all = geo.SubShapeAllIDs(blocks, geo.ShapeType["SOLID"])

Definition at line 91 of file ex24_cylinder.py.

tuple ex24_cylinder.group_1_box = geo.GetBlockNearPoint(blocks, base)

Definition at line 93 of file ex24_cylinder.py.

tuple ex24_cylinder.group_a = group("baseA", blocks, "FACE", base, direction)

Definition at line 85 of file ex24_cylinder.py.

tuple ex24_cylinder.group_b = group("baseB", blocks, "FACE", base_b, direction)

Definition at line 88 of file ex24_cylinder.py.

Definition at line 34 of file ex24_cylinder.py.

Definition at line 108 of file ex24_cylinder.py.

tuple ex24_cylinder.hexa_1d = hexa.Segment()

Definition at line 110 of file ex24_cylinder.py.

tuple ex24_cylinder.hole = geo.MakeCut(cylinder, box)

Definition at line 55 of file ex24_cylinder.py.

tuple ex24_cylinder.plane_a = geo.MakePlane(base, geo.MakeVectorDXDYDZ(1, 0, 0), plane_trim)

Definition at line 59 of file ex24_cylinder.py.

tuple ex24_cylinder.plane_b = geo.MakePlane(base, geo.MakeVectorDXDYDZ(0, 1, 0), plane_trim)

Definition at line 60 of file ex24_cylinder.py.

Definition at line 57 of file ex24_cylinder.py.

Definition at line 33 of file ex24_cylinder.py.

float ex24_cylinder.size = 2.0

Definition at line 49 of file ex24_cylinder.py.