Contrib:KeesWouters/partition

From CAELinuxWiki
Revision as of 15:11, 26 May 2009 by Keeswouters (Talk | contribs) ('''Partitioning the various parts''')

Jump to: navigation, search

Defining a construction with four bodies in Salome

The construction consists of a shoe box, a plate on top of it and two cylinders inside the top plate. In total four different bodies are created by partitioning the main body. Each body can have different materials applied to it in the C-Aster command file.

Kw part400.jpg * Kw part400t.jpg


General definition of the construction with Salome

First a solid block is defined by the geompy.MakeBoxDXDYDZ(3,5,2). The internal block to cut away a apart of this block is defined by the four outside nodes, linking the nodes by lines and defining. A face is defined by the four lines. Extruding the face up to 1.8 mm high then defines a solid block. After this a shoe box remains with wallthickness of 0.2 mm.

On top of this shoebox a top plate is defined. It outer dimensions are 0.2 mm less than the shoebox and height is 0.8 mm.

Inside the top plate two cylinders are defined, radii 0.7 and 0.5 and height 1.0 mm. These two cylinders consist of one solid only within Salome because they are defined at once using the two axial areas of the cylinders.

Fusing the various parts

Now all parts are defined and we can fuse the three parts together. This is necessary if we want a mesh that is 'glued' together between the various parts. So we fuse:

# Fshoecyl <-- shoebox and cylinders and use the result together with top plate
# Fassembl <-- Fshoecyl and Btop

Now one solid part exists. To be able to apply different material properties to the various parts, we need to partition them again.

Partitioning the various parts

In order to partition the parts we need to define the boundaries between the parts.


  • Between the shoebox on the one hand and the top plate and cylinders on the other hand, we define a plane P12, that coincides with the top plane of the shoe box. We generate a centre point, a vector in z direction and define a size for this plane: P12 = geompy.MakePlane(centre point, direction vector, plane size). Make sure that the size Psize is large enough to cover the whole top plane of the shoe box. If this is not the case, Salome fails to partition the bottom and top parts.
  • Between the cylinders and the top plate the areas of cylinders can be used as a boundary between these parts. Again, make sure that the height of the area is enough to cover the cylinders, otherwise Salome fails to generate the partition.

Kw surface400.jpg

Now the partition can be calculated by MakePartition. The first argument is the fused body (Fassembl), the second argument are the dividing planes determined above. It is possible here to define multiple dividing planes, so the partition can be made in one go: Partit=geompy.MakePartition([Fassembl],[P12,PCyl1,PCyl2],[],[],geompy.ShapeType["SOLID"],0,[],0)

Now most of the work has been done. We still need to create the groups under the entity Partit by CreateGroup(), UnionIDs() and GetMainShape(). See the attached Python script for more details.