Computing normal of all facets in CGAL::Polyhedron_3

In this post I will show how to compute normal vector of a facet in CGAL::Polyhedron_3.

ComputeFacetNormal() Functor

ComputeFacetNormal() is a thread-safe functor for computing the normal vector of a given facet in a CGAL::Polyhedron_3. The facet must be a planar polygon with arbitrary number of sides.

Using ComputeFacetNormal() Functor

Normal vector of a facet f can be computed as Vector3 normal = ComputeFacetNormal(f);.

For most purposes, it is better to compute area of all facets once and cache them for later use. It is best to store the results in an associative container which associates the facet handle with the area. In the following example, I use PropertyMap which is a wrapper for std::set.

Downloads

ImportOBJ.h
PropertyMap.h
ComputeFacetNormal.h
TestComputeFacetNormal.cpp
Venus.obj
ComputeFacetNormal.zip


Computing edge length of all half-edges in CGAL::Polyhedron_3

In this post I will show how to compute edge length for a half-edge in CGAL::Polyhedron_3.

ComputeEdgeLength() Functor

ComputeEdgeLength() is a thread-safe functor for computing the edge length of a given half-edge in a CGAL::Polyhedron_3.

Using ComputeEdgeLength() Functor

Edge length of a half-edge h can be computed as double length = ComputeEdgeLength(h);.

For most purposes, it is better to compute length of all half-edges once and cache them for later use. It is best to store the results in an associative container which associates the half-edge handle with the edge length. In the following example, I use PropertyMap which is a wrapper for std::set.

Downloads

ImportOBJ.h
PropertyMap.h
ComputeEdgeLength.h
TestComputeEdgeLength.cpp
Venus.obj
ImportOBJ.zip


Twenty years from now you will be more disappointed by the things you didn’t do than by the ones you did do. So throw off the bowlines, sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover.
-Mark Twain


Wavefront OBJ reader for building CGAL::Polyhedron_3

CGAL provides high quality generic half-edge data structure for representing polyhedral surfaces as well as many algorithms for mesh processing. However, CGAL doesn’t have any in-build support for building a polyhedron from Wavefront OBJ or PLY file. The following code is a basic OBJ file loader which reads vertex coordinates and faces (can be polygons) from OBJ file. Note that it doesn’t read vertex normals, face normals, or texture coordinates. Code is well commented and should be fairly obvious.

importOBJ() Function

Using importOBJ()

Downloads

ImportOBJ.h
TestImportOBJ.cpp


Zea Stem l.s. – Amscope 50PC Prepared Slides

Zea stem lateral section (l.s.) is the 50th slide in the Amscope 50PC prepared slides. Zea is a genus of true grasses in the family Poaceae of which corn is a member.

Micrographs [07 June 2014]

Amscope 50PC Prepared Slides

This post lists all the micrographs I have done from the Amscope 50PC prepared slides.


Zea Stem c.s. – Amscope 50PC Prepared Slides

Zea stem cross section is the 49th slide in the Amscope 50PC prepared slides. Zea is a genus of true grasses in the family Poaceae of which corn is a member.

Micrographs [07 June 2014]

Amscope 50PC Prepared Slides

This post lists all the micrographs I have done from the Amscope 50PC prepared slides.


Coprinus Mushroom Set – Amscope 50PC Prepared Slides

Cross-section of Coprinus mushroom set is the fourth slide in the Amscope 50PC prepared slides. The Coprinus is a small genus of mushrooms consisting of Coprinus comatus (the shaggy mane) and several of its close relatives [1].

Micrographs

The circular ring in the center is the stem of the mushroom. The center white circle suggests that the stem is hollow from inside. The lines from the stem to the edge forms the cap of the mushroom.

References
  1. http://en.wikipedia.org/wiki/Coprinus
Amscope 50PC Prepared Slides

This post lists all the micrographs I have done from the Amscope 50PC prepared slides.


Cotton Stem – Amscope 50PC Prepared Slides

Cross-section of cotton stem is the fifth slide in the Amscope 50PC prepared slides.

Micrographs [12 April 2014]

Micrographs [28 July 2014]

Amscope 50PC Prepared Slides

This post lists all the micrographs I have done from the Amscope 50PC prepared slides.


Aspergillus – Amscope 50PC Prepared Slides

Aspergillus whole mount (w.m.) is the second slide in the Amscope 50PC prepared slides set. Aspergillus is a genus consisting of several hundred mold species found in various climates worldwide [1]. A mold is a fungus that grows in the form of multicellular filaments called hyphae. In contrast, fungi that can adopt a single celled growth habit are called yeasts [2].

Micrographs

References
  1. http://en.wikipedia.org/wiki/Aspergillus
  2. http://en.wikipedia.org/wiki/Mold
Amscope 50PC Prepared Slides

This post lists all the micrographs I have done from the Amscope 50PC prepared slides.


Paramecium under Microscope in Pond Water

This is a video of a paramecium swimming around in water collected from pond in the Singapore Botanical Gardens.