IPAL54306: IMACS Support: Section of a mesh with a plane

1) add an example
2) fix a bug
This commit is contained in:
eap 2017-08-30 22:08:24 +03:00
parent 61a2444799
commit 25c9e04a61
2 changed files with 35 additions and 2 deletions

View File

@ -0,0 +1,34 @@
import salome
salome.salome_init()
### create geometry
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
geompy.addToStudy( Box_1, 'Box_1' )
### create a mesh
import SMESH
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
Mesh_1 = smesh.Mesh( Box_1 )
Mesh_1.Segment().NumberOfSegments(15)
Mesh_1.Triangle()
Mesh_1.Compute()
# define arguments for MakePolyLine
segments = []
segments.append( SMESH.PolySegment( 20, 0, 1, 0, smesh.MakeDirStruct(0,0,0) ))
segments.append( SMESH.PolySegment( 1, 0, 200, 0, smesh.MakeDirStruct(0,0,0) ))
segments.append( SMESH.PolySegment( 200, 0, 578, 577, smesh.MakeDirStruct(1,1,1) ))
Mesh_1.MakePolyLine( segments, "1D group")
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(True)

View File

@ -12921,8 +12921,7 @@ namespace // utils for MakePolyLine
{
ok = ( myDot1 != myDot2 );
if ( ok && myFace )
ok = ( myFace->GetNodeIndex( myNode1._node ) < 0 &&
myFace->GetNodeIndex( myNode2._node ) < 0 );
ok = ( myFace->GetNodeIndex(( myDot1 == 0 ? myNode1 : myNode2 )._node ) < 0 );
}
if ( ok )
{