From 526c49467f6e82b0e44f806b1a5e95497535d2ab Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 27 Aug 2009 13:55:31 +0000 Subject: [PATCH] 0020108: EDF 852 SMESH : Add examples in projection algorithm doc Add Projection 1D sample --- .../SMESH/input/tui_defining_hypotheses.doc | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc b/doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc index d410c6c59..8c93ca2e3 100644 --- a/doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc +++ b/doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc @@ -417,6 +417,14 @@ geompy.addToStudyInFather( box, v2F1, "v2F1" ) geompy.addToStudyInFather( box, v1F2, "v1F2" ) geompy.addToStudyInFather( box, v2F2, "v2F2" ) +# Make group of 3 edges of f1 and f2 +edgesF1 = geompy.CreateGroup(f1, geompy.ShapeType["EDGE"]) +geompy.UnionList( edgesF1, geompy.SubShapeAll(f1, geompy.ShapeType["EDGE"])[:3]) +edgesF2 = geompy.CreateGroup(f2, geompy.ShapeType["EDGE"]) +geompy.UnionList( edgesF2, geompy.SubShapeAll(f2, geompy.ShapeType["EDGE"])[:3]) +geompy.addToStudyInFather( box, edgesF1, "edgesF1" ) +geompy.addToStudyInFather( box, edgesF2, "edgesF2" ) + # Make the source mesh with prisms src_mesh = Mesh(box, "Source mesh") @@ -427,24 +435,30 @@ src_mesh.Triangle(f1) # triangular sumbesh src_mesh.Compute() -# Mesh the box using 2D and 3D projection algoritms +# Mesh the box using projection algoritms # Define the same global 1D and 2D hypotheses tgt_mesh = Mesh(box, "Target mesh") tgt_mesh.Segment().NumberOfSegments(9,10,UseExisting=True) tgt_mesh.Quadrangle() -# Define hypotheses to project triangles from f1 face of the source mesh to +# Define Projection 1D algorithm to project 1d mesh elements from group edgesF2 to edgesF1 +# It is actually not needed, just a demonstration +proj1D = tgt_mesh.Projection1D( edgesF1 ) +# each vertex must be at the end of a connected group of edges (or a sole edge) +proj1D.SourceEdge( edgesF2, src_mesh, v2F1, v2F2 ) + +# Define 2D hypotheses to project triangles from f1 face of the source mesh to # f2 face in the target mesh. Vertices specify how to associate sides of faces proj2D = tgt_mesh.Projection2D( f2 ) proj2D.SourceFace( f1, src_mesh, v1F1, v1F2, v2F1, v2F2 ) -# Hypotheses to project triangles from f2 of target mesh to the face opposite to f2. +# 2D hypotheses to project triangles from f2 of target mesh to the face opposite to f2. # Association of face sides is default proj2D = tgt_mesh.Projection2D( f2opp ) proj2D.SourceFace( f2 ) -# Hypotheses to project prisms from the source to the target mesh +# 3D hypotheses to project prisms from the source to the target mesh proj3D = tgt_mesh.Projection3D() proj3D.SourceShape3D( box, src_mesh, v1F1, v1F2, v2F1, v2F2 ) tgt_mesh.Compute() -- 2.39.2