Wednesday, July 12, 2017

Tutorial Post 16: Folding.

Folding is a constructive method that makes two rotations of two disjoint sets of endpoints at once.


The inputs of folding operation are:

  • four half-lines with a common initial point 'A':  'AB', 'AC', 'AD' and 'AE', and
  • a point 'F' on one side of the plane 'ABC' indicating the direction of the rotations.

The lines 'AB' and 'AC' are axes of two rotations, such that the half-line 'AD' rotated by the first rotation around the line 'AB' is equal to the half-line 'AE' rotated by the second rotation around the line 'AC'.
Such rotations may not always exist. (It depends on the angles between the half-lines.)

As a simple example, let's make regular tetrahedron.
First make equilateral triangle:

(Do not use 'QMI4', since it would insert three triangles -- the sectors of the polygon)


Then make two  copies of the triangle:


(I have also painted them with different colors.)

Then you can use two three-point transformations to align the triangles as follows (use cursor jumping ('QCJ') to set the input constructive points of the three-point transformations):


Use selecting and bookmarking to bookmark the red triangle and to select the green triangle and use cursor jumping ('QCJ') to set constructive points as follows:


Do folding ('QMF'):


The red and the green triangles have been folded around 'AC' and 'AB', respectively.
Note the point 'V' that is set by folding to denote the half-line 'AV' that is equal to the rotations of 'AD' and 'AE'.

There is still one face missing:


We can add it manually with cursor jumping to the existing endpoints:





The Folding Algorithm (formally derived here) does not use any trigonometric functions, which should have positive impact on the precision of computations.




Monday, July 3, 2017

Tutorial Post 15: Sets.

As noted in Tutorial Post on Data Organisation,  each endpoint has a set attribute. Endpoints are grouped into disjoint sets. The set attribute is just an index of the endpoint's group. There is also a 'current set index', which indicates one of the set indices.

Sets are useful for logical grouping of the endpoints.

  • If the endpoints from different sets have the same position, then you can select only endpoints from the current set by pressing: 'QSS' ("ADD ENDPOINTS FROM THE CURRENT SET TO SELECTION" on Selection Menu).
  • On the other hand, if you have some endpoints selected, then you can create a new set that contains only the selected endpoints, extracting them from their old sets ('QSE') ("EXTRACT THE SELECTED ENDPOINTS TO A NEW SET" on Selection Menu).
  • If you created the copy of selectde endpoints ('QDC...'), then the copies of the  endpoints are placed in a new set. (The glue elements have endpoints in distinct sets.) 
  • If you merge from a file ('QFM') then the sets of the merged endpoints are separate from the existing sets (while all the merged endpoints are selected and you can extract them to a single set if you wish) 


Set Menu is invoked by key sequence: 'QN'


I this menu you can change the current set and restrict visibility to the elements that have all the endpoints in (are included in)  the current set or to the elements that have at least one endpoint in (are incident to) the current set.

In the example we have copied two white segments from set 0  (with segment glues between endpoints).
The copy has been moved and painted red.
The copied endpoints have been automatically placed in new set (set 1).
The endpoints of set one have been selected with key sequence 'QSS', when the current set index was 1, and then bookmarked with 'QSB'.
Then the current set index was changed to 0 (by repeating 'QNN') and the endpitoints of set 0 (current set) have been selected ('QSS').


After pressing 'QN0'  we would see the elements included in current set:


If we pressed 'QN1' then we would see the elements incident to the current set:

(Note that now the glues are also visible.)

We can also display some statistics with 'QNP':



You may also cycle with through the available set indexes and view restrictions, by pressing just the key 'N'.

Note that the set attributes of the endpoints may change  their values while you are not watching, since mki3d tries to minimize the total number of available set indexes, by ensuring that the only index of an empty set is the maximal index. After all, the set attributes are only used to indicate the partitioning of the endpoints, and we do not want to cycle through many empty groups, nor to remember the index numeric values.




Tutorial Post 14: Copying.

We can make copies of selected elements. We will make a copy of the two red segments.


The segments already have been selected (with a key sequence: 'QSX').
We invoke Copy submenu on Data Menu (key sequence: 'QDC'):


Note that there are four kinds of copying. The term 'GLUE' denotes connection between the original and its copy. A segment's endpoint can be connected with its copy by a segment. A segment can be connected with its copy by two triangles. There is no   'GLUE'   option defined for a triangle and its copy. (In most cases you do not want glues between triangles and their copies!)

First, lets make the copy without any 'GLUE' ('QDC0').


The endpoints have been copied and placed in a new (unused) set. The old endpoints are un-selected and their copies are now selected. The copies are placed in the positions of the originals. To see that we have really made a copy, select action 'SELECTION MOVE' (key sequence: 'AS') and   move the selected copy with arrow keys.


Now, lets make copy of the first copy with the glues between the endpoints ('QDC1') and move the selected new copy with arrow key to see the results:


And finally, lets make a copy with glues between the segments ('QDC2') and move the copy:


The key sequence: 'QDC3' would make another copy with both kinds of glues.