tpaviot / pythonocc-core

Python package for 3D geometry CAD/BIM/CAM
GNU Lesser General Public License v3.0
1.39k stars 379 forks source link

Substitute of BRepTools.breptools_WriteToString? #1330

Closed romanavyzn closed 6 months ago

romanavyzn commented 6 months ago

With pythonocc "7.6.2" I used BRepTools.breptools_WriteToString(shape) and BRepTools.breptools_ReadFromString(str) to serialize and deserialize a TopoDS_Shape. With upgrading to 7.7.2 these functions do not exist anymore. Which methods do I have to use now to convert a shape into a string? Thanks in advance.

romanavyzn commented 6 months ago

Ah finally found them in . BRepTools.breptools.WriteToStringand BRepTools.breptools.ReadFromString

tpaviot commented 6 months ago

in older pythonocc releases, static functions used to be wrapped as classname_staticfunctionname, since SWIG release 4.1, it is classname.staticfunctioname. You should be able to continue using breptools_WriteToString(shape) with a deprecation warning being raised, it's not the case? FYI version 7.8.1 is about to be released in the coming hours/days, without any API change regarding this topic

romanavyzn commented 6 months ago

Thank you for the clarification! No, breptools_WriteToString does not exist anymore, only breptools_Write with deprecation warning. I guess it should be here: BRepTools.i