mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-12 00:29:18 +05:00
7961b83044
This reverts commit 3cd92817cb
.
28 lines
681 B
Python
28 lines
681 B
Python
# Scale Transform
|
|
|
|
import salome
|
|
salome.salome_init()
|
|
import GEOM
|
|
from salome.geom import geomBuilder
|
|
geompy = geomBuilder.New(salome.myStudy)
|
|
gg = salome.ImportComponentGUI("GEOM")
|
|
|
|
# create a box and a sphere
|
|
box = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
|
|
|
# scale the given object by the factor
|
|
p0 = geompy.MakeVertex(100, 100, 100)
|
|
factor = 0.5
|
|
scale = geompy.MakeScaleTransform(box, p0, factor)
|
|
|
|
# add objects in the study
|
|
id_box = geompy.addToStudy(box, "Box")
|
|
id_scale = geompy.addToStudy(scale, "Scale")
|
|
|
|
# display the results
|
|
gg.createAndDisplayGO(id_box)
|
|
gg.setDisplayMode(id_box,1)
|
|
gg.setTransparency(id_box,0.5)
|
|
gg.createAndDisplayGO(id_scale)
|
|
gg.setDisplayMode(id_scale,1)
|