View Issue Details

IDProjectCategoryView StatusLast Update
0000764FreeCADFeaturepublic2012-06-28 14:31
Reportershoogen Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version0.12 
Fixed in Version0.13 
Summary0000764: Serialize Shape to python String
Descriptioncreate an interface that allows to serialize Shapes to python string and deserialize form them.
Additional InformationThis would enable to store Shapes that are not bound an Feature Property and allow to exchange shpaes via IPC/network in python.
This might be as well a suitable debugging tool. As it allows to extract intermediate shapes in a complicated script, without the need to write to temporary files.
Proposed Implementation:
use a stringstream on the following functions:
static void BRepTools::Write (const TopoDS_Shape &Sh, Standard_OStream &S)
static void BRepTools::Read (TopoDS_Shape &Sh, Standard_IStream &S, const BRep_Builder &B)
Limitations:
There are problems with these functions at least up to 6.3
http://www.opencascade.org/org/forum/thread_6979/?forum=3
An emulation of this functionality (with temporary files) is not worth implementing as this path, is yet possible from python.
If this the above mentioned problem affects FreeCAD this Feature should not be implemented until a OCCT gets fixed.
TagsNo tags attached.
FreeCAD Information

Relationships

parent of 0000572 closedwmayer add a method to Part module to read BRep data from string 

Activities

wmayer

2012-06-28 08:15

administrator   ~0002244

This crash has nothing to do with OCC. Crashes with streams always happens if the libraries were linked to another runtime. So, if you e.g. have OCC linked to MSVC 8 but FreeCAD is built with MSVC 9 you cannot use an API function of OCC that offers a stream.

And this is not a pure Windows issue, it also happens under Linux with the gcc compiler.

shoogen

2012-06-28 09:13

developer   ~0002245

Are the build dependencies for ALL platforms strict enought to prevent this. Or is there a way to detect this and enable the workaround only if needed (at compile time). Or detect it before crashing at link time or dynamic load time?

wmayer

2012-06-28 14:30

administrator   ~0002246

b=Part.makeBox(10,10,10)
s=b.exportBrepToString()
n=Part.Shape()
n.importBrepFromString(s)
Part.show(n)

wmayer

2012-06-28 14:31

administrator   ~0002247

git show 013b5f0

Issue History

Date Modified Username Field Change
2012-06-28 06:11 shoogen New Issue
2012-06-28 08:15 wmayer Note Added: 0002244
2012-06-28 09:13 shoogen Note Added: 0002245
2012-06-28 13:43 wmayer Relationship added parent of 0000572
2012-06-28 14:30 wmayer Note Added: 0002246
2012-06-28 14:31 wmayer Note Added: 0002247
2012-06-28 14:31 wmayer Status new => closed
2012-06-28 14:31 wmayer Resolution open => fixed
2012-06-28 14:31 wmayer Fixed in Version => 0.13