Back to index

salome-geom  6.5.0
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes
GEOM_PY.structelem.parts.Beam Class Reference
Inheritance diagram for GEOM_PY.structelem.parts.Beam:
Inheritance graph
[legend]
Collaboration diagram for GEOM_PY.structelem.parts.Beam:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __repr__
def addOrientation
def build

Public Attributes

 filling
 groupName
 name
 geom
 baseShapesSet
 isMainShape
 color

Static Public Attributes

string DEFAULT_NAME = "Beam"

Private Member Functions

def _isReversed
def _getVertexAndTangentOnOrientedWire
def _makeSolidPipeFromWires
def _buildPart
def _buildMarkers

Private Attributes

 _orientation

Detailed Description

This class is an "abstract" class for all 1D structural element parts. It
should not be instantiated directly. See class
:class:`StructuralElementPart` for the description of the parameters.

Definition at line 256 of file parts.py.


Constructor & Destructor Documentation

def GEOM_PY.structelem.parts.Beam.__init__ (   self,
  studyId,
  groupName,
  groupGeomObj,
  parameters,
  name = DEFAULT_NAME,
  color = None 
)

Reimplemented from GEOM_PY.structelem.parts.StructuralElementPart.

Reimplemented in GEOM_PY.structelem.parts.GeneralBeam, GEOM_PY.structelem.parts.RectangularBeam, and GEOM_PY.structelem.parts.CircularBeam.

Definition at line 266 of file parts.py.

00266 
00267                  name = DEFAULT_NAME, color = None):
00268         StructuralElementPart.__init__(self, studyId, groupName, groupGeomObj,
00269                                        parameters, name, color)
00270         self._orientation = orientation.Orientation1D()


Member Function Documentation

Definition at line 174 of file parts.py.

00174 
00175     def __repr__(self):
00176         reprdict = self.__dict__.copy()
00177         del reprdict["_parameters"]
00178         del reprdict["groupName"]
00179         del reprdict["_groupGeomObj"]
00180         del reprdict["_paramUserName"]
00181         del reprdict["name"]
00182         del reprdict["geom"]
00183         del reprdict["baseShapesSet"]
00184         return '%s("%s", %s)' % (self.__class__.__name__, self.groupName,
00185                                  reprdict)

Build the markers defining the orientation of the structural element
part.

Reimplemented from GEOM_PY.structelem.parts.StructuralElementPart.

Definition at line 354 of file parts.py.

00354 
00355     def _buildMarkers(self):
00356         """
00357         Build the markers defining the orientation of the structural element
00358         part.
00359         """
00360         param = 0.5
00361         paths = self._getSubShapes()
00362         listMarkers = []
00363         for path in paths:
00364             (center, vecX) = self._getVertexAndTangentOnOrientedWire(path,
00365                                                                      param)
00366             marker = self._orientation.buildMarker(self.geom, center, vecX)
00367             listMarkers.append(marker)
00368         return listMarkers
00369 

Here is the call graph for this function:

def GEOM_PY.structelem.parts.Beam._buildPart (   self) [private]
Build the structural element part.

Reimplemented from GEOM_PY.structelem.parts.StructuralElementPart.

Definition at line 315 of file parts.py.

00315 
00316     def _buildPart(self):
00317         """
00318         Build the structural element part.
00319         """
00320         # Get all the sub-shapes in the group (normally only edges and wires)
00321         paths = self._getSubShapes()
00322         listPipes = []
00323         withContact = False
00324         withCorrection = False
00325     
00326         for path in paths:
00327             # Build the sections (rectangular or circular) at each end of the
00328             # beam
00329             (fPoint, fNormal) = self._getVertexAndTangentOnOrientedWire(path,
00330                                                                         0.0)
00331             (lPoint, lNormal) = self._getVertexAndTangentOnOrientedWire(path,
00332                                                                         1.0)
00333             (outerWire1, innerWire1, outerWire2, innerWire2) = \
00334                     self._makeSectionWires(fPoint, fNormal, lPoint, lNormal)
00335 
00336             # Create the resulting solid
00337             outerSolid = self._makeSolidPipeFromWires(outerWire1, outerWire2,
00338                                                       fPoint, lPoint, path)
00339             if self.filling == HOLLOW:
00340                 innerSolid = self._makeSolidPipeFromWires(innerWire1,
00341                                                           innerWire2, fPoint,
00342                                                           lPoint, path)
00343                 resultSolid = self.geom.MakeCut(outerSolid, innerSolid)
00344                 listPipes.append(resultSolid)
00345             else:
00346                 listPipes.append(outerSolid)
00347 
00348         if len(listPipes) == 0:
00349             return None
00350         elif len(listPipes) == 1:
00351             return listPipes[0]
00352         else:
00353             return self.geom.MakeCompound(listPipes)

Here is the call graph for this function:

def GEOM_PY.structelem.parts.Beam._getVertexAndTangentOnOrientedWire (   self,
  path,
  param 
) [private]
Get a vertex and the corresponding tangent on a wire by parameter.
This method takes into account the "real" orientation of the wire
(i.e. the orientation of the underlying OCC object).

Definition at line 283 of file parts.py.

00283 
00284     def _getVertexAndTangentOnOrientedWire(self, path, param):
00285         """
00286         Get a vertex and the corresponding tangent on a wire by parameter.
00287         This method takes into account the "real" orientation of the wire
00288         (i.e. the orientation of the underlying OCC object).
00289         """
00290         if self._isReversed(path):
00291             vertex = self.geom.MakeVertexOnCurve(path, 1.0 - param)
00292             invtangent = self.geom.MakeTangentOnCurve(path, 1.0 - param)
00293             tanpoint = self.geom.MakeTranslationVectorDistance(vertex,
00294                                                                invtangent,
00295                                                                -1.0)
00296             tangent = self.geom.MakeVector(vertex, tanpoint)
00297         else:
00298             vertex = self.geom.MakeVertexOnCurve(path, param)
00299             tangent = self.geom.MakeTangentOnCurve(path, param)
00300         return (vertex, tangent)

Here is the call graph for this function:

Here is the caller graph for this function:

def GEOM_PY.structelem.parts.Beam._isReversed (   self,
  path 
) [private]
This method checks if a 1D object is "reversed", i.e. if its
orientation is different than the orientation of the underlying OCC
object.

Definition at line 271 of file parts.py.

00271 
00272     def _isReversed(self, path):
00273         """
00274         This method checks if a 1D object is "reversed", i.e. if its
00275         orientation is different than the orientation of the underlying OCC
00276         object.
00277         """
00278         length = self.geom.BasicProperties(path)[0]
00279         p1 = self.geom.MakeVertexOnCurve(path, 0.0)
00280         p2 = self.geom.GetFirstVertex(path)
00281         dist = self.geom.MinDistance(p1, p2)
00282         return dist > length / 2

Here is the caller graph for this function:

def GEOM_PY.structelem.parts.Beam._makeSolidPipeFromWires (   self,
  wire1,
  wire2,
  point1,
  point2,
  path 
) [private]
Create a solid by the extrusion of section `wire1` to section `wire2`
along `path`.

Definition at line 301 of file parts.py.

00301 
00302     def _makeSolidPipeFromWires(self, wire1, wire2, point1, point2, path):
00303         """
00304         Create a solid by the extrusion of section `wire1` to section `wire2`
00305         along `path`.
00306         """
00307         face1 = self.geom.MakeFace(wire1, True)
00308         face2 = self.geom.MakeFace(wire2, True)
00309         shell = self.geom.MakePipeWithDifferentSections([wire1, wire2],
00310                                                         [point1, point2],
00311                                                         path, False, False)
00312         closedShell = self.geom.MakeShell([face1, face2, shell])
00313         solid = self.geom.MakeSolid([closedShell])
00314         return solid

Here is the caller graph for this function:

def GEOM_PY.structelem.parts.StructuralElementPart.addOrientation (   self,
  orientParams 
) [inherited]
Add orientation information to the structural element part. See class
:class:`~salome.geom.structelem.orientation.Orientation1D` for the description
of the parameters.

Definition at line 186 of file parts.py.

00186 
00187     def addOrientation(self, orientParams):
00188         """
00189         Add orientation information to the structural element part. See class
00190         :class:`~salome.geom.structelem.orientation.Orientation1D` for the description
00191         of the parameters.
00192         """
00193         self._orientation.addParams(orientParams)

Build the geometric shapes and the markers corresponding to the
structural element part in the study `studyId`.

Definition at line 203 of file parts.py.

00203 
00204     def build(self):
00205         """
00206         Build the geometric shapes and the markers corresponding to the
00207         structural element part in the study `studyId`.
00208         """
00209         shape = self._buildPart()
00210         markers = self._buildMarkers()
00211         shape.SetColor(self.color)
00212         for marker in markers:
00213             marker.SetColor(self.color)
00214         return (shape, markers)

Here is the call graph for this function:


Member Data Documentation

Reimplemented from GEOM_PY.structelem.parts.StructuralElementPart.

Definition at line 269 of file parts.py.

Definition at line 139 of file parts.py.

Definition at line 147 of file parts.py.

Reimplemented from GEOM_PY.structelem.parts.StructuralElementPart.

Definition at line 263 of file parts.py.

Definition at line 138 of file parts.py.

Definition at line 133 of file parts.py.

Definition at line 140 of file parts.py.

Definition at line 137 of file parts.py.


The documentation for this class was generated from the following file: