2013-02-12 17:35:16 +06:00
|
|
|
# Scale Transform
|
|
|
|
|
|
|
|
import salome
|
2021-08-12 11:43:44 +05:00
|
|
|
salome.salome_init_without_session()
|
2013-04-04 13:06:43 +06:00
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
2017-06-13 14:57:14 +05:00
|
|
|
geompy = geomBuilder.New()
|
2013-02-12 17:35:16 +06:00
|
|
|
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)
|