Dear all,
I’m experiencing a graphical issue when running a Python script in Salome.
The following script creates a hexagonal face (in the XY plane) with edges connecting the XYZ origin to each corner of the hexagon.
Both the face object and the compound of the edges are added to the current study.
However, when I show the elements in the 3D viewer, the edges between the center and the hexagon corners cannot be seen as the marker identifying the XYZ origin hides them completely (please, see the attached image).
Is there any way to disable this behaviour?
import salome
import GEOM
from salome.geom import geomBuilder
import math
salome.salome_init()
geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
# Parameters
side_length = 1
apothem = 0.866
# Create the vertices of the hexagon
vertices = []
for i in range(6):
angle = math.pi / 3 * i
x = side_length * math.cos(angle)
y = side_length * math.sin(angle)
vertices.append(geompy.MakeVertex(x, y, 0))
# Create the edges of the hexagon
edges = []
for i in range(6):
edges.append(geompy.MakeEdge(vertices[i], vertices[(i + 1) % 6]))
# Create the face of the hexagon
hexagon_face = geompy.MakeFaceWires(edges, 1)
# Add edges from the XYZ origin to the hexagon corners
for i in range(6):
edges.append(geompy.MakeEdge(O, vertices[i]))
# Add to study
geompy.addToStudy( O, 'O' )
geompy.addToStudy( OX, 'OX' )
geompy.addToStudy( OY, 'OY' )
geompy.addToStudy( OZ, 'OZ' )
geompy.addToStudy(hexagon_face, "Hexagon")
geompy.addToStudyInFather(
hexagon_face, geompy.MakeCompound(edges), "Hexagon edges")