View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000572 | FreeCAD | Feature | public | 2012-01-16 14:21 | 2012-01-16 20:43 |
| Reporter | yorik | Assigned To | wmayer | ||
| Priority | normal | Severity | minor | Reproducibility | N/A |
| Status | closed | Resolution | fixed | ||
| Fixed in Version | 0.13 | ||||
| Summary | 0000572: add a method to Part module to read BRep data from string | ||||
| Description | Werner or Jürgen (or anyone else with skills), would it be possible to add a python method to the Part module to create a shape from Brep data as a string? (Same as read() but it would take the contents of the file instead of the filename). This is so other OCC-based software (such as IfcOpenShell) can pass us brep data directly via a python string. It looks like the BrepTools read function can do that (link below), Sorry for asking something I could do myself, I tried to do it but got totally lost with strings/char*/Standard_Istream conversions... Thanks Yorik | ||||
| Additional Information | http://opencascade.sourcearchive.com/documentation/6.3.0.dfsg.1-1/classBRepTools.html | ||||
| Tags | No tags attached. | ||||
| FreeCAD Information | |||||
| child of | 0000764 | closed | Serialize Shape to python String |
|
|
The implemented method is even more flexible. Instead of a string it uses an object with a read(int) method, such as a file object or a StringIO. Example: # a file object f=open("box.brep") s=Part.Shape() s.importBrep(f) Part.show(s) # a string object import StringIO f=open("box.brep").read() s=Part.Shape() s.importBrep(StringIO.StringIO(f)) Part.show(s) Done in rev 5410 |
|
|
Werner, you are the BEST! Thanks a lot! |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-01-16 14:21 | yorik | New Issue | |
| 2012-01-16 16:42 | wmayer | Status | new => assigned |
| 2012-01-16 16:42 | wmayer | Assigned To | => wmayer |
| 2012-01-16 19:27 | wmayer | Note Added: 0001581 | |
| 2012-01-16 19:27 | wmayer | Status | assigned => closed |
| 2012-01-16 19:27 | wmayer | Resolution | open => fixed |
| 2012-01-16 19:27 | wmayer | Fixed in Version | => 0.13 |
| 2012-01-16 20:43 | yorik | Note Added: 0001584 | |
| 2012-06-28 13:43 | wmayer | Relationship added | child of 0000764 |
FreeCAD