Home Export Delphi GLScene objects as STL file for 3D printing
Reply: 0

Export Delphi GLScene objects as STL file for 3D printing

Andreas Published in 2018-01-08 19:06:30Z

I have a Delphi GLScene project that contains diverse objects, based on TGLRevolutionSolid, TGLCylinder, TGLExtrusionSolid or TGLAnnulus.

I want to export these objects to an STL (stereolithography) file so I can print the objects with a 3D printer.

GLScene offers STL-Export functionality in the GLFileSTL unit, but only for elements of type TGLFreeform, this also works for multiple objects as discussed here.

Here's the excerpt from Github (see link for full unit):

procedure TGLSTLVectorFile.SaveToStream(aStream: TStream);
   i : Integer;
   header : TSTLHeader;
   dataFace : TSTLFace;
   list : TAffineVectorList;
   cHeaderTag = 'GLScene STL export';
      FillChar(header.dummy[0], SizeOf(header.dummy), 0);
      Move(cHeaderTag, header.dummy[0], Length(cHeaderTag));

However, the export only works for objects of type TGLFreeform, because the function ExtractTriangles is not available in the other TGLScene objects.

Is there a way to extract the triangles for the other TGLScene objects, for example by converting them to TGLFreeform?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.385831 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO