DiscussionsIssue archiveOther usage issues

Archived discussion

Write STL to string

Other usage issuesFri, 03/03/2017 - 19:182 replies

Browse this forum
QuestionAuthor

Hello,

I'm wondering if there is a way to write the Stereolithography (STL) data from a TopoDS_Shape to a container in program memory instead of to a file on disk.

I'm building an application where one component needs to read an STL file for a lot of objects and I don't want the disk I/O overhead.

 

Thanks

Discussion

2 archived replies

Posts are displayed in their archived order.

01Commenter-1

Hello John,

We have sent a private reply to you - please, check your mailbox.

Best regards,

Commenter-1

02Commenter-2

Hello John,

You can use the gmio library.

gmio supports writting the internal triangulation of TopoDS_Shape objects, see here for the list of supported OpenCascade classes.

gmio works on "abstract" streams it's not limited to files.

You can easily provide a stream of your own that writes to a memory block.

Note that gmio provides also ready-to-use streams for QIODevice and C++ std streams.