I have a Delphi GLScene project that contains diverse objects, based on
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, SizeOf(header.dummy), 0);
Move(cHeaderTag, header.dummy, 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?