Re: Student looking for info about STL format/slice programming in C++

From: cthomas@eng.utah.edu
Date: Mon Feb 05 2001 - 23:51:10 EET


Umang,

If you look in the archives of the mailing list, you will find that this
subject has been discussed in the past.

My students are doing this as a homework in my Advanced CAM class here at
the U. of Utah.

The basic algorithm is quite simple:

for each z height (slice)

        Find the intersection between each triangle in the STL file and the
plane.

        sort the resulting line segments into loops, eliminating duplicate
lines.

The result is a list of polyline loops that represent the slice geometry.

Good Luck!

chas.

>Dear list,
>
>I would like to take this oppurtunity of introducing myself as a student
>stuying
>Mechanical Enginnering with study focus on Mechatronics. I am a upcoming
>programmer actually working on a project at Fraunhofer IPT, Aachen/Germany.
>
>I am facing a problem in understanding how the standard STL file format used
>for
>Rapid Prototyping can be sliced to obtain the layer geometry using a C++
>program. How does the triangle representation helps in determing the layer by
>layer geometry? In case you know any books or other sources (internet, ...)
>providing information about the mathmatic/programming-related way to slice
>STL-files and get contour data please give me some hints.
>
>Thanks a lot in advance for your support.
>
>Umang
>
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
><HTML><HEAD>
><META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
><META content="MSHTML 5.50.4522.1800" name=GENERATOR>
><STYLE></STYLE>
></HEAD>
><BODY bgColor=#fffff0>
><DIV><FONT size=2><FONT size=3>Dear list,<BR><BR>I would like to take this
>oppurtunity of introducing myself as a student stuying<BR>Mechanical
>Enginnering
>with study focus on Mechatronics. I am a upcoming<BR>programmer actually
>working
>on a project at Fraunhofer IPT, Aachen/Germany.<BR><BR>I am facing a problem
>in
>understanding how the standard STL file format used for<BR>Rapid Prototyping
>can
>be sliced to obtain the layer geometry using a C++<BR>program. How does the
>triangle representation helps in determing the layer by<BR>layer geometry? In
>case you know any books or other sources (internet, ...)<BR>providing
>information about the mathmatic/programming-related way to slice<BR>STL-files
>and get contour data please give me some hints.<BR><BR>Thanks a lot in advance
>for your support.<BR><BR>Umang</FONT><BR></DIV></FONT></BODY></HTML>

Charles L. Thomas
Associate Professor
Department of Mechanical Engineering
University of Utah
50 South Central Campus Drive
Salt Lake City, Utah 84112
(801)585-6939
FAX (801) 585-9826

For more information about the rp-ml, see http://ltk.hut.fi/rp-ml/



This archive was generated by hypermail 2.1.2 : Fri Jan 04 2002 - 09:56:47 EET