mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-31 11:50:34 +05:00
IPAL54306: IMACS Support: Section of a mesh with a plane
1) add an example 2) fix a bug
This commit is contained in:
parent
61a2444799
commit
25c9e04a61
34
doc/salome/examples/ex_MakePolyLine.py
Normal file
34
doc/salome/examples/ex_MakePolyLine.py
Normal 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)
|
@ -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 )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user