Personal tools
You are here: Home Forum Use Changed object ID

Changed object ID

Up to Use

Changed object ID

Posted by Kon G at October 23. 2018


I have a 3D solid (wing lets say). Then I simply cut this from a box (domain) to make a 3D box with a hole inside it (external flow over the wing). Then I want to create groups on this geometry like inlet, outlet and the internal face which was created from cutting (this is the obstacle, wing). So I explode the wing into faces to take the face which is the same as in box. But the face ID has changed value after cutting. So I make something like this

Explode WING into faces:

[Face_1 Face_2 Face_3] = geompy.ExtractShapes(WING, geompy.ShapeType["FACE"], True)

I make the cut, creating the BOX and then I make the group WING_SURFACE into BOX

 idface  =  geompy.GetSubShapeID( WING , Face_1 )  
 face      =  geompy.CreateGroup( WING  , geompy.ShapeType["FACE"])
 geompy.UnionIDs(face , [idface] ) ; geompy.addToStudyInFather( BOX , face , 'WING_SURFACE' )


When I try to submesh this surface I found this error:

"Geometry object is not a sub-shape of the shape to mesh"


Please help me. How can I get the proper ID the new object BOX.?


Thank you


Re: Changed object ID

Posted by Saint Michael at October 23. 2018


Try this

[Face_1 Face_2 Face_3] = geompy.ExtractShapes(WING, geompy.ShapeType["FACE"], True, theName="Face")

Cut = geompy.MakeCut( BOX, WING, theName="Cut" )

[Face_1 Face_2 Face_3] = geompy.RestoreSubShapes( CUT, [Face_1 Face_2 Face_3], theAddPrefix=False )

The last command will find the faces of the WING within the Cut.

Or alternatively:

Face_1_1 = geompy.GetInPlace( Cut, Face_1 )


Powered by Ploneboard
Document Actions