Skip to main content

Identifying the directions of a set of 2D contours for additive manufacturing process planning


Additive Manufacturing (AM) is a process in which material is added layer by layer to build a physical part. In AM process planning, a stack of 2D closed contours is obtained when a 3D stereolithography (STL) model is sliced. Each slice may have a set of closed contours or polygons, each of which needs to be classified (oriented) as internal (clockwise) or external (counterclockwise) to identify where material should be added. This is not a straightforward task as the STL format does not ensure correct surface orientation of the 3D model. This work describes two methods for identifying the direction of each contour in a set, i.e., for sorting them into internal and external contours. Three alternative tests to check whether a point is inside or outside a polygon were evaluated. The tests are based on the ray-tracing principle and the classical point-in-polygon test. The proposed algorithms were devised and implemented in an AM process planning system. The methods were validated using 3D models with a variety of geometries, and the computing time for the alternative tests was compared. The results showed that the method based on the point-in-polygon tests has some advantages.

This is a preview of subscription content, access via your institution.


  1. Beaman JJ, Barlow JW, Bourell DL, Crawford RH, Marcus HL, McAlea KP (1997) Solid freeform fabrication: A new direction in manufacturing. Kluwer Academic Publishers, Dordrecht, London

    Book  Google Scholar 

  2. Chua CK, Leong KF, Lim CS (2003) Rapid prototyping: Principles and applications, 2nd edn. Manufacturing World Scientific Pub, Singapore

    Book  Google Scholar 

  3. Kumar V, Dutta D (1997) An assessment of data formats for layered manufacturing. Adv Eng Software 28:151–164

    Article  Google Scholar 

  4. Kulkarni P, Marsan A, Dutta D (2000) A review of process planning techniques in layered manufacturing. Rapid Prototyp J 6(1):18–35

    Article  Google Scholar 

  5. Volpato N, Foggiatto JA (2009) The development of a generic rapid prototyping process planning system. In: Bártolo PJ et al. (eds) Innovative developments in design and manufacturing: Advanced research in virtual and rapid prototyping. CRC Press (Taylor & Francis Group), London, UK, pp 381–387

  6. Shimrat M (1962) Algorithm 112: position of point relative to polygon. Communications of the ACM 5,8:434

    Google Scholar 

  7. Schneider PJ, Eberly DH (2003) Geometric tools for computer graphics. Morgan Kaufmann Publishers, San Francisco, CA, USA

    Google Scholar 

  8. Erickson J (2009) The Jordan polygon theorem. In: Computational Topology. Available at: Accessed 20 March 2012

  9. Wang W, Li J, Wu E (2005) 2D point-in-polygon test by classifying edges into layers. Comput Graph 29:427–439

    Article  Google Scholar 

  10. Pandey PM, Reddy NV, Dhande SG (2003) Slicing procedures in layered manufacturing: a review. Rapid Prototyp J 9(5):274–288

    Article  Google Scholar 

  11. Hayasi MT, Asiabanpour B (2009) Machine path generation using direct slicing from design-by-feature solid model for rapid prototyping. Int J Adv Manuf Technol 45:170–180

    Article  Google Scholar 

  12. Lin R-S (2002) Adaptive slicing for rapid prototyping. In: Gibson I (ed) Software solutions for rapid prototyping. Professional Engineering Publishing, London, pp 129–154

    Google Scholar 

  13. Venuvinod PK, Ma W (2004) Rapid prototyping: Laser-based and other technologies. Kluwer Academic Publishers, Massachusetts, USA

    Google Scholar 

  14. Tata K, Fadel G, Bagchi A, Aziz N (1998) Efficient slicing for layered manufacturing. Rapid Prototyp J 4(4):151–167

    Article  Google Scholar 

  15. Yang Y, Loh HT, Fuh JYH, Wang YG (2002) Equidistant path generation for improving scanning efficiency in layered manufacturing. Rapid Prototyp J 8(1):30–37

    Article  Google Scholar 

  16. Choi SH, Kwok KT (2002) A tolerant slicing algorithm for layered manufacturing. Rapid Prototyp J 8(3):161–179

    Article  Google Scholar 

  17. Zhang L-C, Han M, Huang S-H (2002) An effective error-tolerance slicing algorithm for STL files. Int J Adv Manuf Technol 20:363–367

    MATH  Article  Google Scholar 

  18. Lai J-Y, Lai H-C (2006) Repairing triangular meshes for reverse engineering applications. Adv Eng Software 37:667–683

    Article  Google Scholar 

  19. Finley DR (2007) Point-in-polygon algorithm — determining whether a point is inside a complex polygon. Available at: Accessed 20 March, 2012

  20. Martins TACP, Santa Bárbara A, Silva GB, Faria TV, Cassaro B, Silva JVL (2007) InVesalius: Three-dimensional Medical Reconstruction Software. In: Bártolo PJ et al. (eds) Virtual and Rapid Manufacturing — Advanced research in virtual and rapid prototyping. Taylor & Francis, London, UK, pp 135–141

Download references

Author information

Authors and Affiliations


Corresponding author

Correspondence to Neri Volpato.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Volpato, N., Franzoni, A., Luvizon, D.C. et al. Identifying the directions of a set of 2D contours for additive manufacturing process planning. Int J Adv Manuf Technol 68, 33–43 (2013).

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI:


  • Additive manufacturing
  • Rapid prototyping
  • Polygon orientation
  • Ray-tracing
  • Point-in-polygon