Thursday, April 16, 2015

Office Kaizen: 5S of Electronic Documents Using MS Sharepoint

Summary

Sharepoint can efficiently be used to get a grip on unstructured document repositories with several thousand documents. Furthermore, 5S provides a standardized framework to tackle the cleaning up of physical working environments. How to combine these two to an efficient tool to clean up virtual working environments is described in this blog.

Background

5S and Kaizen

Kaizen (jap. "Change for the Better") - the continuous improvment process - is one key element of Lean Manufacturing and Lean Management. One of the basic techniques or implementations of Kaizen is the "5S" methodology to tidy up, structure the working environment. The goal is here - like in any "Lean" activity - to clean th system from "Muda", the "waste" (I prefer "non value adding") in a production system.
Kaizen and 5S has been developed and perfectioned in the automotive industry and then adopted in many other manufaturing systems. One advantage in these environments is the repeatability of process steps: we are optimizing a production line consisting of a sequence of production steps / production units, which work in a repeating mode, producing the same (or at least similar) part over and over again. In these environment one can straight forwardly apply statistical methods (like the six sigma toolset) to find weaknesses in the process, identify Muda and to improve.
5S as such is a concept providing a well defined set of activities to clean up and standardize a working environment. Goal of these activities is to create (and preserve) a working environment (e.g. a workshop) where the work can be done in the most effective and efficient way. The main instrument to achieve this goal is to put tools to well defined, clearly visible and "self explaining" places and to arrange these places in the best way to support the working/assembly sequence.
5S defines the following activities to achieve the goal "optimized workshop":
  • "Sort" (jap. Seiri): sort things in "shall be kept / is required", "remove / throw away", "not sure yet"
  • "Systematic Arrangement" (jap. Seiton): arrange things / tools in an order supporting an optimized workflow (lean concept "generate flow")
  • "Shine" (jap. Seiso): tidy up/clean/renovate the workplace, remove all shabbiness
  • "Standardize"(jap. Seiketsu): Use the same conecpts for all workplaces. Provide guidelines how things are to be kept in order and do not allow exceptions
  • "Sustain"/"Self Discipline" (jap: Shitsuke): make all processes / changes established a habit. Do not allow degradation of already achieved standards.

Office Kaizen

Stemming from manufacturing, Lean and Kaizen is influencing other areas of business activities as well. One area of application Lean ideas and concepts is the so-called "Office-Kaizen"/"Office Excellence" movement, trying to transfer Lean to optimize processes and work in office environments. One technique is - in coherence with the 5S idea - to clean up offices and to put working material in well defined and standardized places: e.g. inbox/outbox containers are clearly visible, standardized in shape and color and - if possible - in all offices at the same place. Another example would be how the organizations deals with documents: well defined storage locations, labeling, etc.

Electronic Documents

Saying the word "documents" we immediately come to the virtual world of electronic data storages and what I personally am working on. Almost any organization is fighting with a mayhem ("well - it evolved over the years...") of unstructured data repositories littered with all kinds of electronic documents. Common "concepts" of the work in these data repositories are the following:
  • folders names are used as keywords. Effect: documents are copied to more than one folder to put them in different contexts (muda of storage, transportation, (confusion))
  • document versions are indicated via (undefined) prefixes or suffixes like: *_date, date_*, *_v<version number>, *_new, *_final, *_reallyFinal, .....
    This practice does not only create waste (confusion), but also violates ISO9001, Chapter 4.2.
  • No central guidance for the folder structure
  • Documents are put wherever the user thinks it is useful

5S of Electronic Documents Using Sharepoint

This wouldn't be a technical blog if I didn't describe my own implementation and experiences in a real-world tool. The practices described here may be implemented in other tools as well, but I can only share experiences with MS Sharepoint.
It all began when my team lead approached me with the task to "improve the document repository for our team - we are loosing track over what is where". So I suddenly was confronted with a file share (roughly 3 years old) with about 11000 files stored in roughly 700 folders. In the folder structure all kinds of file types were in: text documents, presentations, excels, photos, technical drawings in native formats, technical drawings scanned to pdf, manuals, scientific papers, etc. etc.
Based on previous experiences my strategy was clear: introduce Sharepoint and move all the available documents to there. But it is important to be careful withthe sequence of steps and the things which need to be prepared upfront and which can be done "on the way".

Preparation of Seiri

Before you start with sorting documents it is important to spend thoughts about the categories the documents will be sorted. The ultimate goal is to separate those documents to be kept from those being obsolete. However, it is almost impossible to do this "keep/throw" classification without a pre-classification of documents into context categories. To do the latter, I introduced roughly 10 categories (sets of keywords) to categorize a document. As we are dealing with a large machine I defined categories. I tend to guide the users as much as possible by the use of lookup values in fields, this makes it possible to filter documents more reliably than for freetext fields. Here some examples as inspiration:
  • Flag: "Keep/Throw"
  • Document Type: technical drawing, meeting protocol, manual, product catalog, ... Not to be mixed up with the document file type (!). Field with lookup values
  • Machine section: our machine is structured into sections, here a document can be related to one (or many) of these sections. Field with lookup values.
  • Serial number: Freetext field to enter the serial number of an asset related to the document, e.g. for quality test protocols, etc.
  • Technical place ID: ID of the technical place a document relates to. Field with lookup value
  • Supplier/Author: who provided the document? Field with lookup values
  • Document Date: this field is useful/required to indicate wher a document has been created initially on the file share - e.g. for meeting minutes. This initial date gets lost in the uploading process.
  • ...
If this interlectual exercise has been done and has been implemented in Sharepoint as Document Library with custom columns, one can make the first mayor step and upload the documents from the file share to Sharepoint. I uploaded the whole folder structure "as is" to Sharepoint. as this preserves the folder structure as important element of user orientation. This is essential especially for the "pathfinders" which navigate along folder structures. I distinguish these from the "Googlers" who want to type in search phrases everywhere (I belong to the Googlers).

Step 1: Seiri

After the uploading of files took place, one can start with the actual "Seiri" exercise: sort the documents into categories, sort into "keep" / "throw". This exercise needs to be accompanied by proper communication to the relevant stakeholder: team leads, users, other. At first your users will be overwhelmed by the new tool and will try to get around it. I advice the following:
  1. suppress the continuation of us of old tools by restricting access - switch the old file share to "read only" mode
  2. have a coach close by providing immediate help with the new tool if needed
  3. do categorization of files centrally - I am working together with a works student, who does an awful lot of "sand shoveling" ni the system. This will lead to partly wrong results in terms of categorization and keywording, but will immediately open the door for Googlers and filtering mechanisms
  4. In the Sharepoint Document Library create one view I call "Flat List". This view has the attribute "view without folders" in the view definition. It is the key to create transparency and to identify duplicates and similar documents in your library.
Important is here that you quickly reacha relatively high degree of categorization in key document types. If you stall here, users will use trust in the power of categorization and will bail out.

Step 2:  Seiton

The custom categories are not only required for the sorting of documents, but also the key for the "Systematic Arrangement" of files. On the one hand, the systematic arrangement is achieved automatically by sorting things into categories, because they can now be filtered according to their categories/keywords. But Sharepoint offers the tool to go one step further in "arranging" files: the creation of views (= pre-defined filtered views on the document library) according to business context. I advice the following steps:
  1. Define the relevant views together with key users. Most the views we use are based on the "Flat List", i.e. documents are shown without their folder structure. Example: We defined a couple of key views like "all technical drawings to section xy", "all meeting protocols" (these are scattered over several folders), "all manuals", etc. Do not over-engineer here, but start with something simple and grow the field during use.
  2. Implement the views in Sharepoint
  3. Communicate the availability of views and how they can use them to your users. Unexperienced users will hardly use this feature without training

Step 3:  Seiso

I strongly believe that every enterprise content system needs one layer / user interface, where the "documents" (and the library), data sources and other sources of "raw data" are made accessible under one hub. This hub needs to provide "metadata" information on the content and end-user friendly navigation and help where to find what. Sharepoint offers the set of tools to integrate all content under one platform, namely it offers Wiki functionality whic can be used to create central pages providing links to documents together with information about the meaning, context, etc. of these documents.
What does this have to do with "Seiso"/"Shine"? The creation of user-friendly web pages collecting documents and providing information about these is nothing than the virtual counterpart of a toolbox. Additionally, these web pages are a central tool to implement Lean's "visual management": tools to create a self explaining/transparent working environment.Here a note: I did not come across ideas how to implement "visual error states" of the system which is part of visual management.
Furthermore, if you put a little love into these web pages (make them "shine"), users will more likely like and use them and will get around more easily. One example of making pages "shine" is to integrate ways to navigate along visual web assets like clickable image maps or SVGs (see as well my other blog post).
One key element in the Seiso step is to link views (which is a feature of Sharepoint) created in the Seiton step in the web layer. This creates a lot of user friendliness and is very attractive from a user point od view, because the use and technical details of the document library is abtracted to the user.

Step 4: Seiketsu

If you arrive at step 4 already a good part of the work has been done. To standardize I mostly use email: where we send documents as attachments before, I send now emails with links to documents in Sharepoint, so they are "forced" to deal with the tool.

Step 5: Shitsuke

One key element not to let things degrade is a central team taking care of the Sharepoint webspace and the server. From time to time mini 5S-events to clean up are useful. Ultimately, the tool will stay attractive if users find it something supporting their work.

Dear reader - this was it, I hope you liked my post and it helps you with your own project - keep on geekin'!

Your WolfiG

Monday, April 13, 2015

Math Gems: the Snail Shell

Previous post: the Breather

Gem


Snail Shell faceted (facets have been post processed with Blender, not Mathematica output)


Snail shell smooth


The pearl material has been based on Kaluura's Post on Blenderartists

Math

The snail shell is given by (see e.g. virtualmathmuseum.org)


The shape above is the result of setting the factors to:
  • aa:=0.1
  • bb:=0.1
  • cc:=0.2
  • dd:=0
  • ee:=-1 
The corresponding Mathematica script looks like this:

aa := 0.1;
bb := 0.1;
cc := 0.2;
dd := 0;
ee := -1;
r := s (aa + bb Cos[u]);
vv := v + (v + ee)^2/16;
s := Exp[\[Minus]cc*vv];
x = r*Cos[vv]
z = r*Sin[vv]
y = dd*(1 \[Minus] s) + s*bb*Sin[u]
thePlot =
 ParametricPlot3D[{x, y, z}, {u, 0, 2 Pi}, {v, 0, 2 Pi},
  NormalsFunction -> None, Boxed -> False, Axes -> False]

Export["Snailshell.ply", thePlot, VertexNormals -> Automatic]

Sunday, April 12, 2015

Math Gems: the Breather

Previous Math Gem: the Klein Bottle
Next Math Gem: the Snail Shell

Gem

This image was rendered with Blender 2.74


For the gold shader used in this scene I want to thank E. M. Malo and his Gold Shader

Math

The Breather is a surface parameterized in 3 dismensions by (see e.g. Wikipedia):

 The following Mathematica script produces output in the PLY 3d-format which can be readily imported into Blender for rendering/postprocessing:

r := 1 - b^2;
w := Sqrt[r];
denom := b ((w Cosh[b u])^2 + (b Sin[v w])^2);
x = (2 r Sinh[b u] Cosh[b u])/denom - u
y = (2 w Cosh[b u] (-(Sin[v] Sin[v w])
     - w Cos[v] Cos[v w]))/denom
z = (2 w Cosh[b u] (Cos[v] Sin[v w]
     - w Sin[v] Cos[v w]))/denom
breather = {x, y, z}
thePlot = ParametricPlot3D[
  Evaluate[breather /. b -> 0.4],
  {u, -13.2, 13.2}, {v, -37.4, 37.4},
  PlotRange -> All, PlotPoints -> {60, 150},
  Axes -> None,   Boxed -> False, PlotPoints -> 40,
  Mesh -> None, NormalsFunction -> None]

Export["Breather.ply", thePlot, "VertexNormals" -> Automatic]



Saturday, April 11, 2015

Math Gems: the Klein Bottle

Background

In my previous post I discussed rather technically how Blender can be used as render backend for Graphics3D output created with Mathematica. Dealing with that matter, I thought it could be nice to create a couple of image of mathematically described 3D surface objects, which I call "Math Gems", because they look like jewelry.

The Klein Bottle


Klein Bottle faceted


Klein Bottle smooth with mesh from edges of surface

Description in Mathematica

I my previous post I had some problems creating usable Mathematica output for the the parametrized immersion in 3 dimensions, so called "Klein Bottle" based on the equations given in Wikipedia. Finally I found the proper way to create the shape in Mathematica.
The Klein bottle can be parametrized in the following way (see e.g. Paul Bourkes article):



In Mathematica formulation:
r = 4 (1 - cos(u)/2)
x = Piecewise[({
    {r cos(u) cos(v) + 6 (sin(u) + 1) cos(u), 0 <= u < \[Pi]},
    {r cos(v + \[Pi]) + 6 (sin(u) + 1) cos(u), \[Pi] <= u <= 2 \[Pi]}
   })]
y = Piecewise[({
    {r sin(u) cos(v) + 16 sin(u), 0 <= u < \[Pi]},
    {16 sin(u), \[Pi] <= u <= 2 \[Pi]}
   })]
z = r sin (v)
thePlot =
 ParametricPlot3D[{x, y, z}, {u, 0, 2 \[Pi]}, {v, 0, 2 \[Pi]},
  Axes -> None, Boxed -> False, PlotPoints -> 50, MaxRecursion -> 10,
  Mesh -> None, NormalsFunction -> None]
Export["KleinBottle1.ply", thePlot, "VertexNormals" -> Automatic]
The resulting PLY file can directly imported to Blender. Doing some Blender post processing yields in the images above.

Friday, April 3, 2015

Blender as Shader for Mathematica Output - Visualizing a Hertz Dipole and the Klein Bottle

Background

Since many year I am interested in computer graphics and the visualization of scientific matters. Especially for the scientific - exact - part, Mathematica is my favorite to do calculations and to visualize the results of these calculations. Here I do not want to advertise Mathematica, but I simply started using it as tool for my purposes and never had the nerves to dig into another tool like Matlab or Maple.
On the other - artistic - end of the visualization business, I am a big fan of Blender, a freeware 3D modeling, rendering and animation environment offering top notch functionality for all kinds of 3D computer graphics.

Goal

My idea was to bring these two favorite tools of mine together and to use Blender as post-processing tool to beautify Mathematica output.

Example: Visualization of the E-Field of a Hertz Dipole

One technique is the processing of mathematical data with rotational symmetry. Normally these kind of calculations are performed by calculating a section of the rotationally symmetric function in the x-y plane and to visualize the data of this section in graphs. Mathematica offers the possibility to export 2D-graphs as scalable vector graphics (SVG) which can be imported as (Bezier) curves into Blender and are the base for further processing.
One famous example of the visualization of mathematical/physical matters is the form of the electromagnetic fields generated by a Hertz' dipole. In the web there are several resources for Mathematica to base the graphical output on, e.g. http://demonstrations.wolfram.com/ReadingHertzsOwnDipoleTheory/
Important for our purposes is only the part, where the contour plot of the field strength is defined. This has to be used as base for the input into Blender. Code (roughly):
Param = <some number>
thePlot := ContourPlot[2D-parametric function(Param), arguments]
Export["theFile.svg",thePlot,"SVG"]
The contour graph looks something like this (dependent on the settings of Parameter "Param": ¨



This SVG-file with information about curves can be imported into Blender (make sure the corresponding SVG-import addon is active). We know that the electromagnetic field is rotationally symmetric around the axis of the dipole. So all one has to do is to turn the Bezier curves around a symmetry axis. This can be achieved either by the "Bevel" functionality applied to the un-converted Bezier curves, or to apply the "spin" modification on the Bezier curves converted to meshes.
After having created the "spinned" representation of the curves, one can - as usual - apply materials to the created 3D-objects and create a "beautyfied", artistic representation of the mathematically correct content. Here an example of my Hertz' dipole E-field lines:

Rendering Mathematics Graphics3D

Blender can as well be used to generate images of 3D-parametric functions (like the Klein bottle and alike). Mathematica offers the possibility to export 3D graphics in a couple of 3D-exchange formats (3DS, DXF, OBJ, PLY, STL, X3D) which can be imported into Blender directly as 3D-object and shaded to your needs.
As Example I created an image based on the Klein bottle definition available in Wikipedia. The corresponding Mathematica script looks like this:

thePlot =
 ParametricPlot3D[{-200000/15 Cos[
     u] (6 Cos[v] - 30 Sin[u] + 90 (Cos[u])^4 Sin[u] -
      60 (Cos[u])^6 Sin[u] + 5 Cos[u] Cos[v] Sin[u]), -100000/15 Sin[
     u] (6 Cos[v] - 3 (Cos[u])^2 Cos[v] - 48 (Cos[u])^4 Cos[v] +
      48 (Cos[u])^6 Cos[v] - 60 Sin[u] - 5 Cos[u] Cos[v] Sin[u] -
      10 (Cos[u])^3 Cos[v] Sin[u] - 80 (Cos[u])^5 Cos[v] Sin[u] +
      150 (Cos[u])^7 Cos[v] Sin[u]),
   300000/15 (3 + 5 Cos[u] Sin[u]) Sin[v]}, {u, -Pi, Pi}, {v, 0,
   2 Pi}, Axes -> None, Boxed -> False, PlotPoints -> 30, Mesh -> None
  ]

Export["KleinBottle.dxf", thePlot]
 Please note that the scaling factors in my function differ slightly from the original definition in Wikipedia. The result of my efforts look like this:


Klein bottle with glass shading (Cycles)


Klein bottle with glossy shading (Cycles)

The Journey to Beautiful 3D Graphics

At the first glance I thought, it would be no problem to get the Graphics3D output of Mathematica into Blender via some exchange format and create some nicely rendered image from it. But as it came out, it was very simple to exchange data between Mathematica and Blender (say via 3DS), but it was a mayor challenge to create beautiful/undistorted graphics from the Mathematica output.
Whereas Mathematica with its own shading engine is able to produce smooth graphics, it was very hard for me to transfer a mesh object from Mathematica into Blender which is reasonably smooth and undistorted. But one after another...
The Mathematica output of the script above looks like this:

As one can see, the surface is reasonably smooth. However, if you add the option NormalsFunction->None to the ParametricPlot3D the output looks like this:

...the surface is now distorted/jagged. Obviously Mathematica does not re-calculate the mesh data based on its own smooth shading algorithm but exports the raw data of the Graphics3D object.
I tried many things to export the ParatericPlot3D to some reasonable mesh object in all the available mesh formats (3DS, OBJ, PLY, X3D). All of these resulted in ugly surface meshes of the latter kind, none of these could really be used to produce some reasonable Blender output.
The only workaround I found was the following:
  1. Export the Graphics3D object from Mathematica to Autodesk DXF.  This will result in a spline hull object 
  2. Import the dxf-file to Autodesk 3D Studio Max. Here one can create a surface mesh with reasonable smoothness from the hull definition
  3. Export the mesh object from 3D Studio Max to some format of your choice (I used 3DS) and import into Blender
  4. Don't ask me why one should use Blender if you already have 3D Studio available ;)
If someone reads this blog and knows a better solution - in the best case how to play with the Mathematica options, I'd be happy if he/she shared this knowledge.

Klein Bottle Revised

The problems described above are not general ones but seem to depend on the actual shape. I tried the Klein botlle figure 8 immersion (See Wikipedia) in the follwoing script:
a = 1
thePlot =
 ParametricPlot3D[{Cos[u] (a + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]),
   Sin[u] (a + Cos[u/2] Sin[v] - Sin[u/2] Sin[2 v]),
   Sin[u/2] Sin[v] + Cos[u/2] Sin[2 v]}, {u, -Pi, Pi}, {v, 0, 2 Pi},
  Axes -> None, Boxed -> False, PlotPoints -> 5, MaxRecursion -> 5,
  Mesh -> None, NormalsFunction -> None
  ]


Export["KleinBottle1.ply", thePlot]

Which leads to very reasonable output that can be imported to Blender directly. The result of rendering the above PLY-file looks like this:
which is satisfactory to my standards.

More post-processed Mathematica output can be seen in a series of follow up posts called "Math Gems".

I hope you liked my post, all the best & keep on geekin', your
WolfiG

Blender Tricks: Using Freestyle for Highlighting Objects Part 1 - Layer Options

Background

Currently I am creating a couple of illustrations of complex technical objects - detector assemblies for nuclear and particle physics. These detectors consist of multiple onion-like layers of specialized sub-components/detectors which I want to highlight in-situ to make clear which of the detectors I am talking about in the moment. Here an example:



The tool I am using is the 3D modeling and rendering software package Blender, which offers - to my knowledge - unprecedented functionality for free. Blender has been designed as tool for 3D computer artists rather than a tool to create technical/engineering CAD models, but in combination with a CAD modeling tool (e.g. CATIA, Autodesk inventor, or for hobbyists FreeCAD) it is a power-/wonderful tool do create stunning photorealistic graphics and illustrations.

Blender and Freestyle

Since release 2.69 (?) Blender incorporates the "Freestyle" package as rendering option, making it possible to add lines/strokes to the rendered objects. Freestyle offer many, sometimes too many options at several places to influence the look of the line strokes it creates and the impact on objects. However, it is a very strong tool to create cartoon-like characters on the one hand - this is what it has been made for - on the other hand as illustrator one can use it to highlight objects in your scene. I am using Freestyle in Blender for the latter intent.
Here an Example - say I created some "complex machine" consisting of several parts (the example was created using FreeCAD and exporting/importing a Wavefront obj-file to Blender). Here is a first image of the rendered scene without any object highlighted:


How can I highlight the little cube hidden among the cube and the cylinder? One option would be to give it a different color, but maybe I don't have this option.
In a first attempt one can switch on Freestyle in Blender:
  • Render Panel -> Freestyle Checkmark
The output of Blender looks like this with this option checked:


Already very edgy and sketchy, but still I did not manage to highlight only my little cube.

The Challenge

So I hope I made clear what I am up to. How do I put lines only around my little cube?

Solution

The solution I found uses the layer options of blender to create layer-dependent Freestyle output.

Step 1: Separate Objects by Layer

To be able to assign lines only to one object or a subset of objects, one has to move these to another layer than those which will be rendered "normally". To do so, select the object(s) and type "m" (move to layer) and click on the layer to
move the objects to:


You will know that you moved the object to the right layer by the little orange highlight in the layer overview indicating the layer with your currently selected object:


Step 2: Create A new Render Layer

We want to have only ONE object (or a subset of objects) showing lines as highlight., So we have to create a new render layer hosting the Freestyle line style whereas the objects on the "normal" layer will not have a specific line style:
  • "Render Layer" panel -> "add a render layer"

Make Sure: "Transparent" Film is Enabled

This option is required to be able to merge two images properly in a compositing step:

  • "Render" panel -> "Film" options

Step 3: Render Layer Depedent Freestyle Line Settings

In this step, we create one render layer with Freestyle LineSet (here named "HighlightLayer") and one without (here named "NormalLayer"):



Step 4: Line Set Tweaking

Freestyle offers various options to change the look and feel of the lines it creates. In my example I want the highlighted object to have a red line. This has to be set in
  • "Render Layers" panel -> "Freestyle Line Style"

Step 5: Activate Object Layer by Render Layer

  • "Render Layers" panel -> "Layer" options
By default, all object layers are included in the render layers:

Change this and include only those object layers in your "Highlight" layer (the one with the Freestyle LineSet) which shall have Freestyle lines. In my case:
  • object layer 1 in the "Hightlight" (Freestyle) layer - the one with the little cube:
  • object layer 2 in the "Normal" layer:
If you render with these settings, you will get the following:


Only the output of the "topmost" render layer is visible. Unfortunately this is not enough yet, still some compositing nodes have to be set.

Step 6: Compositing Node Settings

To merge the two images rendered by the two render layers, one has to do some compositing node magic. You will have to create two "Input" nodes, one for each render layer. The output of these nodes are merged via an "Alpha Over" node:
  • "Node Editor" -> "Compositing" Node Tree -> check "Use Nodes"

If you did everything right down to here (and if I described everything properly...) you will get the following result:





Well - the wrong shadow needs some work...
Update from May 2015: I described another approach in a follow-up post

I hope this blog helps you with your own project, keep on geekin', all the best your
WolfiG