Personal tools
You are here: Home Forum Use Rotating shapes together with groups attached

Rotating shapes together with groups attached

Up to Use

Rotating shapes together with groups attached

Posted by Malleus at February 02. 2019

Hello,

suppose I have a shape Shape_1 together with groups of subshapes Group_1, Group_2, ..., where the groups have been attached to the "father" shape by means of

          geompy.addToStudyInFather(Shape_1, Group_1, 'Group_1') , etc.

Now when I rotate Shape_1 via

          geompy.Rotate(Shape_1, axis, angle) ,

I note that the groups have been left in their old orientation; supposedly I would have to manually rotate each of them in a separate step.

Is there a way to rotate the "father" shape together with its groups attached, in a single command?

 

Thank you very much.

Re: Rotating shapes together with groups attached

Posted by Saint Michael at February 04. 2019

Hi

There is no way to transform groups together with the main shape. Another possible approach is to transform the main shape WITH COPY and then restore groups using geompy.RestoreSubShapes() command. In your case:

Shape_2 = geompy.Rotate(Shape_1, axis, angle, theCopy=True)

groups = geompy.RestoreSubShapes( Shape_2, [], GEOM.FSM_Transformed, True, False)

geompy.RestoreSubShapes() command corresponds to "Set presentation parameters and sub-shapes from arguments" parameter in Rotation and other dialogs.

St.Michael

Re: Rotating shapes together with groups attached

Posted by Malleus at February 04. 2019

Thank you very much!

 

Previously Saint Michael wrote:

Hi

There is no way to transform groups together with the main shape. Another possible approach is to transform the main shape WITH COPY and then restore groups using geompy.RestoreSubShapes() command. In your case:

Shape_2 = geompy.Rotate(Shape_1, axis, angle, theCopy=True)

groups = geompy.RestoreSubShapes( Shape_2, [], GEOM.FSM_Transformed, True, False)

geompy.RestoreSubShapes() command corresponds to "Set presentation parameters and sub-shapes from arguments" parameter in Rotation and other dialogs.

St.Michae

 

Re: Rotating shapes together with groups attached

Posted by Mary at October 01. 2019

Hi Michael,

 

I tried to do this in salome 6/7/9.3 and this does not work for Rotate. However, it works for TranslateDXDYDZ with theCopy=True. Can you think of something why Rotate with theCopy=True is not working.

 

Many thanks!

 

 

Previously Saint Michael wrote:

Hi

There is no way to transform groups together with the main shape. Another possible approach is to transform the main shape WITH COPY and then restore groups using geompy.RestoreSubShapes() command. In your case:

Shape_2 = geompy.Rotate(Shape_1, axis, angle, theCopy=True)

groups = geompy.RestoreSubShapes( Shape_2, [], GEOM.FSM_Transformed, True, False)

geompy.RestoreSubShapes() command corresponds to "Set presentation parameters and sub-shapes from arguments" parameter in Rotation and other dialogs.

St.Michael

 

 

Re: Rotating shapes together with groups attached

Posted by Saint Michael at October 01. 2019

Hi

See the attached script for Rotate()

St.Michael

Attachments
Powered by Ploneboard
Document Actions