7-9.01.2014 Assignment6: Project description

Today in class I presented a project which I have been working on, on and off, for several years.  It is a visualization of the Schatz linkage.  You can access the webstart I showed here. The video I showed at the beginning of the class can be seen here. The pictures of the wooden oloid which Thomas Neukirchner made can be found here. Thomas’s diagrams and plywood models of the oloid can be found here.  The latest edition of Paul Schatz’s book Die Welt ist Umstülpbar: Rhythmusforschung und Technik can be found here on Amazon.  If you are interested in this theme then mark your calender for April 4-6, when there will be a weekend event in Berlin devoted to themes related to Paul Schatz’s research.  A few more details can be found here.

On Thursday, Jan. 9, we will take some time to evaluate this “project presentation” in regard to the various criteria mentioned in the evaluation handout.  Be there or be square!  I will also discuss the half-edge data structure and demonstrate some advanced features of the discretegroup package, and, if time permits, more!

Assignment 6: As discussed in class on our final meeting before the holidays, the next assignment is not a programming assignment but rather a planning assignment.  I ask you to enter a description of your project as a comment to this blog post.  Use the account name studentmv with the clever password.  Please  sign your comment with either your name(s) or with your student number(s).  Your comments are due as usual on Friday at midnight.  (That’s Friday Jan. 10).   The details of the description are provided below, but first comes a “news flash” regarding a change in the way property files are handled in the basic template.Assignment class.

Improved way to provide property files. Although I didn’t do much work over the holiday break, I did play around some with webstarts — enough to realize that the current way that property files are handled doesn’t work with webstart technology.  So I’ve figured out a new way to handle property files that does work with webstarts, and has other advantages.  Here’s how it works:

  • If you have a class named MyAssignment.java that inherits from template.Assignment, then store off the properties in a file named myAssignment.xml (note the leading lower case letter!) in the same folder as MyAssignment.java. Implement the method getPropertiesFile() to return null.  Or, remove your implementation of the method, it’s no longer an abstract method and by default it returns null.
  • That’s all you have to do.  Now your class should read the property file correctly whether run “normally” or as a webstart application (which your project application will ultimately need to do).
  • Please try this out to make sure it works for you — if you don’t change anything the old code will continue to work but you should get used to using the new approach.

What to include in your description. 

  1. Mathematics. The description should begin with the mathematical content of the project.  Try to be as precise and accurate.  Zoom in gently — make clear to which domain of mathematics this content belongs.  Use technical language if necessary to specify this.  If possible, include one or two references (either articles or books) which provide a more detailed description of the context of your project.  None of the projects exists “in a vacuum”, give a pointer to your point(s) of departure.
  2. Software design. Begin this section by a statement describing the concrete goal of your project.  For example, “We intend to create an application to allow the user to explore the 3-dimensional kaleidoscopes introduced above [in the mathematical section].”  Describe then the software tools and building blocks you think you will need in order to realize this aim, and how they will be put together.  For example, building blocks might include “jReality geometry factories, the de.jtem.halfedge package, and the de.jtem.discretegroup package”; additionally indicate which parts of these building blocks you will use and how they will be combined.  Think if this as the blueprint for your project.  Of course at this stage of the planning it shouldn’t be too detailed.
  3. User experience. Finally, briefly indicate how you envision a typical “usage cycle” of your program.  What choices does the user have, how can he/she interact with the software sketched in the previous section?  Can the user save the state of the program from one invocation to the next? Will you rely on sliders and dials, or have you ideas for innovative interactive tools?  Will your application be particularly aimed at the PORTAL? Will there be a connection to 3D printing?

 

9.12 Assignment5

Update 16.12.13: I’ve fetched all the Assignment5’s I could find.  If there was a problem with yours, I’ve sent you an e-mail.  Otherwise, I’ve created a picture gallery containing all the images so far received — there are 13 so we could make a lunar calendar with them!  As you see, about half are derived from the Assignment5 I distributed and the other half are original.  I’m pleased with the variety of the images. One small problem is that I don’t know how to label the images. If you’d like to have a label attached to your image — and I think that would be a good thing — please e-mail me the text for the label. Try describing it in 50 words or less.

I’ve described what I expect for Assignment5 in this blog post.  However if you are having trouble generating an image, I’ve checked in an Assignment5 class to the repository.  It’s an application which uses some symmetry groups of the 2-dimensional sphere to create Christmas ornaments.  You are free to adapt it to create an image for the Christmas calendar.  Just be sure that you find a way to customize the code to add new functionality, using the existing code to make an image is not acceptable.  I wasn’t able to document the code exhaustively but it should be possible to understand what’s going on well enough to modify it.

The application uses instance of the class TriangleGroup. There is a choice of 3 diferent plugins:

  1. Default: use default triangle in which the three vertices lie on the surface of the sphere.
  2. Perpendicular cut is more complex.  One chooses one of the 3 vertices and creates a new triangle lying in the tangent plane to the sphere at this vertex. To obtain the other vertices, the lines joining the original vertices to the origin are extended until they cut this tangent plane. Furthermore, for rotation groups, the original triangle is doubled to obtain a true fundamental domain.  Furthermore a piece of the boundary of this region is saved off into a field curve of type double[][].  This isn’t used directly by this class but subclasses (such as Twirly below) can use it to generate interesting geometry.
  3. Twirly builds on the polygon  P found above to create a surface by iteratively applying a matrix to a subset of the boundary of P.  The matrix is determined by 3 real parameters: a scale, a translate, and a rotation angle. The code shows the use of the class CurveCollector, which allows you to construct a surface swept out by a series of curves (each of the same number of vertices).
    1. For a related application showing the use of such an “iterated matrix” run the ElephantTrunk webstart, or create a run configuration in eclipse: run “charlesgunn.jreality.viewer.PluginSceneLoader” with the program argument “charlesgunn.jreality.worlds.ElephantTrunk”.

Images. The following images show first the default fundamental region.  The next three show the perpendicular cut with the 3 different choices of vertex.  Finally, there are some images showing the Twirly plugin at work.

You can also use template.Assignment5 as the basis for the actual Assignment5, to create an image for our Christmas calendar.  To use it for this you’ll need to write a plugin class that does more than what the template version provides. The possibilities are endless (IMHO).

You can see all the images as a single album at my Google+ photo site.assg5-deftri-transp-01assg5-perpCut-0-transp-01assg5-perpCut-1-transp-01assg5-perpCut-2-transp-01

The twirly plugin acting on the group 234 with perpendicular cut at vertex with order-4 rotation.

The twirly plugin acting on the group 234 with perpendicular cut at vertex with order-4 rotation.

 

A single copy of the Twirly surface for the group 234 (group of order 24).

A single copy of the Twirly surface for the group 234 (group of order 24).

The remaining images show results for the Twirly plugin, using a variety groups, and a variety of settings for the parameters for constructing the matrix.assg5-2013-twirly-235-negTr-v0-01

assg5-2013-01assg5-2013-02

An example of the group 3*2, the only point group containing a mirror which is not a mirror group.

An example of the group 3*2, the only point group containing a mirror which is not a mirror group.

assg5-2013-04

Group 235 flattened at order-2 rotation center

Group 235 flattened at order-2 rotation center

Group 235 flattened at order-5 rotation.

Group 235 flattened at order-5 rotation.

Group 234 flattened at order-2 rotation.

Group 234 flattened at order-2 rotation.

Group 234 flattened at the order-2 rotation

Group 234 flattened at the order-2 rotation

assg5-2013-twirly-235-negTr-v0-01

26-28.11 More Symmetries and Groups, Assignment5

Assignment5: For the class’s Christmas calendar, each group is asked to contribute one beautiful, self-made mathematical image.  Please subclass the java class template.Assignment to produce an application named Assignment5 which displays this image when it is run.  I encourage you to use this assignment as a preparation for your project — even if you don’t know what the topic of your project is!  Choose some favorite  domain of mathematics and use what you’ve learned about jReality to create an image appropriate for inclusion in a Christmas calendar.  For example, the image below shows another of my free-lance efforts for Matheon from several Christmases ago …  Assignment5 due on Dec 13 — see the next paragraph for the continuation of Assignment4, due on Dec. 6. xmasTree-01 Assignment4 continuation. I have, as promised, extended Assignment 4 to include another “assignment”. The problem with the standard painting algorithm is shown in the following image: when the center of the brush approaches the boundary of the fundamental region (always a square for these groups), it can happen that only part of the brush is painted.  See the red and blue “half-paths” which join along a seam: the red was painted with the center of the brush slightly to the left side, the blue with the center of the brush just slightly to the right.  It ain’t right — you gotta fix it.

The problem with painting a freize group.

The problem with painting a freize group.

To complete this assignment:  Please make sure your Assignment4 class subclasses from template.AbstractAssignment4 not from a copy in your student package. Then update to the latest version of my repository. You should only need to make a copy of template.Assignment4PaintTool — see the directions at the top of this file.  The new version of AbstractAssignment4 invokes this class to provide painting support — your task is to edit Assignment4PaintTool so it supports all 7 frieze groups so that no seams are visible during painting.  This assignment is due in a week, on Dec. 6.

Note: Do some of your frieze groups appear wrong (the last three groups on the menu, when there should be two rows there is only one with L’s lying on top of each other)?  If so, make sure that the updateCopies() method in Assignment4 contains the following line of code:

 
MatrixBuilder.euclidean().
translate(0, (whichGroup >= 4 && whichGroup <= 6) ? .5 : 0, 0).
assignTo(fundamentalDomain);

It could be that you made a copy of template.Assignment4Example before I included the above line of code.

Mathematical News. This week we continue the exploration of planar (or at least 2-dimensional) symmetry patterns.  The focus turned from frieze groups to spherical groups, that is, groups of isometries of the 2-dimensional sphere $\mathbf{S}^2$.  This is just the familiar orthogonal group $O(3)$, and a point group is a discrete subgroup.  Recall a discrete subgroup is one in which the identity element is isolated, there is no sequence of group elements converging to it.

Fundamental domains and quotient spaces. Before continuing the investigation of particular groups, Mr. Gunn introduced some general language.  First he observed that we are considering symmetries of 2-dimensional spaces of constant curvature, such as the Euclidean plane or the 2-sphere.  In general we call this space $\mathbf{X}$.  And a discrete group of motions will be in general denoted as $\Gamma$.  He then discussed the concept of a fundamental domain for $\Gamma$.  That is a subset $D \subset \mathbf{X}$ such that $\cup_{g\in D}{g(D)} = \mathbf{X}$ and $g_1(D) \cap g_2(d) = \emptyset$ for $g_1, g_2 \in \Gamma$. That is, the copies of $D$ cover $X$ without overlap.  Such a covering is called a tessellation – in German, Pflasterung.  We can arrive at the same concept more abstractly by defining an equivalence relationship on $\mathbf{X}$: \[ \mathbf{P} \sim \mathbf{Q} \iff \exists g \in \Gamma ~\text{such that}~ g(\mathbf{P}) = \mathbf{Q} \] The set of equivalence classes is called the quotient of $\mathbf{X}$ by $\Gamma$ and is written $\mathbf{X}/\Gamma$.  We want to understand better how such quotient spaces behave.

Simplest example: the circle as quotient of the line. Mr. Gunn explained in detail the construction of the quotient space $\mathbf{E}^1/ \{ t \}$ where $ \{ t \}$ is the discrete group generated by the unit translation $t: x \rightarrow x+1$.  He showed that $\mathbf{E}^1/ \{ t \}$ is a circle $S^1$ by twisting the line into an infinite helix so that the orbit of any point under the group lies on the vertical line passing through it.  Then, by looking down on this helix from far away, each vertical line collapses to a point and we are left with a circle.

Connection of quotient space and fundamental region. The quotient space is closely related to a fundamental domain.  A fundamental domain for this group is the half-open interval $[0, 1)$; the quotient space is obtained by taking into account the fact that $0 \sim 1$, hence we have to “glue” the two ends of the segment together to obtain the quotient space.  In short, the quotient space can be obtained from a fundamental region by remembering to glue together parts of the boundary of the FD which are identified under some group element.

Dirichlet domain.  There are many possible choices for a fundamental domain. For the groups we consider, we can always arrange that the fundamental domain is topologically an open disk along with a subset of its boundary.

The problem with overlaps. An n-dimensional euclidean manifold is a space in which every point has a neighborhood homeomorphic to $\mathbf{R}^n$. When is the quotient space a manifold?  Define the stabilizer of a point P to be the set of group elements which fix P: $s(P) := \{g \in \Gamma \mid g(P) = P\}$.  Since $\Gamma$ is discrete, $s(P)$ is finite. It is exactly  points with non-trivial stabilizers that cause overlaps in the tessellation. It’s easy to see that copies of any fundamental region will “overlap” at such points.  For let $D$ be a fundamental domain$g, h \in s(P), P \in D$.  Then $f(D) \cap g(D) = f(P) \neq \emptyset$. On the other hand, if $s(P) = \{id\}$ for all $P\in D$, then the action is called fixed-point free and the resulting quotient is a  manifold. This is equivalent to saying we can find a fundamental region whose copies cover $\mathbf{X}$ without overlap.  This is the case for example for the translation frieze group $\infty \infty$ or the group generated by one glide reflection $\infty X$.

Orbifolds to the rescue.   If $s(P)$ is not the trivial group, the quotient space $\mathbf{X}/\Gamma$ in a neighborhood of $P$ will not look like $\mathbb{R}^n$ but rather like the quotient $\mathbb{R}^n/s(P)$.   An orbifold is defined similarly to a manifold, with the looser requirement that each point $P$ has a neighborhood homeomorphic to $\mathbb{R}^n/G$ for a finite group $G$.  In effect, we “split” the point into $k$ identical “fractional” parts  (where $k = | s(P) | $) so that the $k$ “overlapping” copies of $P$ (each of size “$\dfrac1k$”) together “add up” to a single point.  In this way we can rescue the statement “The copies of D cover $\mathbf{X}$ without overlap.”

Example. Consider a rotation of order-2 in the plane and the associated cyclic group $C_2$.  The rotation center $P$ is fixed by the both the identity and the rotation, so is not trivial. In a neighborhood of $P$, $\mathbf{E}^2/C_2$ looks like a cone formed by rolling a straight angle at $P$.  [need to show a picture to explain this].

Why this is important. This relation between symmetry groups and quotient spaces is important since it turns out that every topological space can be realized in this way as the quotient of some simply-connected space by an appropriate discrete group. More on this on Thursday when I’ll show the video “Shape of Space”.  This wasn’t completely proven until the Poincare Conjecture was proved by Grigori Perelman in 2006.

The spherical groups fixing two points. We began by restricting attention to symmetry groups which fix two antipodal points.  We began by showing that there are a family of cyclic groups generated by a rotation of order $n$, fixing the north and south pole and rotating along the equator, so to speak.  One sees easily that fundamental domain for this group is a two-sided section of the sphere extending from north to south pole, whose one side is mapped to the other side by the rotation.  This region is called a bigon since it has two sides and two vertices.  Since the angle at each vertex is $\dfrac{2 \pi}{n}$, the group is called $nn$.  … to be continued … In the meantime see this Wikipedia article.

Assignment 1: Cubic Choreography

Due date:  Friday, 01.11.2013 at 12 pm (Berlin).  The decision to extend deadline until midnight represents a compromise between wanting to preserve the weekend for recovering from the work-week, and wanting to make sure that teams can find time to get together, which can be a problem when team members attend different tutorials.  If you want to work on the extra credit assignment (see below) you have until one week later to complete that work, as I have promised some new code to assist and we won’t learn how to pull this new code until next week’s gitorious tutorials.)

Goals of assignment: This assignment is designed to develop the following skills:

  • Use of the MatrixBuilder class to construct arbitrary euclidean (or other interesting) matrices,
  • Practice in controlling and creating simple animations,  and
  • Acquaintance with the Assignment class, in particular, ability to add a slider or other GUI element to the inspector panel.

The first step in completing the assignment is to copy the assignment to a package of your own making “parallel” to the template package.  Use the “New->Package” menu item in eclipse to do say.  Please use the format studentxx where “xx” is the 2-digit number assigned to you on the latest version of the signup sheet I have circulated in class.  If you don’t know this number, send me e-mail or take a look at the sheet at the next class meeting.  Leave the name of the copy as Assignment1. Follow the directions in the JavaDoc for the class Assignment1 to complete the assignment.  In the interests of stimulating your creativity I give some ideas here for how you can fulfill the first part of the exercise, to change the matrix applied to the scene graph components in the method setValueAtTime(). Ideas for generating matrices. The calculation of the matrix depends on two helper functions:  getGeometryParameter(i,j) and scalingFactor().  The default (“template”) versions of these functions and the construction via MatrixBuilder is very simple — all cubes rotate a full turn around the y-axis, and the animation delay depends only on column of the cube array where the cube is. Both functions contain optional code which you can un-comment to obtain somewhat more interesting behavior.   Some possible further changes include:

  • getGeometryParameter(i,j):  Make the level sets of this function more interesting: diagonal lines through the array (as in the commented-code), or concentric circles or hyperbolae.  Or some completely different ordering such that each cube receives a different value based on some walk through the array.
  • scalingFactor():  The commented-out code returns an “inverted tent” function of its input.  One could smooth this out — use the method AnimationUtility.hermiteInterpolation instead of AnimationUtllity.linearInterpolation. Or redefine this function to depend directly on the (i,j) indices of the cube to obtain location-dependent scaling (now it’s only time-dependent).
  • Use other types of basic transformations in the MatrixBuilder method call.  For example:
    • Non-uniform scaling — 3 different values instead of identical values, as in the template code.  These values can also depend on the (i,j) location of the cube in the array.
    • Rotations whose axes depend on the (i,j) position of the cube in the array, or rotations through an axis which doesn’t go through the origin.
    • Translations.  One natural choice would be vertical translations (in the z-direction) which depend on time and/or position of the cube in the array. This could be used to simulate the motion of a wave through the array.
  • One can also consider changing the way the cubes are arranged, for example, replace the square with a cylinder or a torus.  To do so, one has to adjust the call the MatrixBuilder in the method setupArray().  In the template this method arranges the cubes by translating them to positions in a square array.
    • Extra credit assignment  Change setupArray() so that the (bottom faces of the) cubes are arranged without gaps or overlap on the surface of a torus with minor radius 1 and major radius R. Note: Doing this requires going beyond the capabilities of the MatrixBuilder class, since it requires mapping a square onto a non-parallelogram. As discussed in class, this can be solved using a general projectivity mapping 5 points onto 5 points (in $\mathbf{P}^3$);  I have added the corresponding method to the class Pn and you can fetch the new version next week when we learn how to do that.

I hope these suggestions stimulate you to further brain-storming. An image of a version incorporating some of these suggestions is shown below: assg1-2013-01