{"id":243,"date":"2018-06-27T19:24:51","date_gmt":"2018-06-27T17:24:51","guid":{"rendered":"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/?page_id=243"},"modified":"2018-07-17T12:24:53","modified_gmt":"2018-07-17T10:24:53","slug":"lesson-5-make-topological-transformations","status":"publish","type":"page","link":"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/lesson-5-make-topological-transformations\/","title":{"rendered":"Lesson 5: Design topological transformations"},"content":{"rendered":"<div class=\"toc_sitemap\"><h3 class=\"toc_sitemap_pages\">Pages<\/h3><ul class=\"toc_sitemap_pages_list\"><li class=\"page_item page-item-24\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/\">A RULE-BASED TOPOLOGICAL MODELER GENERATOR<\/a><\/li>\n<li class=\"page_item page-item-671\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/inference-of-topological-operations-illustration-in-geology\/\">Inference of topological operations: illustration in geology<\/a><\/li>\n<li class=\"page_item page-item-596\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/japhy\/\">Japhy : une plate-forme m\u00e9canique et topologique utilisant un langage \u00e0 base de r\u00e8gles pour l&rsquo;animation physique.<\/a><\/li>\n<li class=\"page_item page-item-645\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/jerboaeclatement\/\">JerboaEclatement<\/a><\/li>\n<li class=\"page_item page-item-736\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/joptop-jerboa-optimisation-topologique\/\">Joptop &#8211; Jerboa Optimisation Topologique<\/a><\/li>\n<li class=\"page_item page-item-85\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/lesson-1-discover-topological-structures\/\">Lesson 1: Discover topological structures of Jerboa<\/a><\/li>\n<li class=\"page_item page-item-128\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/lesson-2-discover-embeddings-and-orbits\/\">Lesson 2: Discover embeddings and orbits<\/a><\/li>\n<li class=\"page_item page-item-158\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/lesson-3-modify-and-write-a-first-rule\/\">Lesson 3: Modify and write a first rule<\/a><\/li>\n<li class=\"page_item page-item-164\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/lesson-4-write-embedding-expressions\/\">Lesson 4: Write embedding expressions<\/a><\/li>\n<li class=\"page_item page-item-243\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/lesson-5-make-topological-transformations\/\">Lesson 5: Design topological transformations<\/a><\/li>\n<li class=\"page_item page-item-248\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/lesson-6-using-the-execution-cycle\/\">Lesson 6: Utilize the execution cycle of rules<\/a><\/li>\n<li class=\"page_item page-item-536\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/lesson-7-write-scripts-in-jerboa\/\">Lesson 7 : Write scripts in Jerboa<\/a><\/li>\n<li class=\"page_item page-item-449\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/lesson-8-create-your-own-modeler\/\">Lesson 8: Create your own modeler<\/a><\/li>\n<li class=\"page_item page-item-775\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/model-reevaluation-based-on-graph-transformation-rules\/\">Model reevaluation based on graph transformation rules<\/a><\/li>\n<li class=\"page_item page-item-712\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/topological-inference-for-subdivision-schemes\/\">Topological inference for subdivision schemes<\/a><\/li>\n<\/ul><\/div>\n<p style=\"text-align: center;\"><a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/lesson-4-write-embedding-expressions\/\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:6px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 18px;font-size:14px;line-height:28px;border-color:#6cadf4;border-radius:6px;text-shadow:none\"> Lesson 4<\/span><\/a>\n<p>&nbsp;<\/p>\n<p>In this lesson you will learn how to transform the topological structure of an object by creating a graph in the right pattern of a rule. You will be using the same modeler as for all the previous lessons.<\/p>\n<p><span style=\"color: #0000ff;\"><div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#808080;\"><\/span><span style=\"color: #808080;\">A rule can modify the topological structure (as a graph) by preserving, deleting and creating darts, renaming, deleting and creating links. This is done using the left pattern to determine which parts are to be modified (using pattern matching) and the right pattern to determine the rule transformation.<\/span><span style=\"color: #0000ff;\"><\/div><\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>SIMPLE TRANSFORMATION OF TOPOLOGICAL STRUCTURES<br \/>\n<\/strong><\/h3>\n<p>You are going to learn how the left and right patterns are used to effectively match and transform topological structures of objects. You will write a rule which subdivides an edge into edges by adding a vertex in the middle in two different ways, the first will have left and right patterns with each node matching one dart of the object which is to be transformed and the following will have less nodes which match an orbit.<\/p>\n<p>Screens 5.1 and 5.2 show you what the resulting operation will do to the edge of a square.<\/p>\n<figure id=\"attachment_559\" aria-describedby=\"caption-attachment-559\" style=\"width: 150px\" class=\"wp-caption alignleft\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-559 size-thumbnail\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/144-150x150.jpg\" alt=\"\" width=\"150\" height=\"150\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/144-150x150.jpg 150w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/144-100x100.jpg 100w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><figcaption id=\"caption-attachment-559\" class=\"wp-caption-text\">Screen 5.1: before operation<\/figcaption><\/figure>\n<figure id=\"attachment_502\" aria-describedby=\"caption-attachment-502\" style=\"width: 300px\" class=\"wp-caption alignright\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-502 size-medium\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/125-300x253.jpg\" alt=\"\" width=\"300\" height=\"253\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/125-300x253.jpg 300w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/125-768x646.jpg 768w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/125.jpg 859w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-502\" class=\"wp-caption-text\">Screen 5.2: after the operation<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><span style=\"color: #000000;\">open the editor and create a new rule called \u00ab\u00a0SubdivideEdge1\u00a0\u00bb<\/span><\/li>\n<li><span style=\"color: #000000;\">edit the left pattern to match the edge to be subdivided (see Screen 5.1)<\/span>\n<ul>\n<li><span style=\"color: #000000;\">in the left pattern place four nodes which correspond to the four darts of an edge<\/span><\/li>\n<li><span style=\"color: #000000;\">make one of those nodes a hook (it doesn&rsquo;t matter which one)<\/span><\/li>\n<li><span style=\"color: #000000;\">place the appropriate links which you would find in an edge (2-link between two nodes at the same end of the edge and 0-link between two nodes which are at opposite ends<\/span><\/li>\n<li><span style=\"color: #000000;\">put a 3-link loop on each node<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>We&rsquo;re using a 3-loop to specify that the node is it&rsquo;s own neighbor along the 3-link. In other words the selected edge belongs to two border faces.<\/p>\n<ul>\n<li><span style=\"color: #000000;\">edit the right pattern of the subdivided edge (see Screen 5.2)<\/span>\n<ul>\n<li><span style=\"color: #000000;\">repeat all of these steps in the right pattern but do not place the 0-links<\/span><\/li>\n<li><span style=\"color: #000000;\">place four more nodes between the other nodes, two on each side, these nodes correspond to the four darts of the added vertex in the edge<\/span><\/li>\n<li><span style=\"color: #000000;\">these four nodes must be connected with 2-links just like the others and 1-links in the other axis to link the two new edges<br \/>\n<\/span><\/li>\n<li><span style=\"color: #000000;\">connect the four original nodes to the four new ones with 0-links, each original node connected to the closest new node<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>You should see patterns that resemble Screen 5.3.<\/p>\n<figure id=\"attachment_355\" aria-describedby=\"caption-attachment-355\" style=\"width: 854px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-355 size-full\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/85.jpg\" alt=\"\" width=\"854\" height=\"732\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/85.jpg 854w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/85-300x257.jpg 300w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/85-768x658.jpg 768w\" sizes=\"(max-width: 854px) 100vw, 854px\" \/><figcaption id=\"caption-attachment-355\" class=\"wp-caption-text\">Screen 5.3: SubdivideEdge<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Now you will need to write the point embedding expression for the four nodes of the added vertex. You will only need to write it into one of the nodes and it will automatically be propagated to all nodes which are in the orbit of the point embedding (the vertex &lt;1,2,3&gt; orbit).<\/p>\n<ul>\n<li><span style=\"color: #000000;\">edit the point embedding expression for any of the four center nodes (see Screen 5.4)<\/span>\n<ul>\n<li><span style=\"color: #000000;\">create a new instance of \u00ab\u00a0Points\u00a0\u00bb<\/span><\/li>\n<li><span style=\"color: #000000;\">apply the \u00ab\u00a0public void centerPoint()\u00a0\u00bb method found in the \u00ab\u00a0Points.java\u00a0\u00bb embedding class to this new point with the argument being the two points obtained from n0 and n2<br \/>\n<\/span><\/li>\n<li><span style=\"color: #000000;\">return the point<\/span><\/li>\n<\/ul>\n<\/li>\n<li><span style=\"color: #000000;\">apply, save and export<\/span><\/li>\n<\/ul>\n<figure id=\"attachment_359\" aria-describedby=\"caption-attachment-359\" style=\"width: 843px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-359 size-full\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/86.jpg\" alt=\"\" width=\"843\" height=\"186\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/86.jpg 843w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/86-300x66.jpg 300w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/86-768x169.jpg 768w\" sizes=\"(max-width: 843px) 100vw, 843px\" \/><figcaption id=\"caption-attachment-359\" class=\"wp-caption-text\">Screen 5.4: point embedding expression<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<ul>\n<li>try your new operation on an outside edge of the TwoCubes object<\/li>\n<li>try your rule on an edge which belongs to only one face of the TwoCubes object (for example from dart 34)<\/li>\n<\/ul>\n<p>The pattern matching will fail because the left pattern of the rule does not allow for edges which belong to only one face to be matched.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #333333;\">Now you will make the rule more general by creating nodes which match an orbit of the object. This is done by giving the nodes an orbit , from one dart. Doing this will look like folding the left and right patterns in half.<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">open the editor and create a new rule called SubdivideEdge2<\/span><\/li>\n<li><span style=\"color: #000000;\">create two nodes in the left pattern connected by a 0-link<\/span><\/li>\n<\/ul>\n<p>These nodes each replace two nodes in the first version so all of the information needs to be transcribed in this version, to do this you will have to observe which links are being deleted and add them to the orbit of the nodes, these are called implicit links.<\/p>\n<ul>\n<li><span style=\"color: #000000;\">write the &lt;\u03b12&gt; orbit into the nodes and place a 3-loop on them<\/span><\/li>\n<li><span style=\"color: #000000;\">place two nodes in the right pattern corresponding to the two in the left pattern<\/span><\/li>\n<li><span style=\"color: #000000;\">write the\u00a0 &lt;\u03b12&gt; orbit into the nodes and place a 3-loop on them<\/span><\/li>\n<\/ul>\n<p>These two nodes \u00ab\u00a0n0\u00a0\u00bb and \u00ab\u00a0n1\u00a0\u00bb correspond to the nodes in the left pattern.<\/p>\n<ul>\n<li><span style=\"color: #000000;\">place two more nodes in line between the two first nodes<\/span><\/li>\n<li><span style=\"color: #000000;\">write the\u00a0 &lt;\u03b12&gt; orbit into the nodes, place a 3-loop on them and connect them with a 1-link<\/span><\/li>\n<\/ul>\n<p>These nodes correspond to the four darts you wish to add to the object, replacing the four nodes from the first version.<\/p>\n<ul>\n<li><span style=\"color: #000000;\">connect them to the two first nodes with 0-links<br \/>\n<\/span><\/li>\n<\/ul>\n<p>You should have a left and right pattern that look like the ones from the first version folded in half (see Screen 5.5).<\/p>\n<figure id=\"attachment_361\" aria-describedby=\"caption-attachment-361\" style=\"width: 748px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-361 size-full\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/87.jpg\" alt=\"\" width=\"748\" height=\"754\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/87.jpg 748w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/87-150x150.jpg 150w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/87-298x300.jpg 298w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/06\/87-100x100.jpg 100w\" sizes=\"(max-width: 748px) 100vw, 748px\" \/><figcaption id=\"caption-attachment-361\" class=\"wp-caption-text\">Screen 5.5 SubdivideEdge2<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Now you will need to write the point embedding expression for\u00a0 the two nodes of the added vertex.<\/p>\n<ul>\n<li><span style=\"color: #000000;\">edit the point embedding expression for any of the two center nodes (see Screen 5.4) to be the same as in the first version<\/span><\/li>\n<li><span style=\"color: #000000;\">apply, save and try the operation on the inside edge and the edge on one single face of the TwoCubes and then on an edge between the two cubes<br \/>\n<\/span><\/li>\n<\/ul>\n<p>You will notice that the pattern matching fails so the operation will not be applied to the inside edge because the darts of this edge have 3-links which are not accounted for in the rule.<\/p>\n<p>&nbsp;<\/p>\n<p>Now you will go one step further and fold the patterns again in the other direction. To do so, you will delete and rename the matched 0-links (see Screen 5.7). You will also delete the 3-loops and include 3-links as implicit links in the nodes.<\/p>\n<p><span style=\"color: #0000ff;\"><div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#808080;\"><span style=\"color: #808080;\">In the orbit of a node, the \u00ab\u00a0_\u00a0\u00bb indicates that the corresponding links in the hook pattern are to be deleted in the right pattern node.<\/span><\/span><\/p>\n<p><span style=\"color: #0000ff;\"><span style=\"color: #808080;\">In\u00a0 the orbit of a node, when the \u03b1j link of a node replaces the \u03b1i link of a hook node, all matched i-links are renamed to j-links in the orbit of the matched node.<\/span><\/div><\/div><\/span><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><span style=\"color: #000000;\">open the editor and create a new rule called SubdivideEdge3 (see Screen 5.7)<\/span><\/li>\n<li><span style=\"color: #000000;\">create a node in the left pattern, write in the &lt;\u03b10,\u03b12,\u03b13&gt; orbit to match any edge<br \/>\n<\/span><\/li>\n<li><span style=\"color: #000000;\">create two nodes in the right pattern corresponding respectively to the matched vertexes and the added one<br \/>\n<\/span><\/li>\n<li><span style=\"color: #000000;\">connect the two nodes with a 0-link<\/span><\/li>\n<li><span style=\"color: #000000;\">delete 0-links of the matched edge, by replacing the \u03b10 of the left matching node by \u00ab\u00a0_\u00a0\u00bb in the same node on the right<br \/>\n<\/span><\/li>\n<li>rename 0-links of the matched edges 1-links in the created vertex by replacing the \u03b10 of the left matching node by \u03b11 in the new right node<\/li>\n<\/ul>\n<figure id=\"attachment_442\" aria-describedby=\"caption-attachment-442\" style=\"width: 873px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-442 size-full\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/108.jpg\" alt=\"\" width=\"873\" height=\"552\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/108.jpg 873w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/108-300x190.jpg 300w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/108-768x486.jpg 768w\" sizes=\"(max-width: 873px) 100vw, 873px\" \/><figcaption id=\"caption-attachment-442\" class=\"wp-caption-text\">Screen 5.7: SubdivideEdge2<\/figcaption><\/figure>\n<ul>\n<li><span style=\"color: #000000;\">edit the point embedding expression for any of the\u00a0 center node (see Screen 5.4) to be the same as in the first and second versions<\/span><\/li>\n<li><span style=\"color: #000000;\">apply, save and try the operation on the same edges of the TwoCubes<\/span><\/li>\n<\/ul>\n<p>You should now be able to subdivide an inside edge because the 3-link is implicit to the node in the left pattern of the rule and can match all 3-links (loop or not).<\/p>\n<p>&nbsp;<\/p>\n<div class=\"mceTemp\"><\/div>\n<p>&nbsp;<\/p>\n<h3><strong>MORE ADVANCED TRANSFORMATIONS<br \/>\n<\/strong><\/h3>\n<p>You will now create a rule which places a vertex in the center of a face thus subdividing the face, this is called triangulation.<\/p>\n<p>Here is a breakdown of the transformation.<\/p>\n<figure id=\"attachment_440\" aria-describedby=\"caption-attachment-440\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-440 size-medium\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/106-300x269.jpg\" alt=\"\" width=\"300\" height=\"269\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/106-300x269.jpg 300w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/106.jpg 753w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-440\" class=\"wp-caption-text\">Screen 5.8: before operation<\/figcaption><\/figure>\n<figure id=\"attachment_441\" aria-describedby=\"caption-attachment-441\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-441 size-medium\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/107-300x291.jpg\" alt=\"\" width=\"300\" height=\"291\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/107-300x291.jpg 300w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/107.jpg 692w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-441\" class=\"wp-caption-text\">Screen 5.9: after operation<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<ul>\n<li><span style=\"color: #000000;\">open the editor and create a new rule called TriangulateFace<\/span><\/li>\n<li><span style=\"color: #000000;\">in the left pattern (see Screen 5.10) create a single hook with the face orbit &lt;\u03b10,\u03b11,\u03b13&gt;<br \/>\n<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #333333;\">\u00a0<\/span><\/p>\n<p>Screen 5.10: Left pattern<span style=\"color: #0000ff;\"><div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#808080;\"><span style=\"color: #808080;\">In the left pattern, a node matches the orbit from it&rsquo;s selected dart. Here the orbit of a face &lt;\u03b10,\u03b11,\u03b13&gt;(d) is matched by n0 when n0 hooks the dart d.<\/span><\/div><\/div><\/span><\/p>\n<ul>\n<li>in the right pattern, place the same node as in the left pattern, deleting the 1-link to separate the edges from the matched face<\/li>\n<\/ul>\n<p><span style=\"color: #808080;\"><span style=\"color: #0000ff;\"><div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#808080;\"><\/span>In the right pattern, preserved nodes enable the rule to modify the matched orbits by deleting or renaming their links. Here the vertexes of the matched face are deleted by breaching the 1-links with the \u00ab\u00a0_\u00a0\u00bb character, giving the &lt;_,\u03b12,\u03b13&gt; orbit to n0.<span style=\"color: #0000ff;\"><\/div><\/div><\/span><\/span><\/p>\n<ul>\n<li>create a new node n2 in the right pattern with the renamed orbit from the node in the left pattern which creates the dual vertex in the center of the triangulated face with the same structure as the face (0-links are renamed to 1-links and 1-links are renamed to 2-links)<\/li>\n<\/ul>\n<p><span style=\"color: #0000ff;\"><div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#808080;\"><span style=\"color: #808080;\">In the right pattern, added nodes produce copies of the matched orbits save for modifications like deleting and renaming of links. Here the n2 node creates the vertex in the center of the matched face with the &lt;\u03b11,\u03b12,\u03b13&gt; orbit.<\/span><\/div><\/div><\/span><\/p>\n<ul>\n<li>create a new node n1 in between the two other nodes to create the bases of the added edges between the original darts of the face and those of the central vertex<\/li>\n<\/ul>\n<p>Where darts of the face matched by n0 are linked by 0-links, darts created by n1 are not linked so \u00ab\u00a0_\u00a0\u00bb replaces \u03b11 in the orbit. Where darts of the face matched by n0 are linked by 1-links, darts created by n1 are linked by 2-links so n1 will have the orbit &lt;_,\u03b12,\u03b13&gt;.<\/p>\n<ul>\n<li>the darts of the face must be linked to the new darts at the base of the edges leading to the center by 1-links and the darts at the base of the edge must be linked to the darts in the center by 0-links<\/li>\n<\/ul>\n<p><span style=\"color: #808080;\"><span style=\"color: #0000ff;\"><div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#808080;\"><\/span>Explicit links (those which are between nodes in the rule) link the matched or created darts two-by-two. Here the 0-links of the new edges leading to the center of the face are all created by the 0-link between n1 and n2 and the 1-links between the base of each new edge and the preexisting vertexes are all created by the 1-link between n0 and n1.<span style=\"color: #0000ff;\"><\/div><\/div><\/span><\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-506 size-full\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/126.jpg\" alt=\"\" width=\"727\" height=\"527\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/126.jpg 727w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/126-300x217.jpg 300w\" sizes=\"(max-width: 727px) 100vw, 727px\" \/><\/p>\n<ul>\n<li><span style=\"color: #000000;\">select the third dart of the right pattern, select the point embedding (see Screen 5.11) and edit it<\/span>\n<ul>\n<li><span style=\"color: #000000;\">create a new instance of Points<\/span><\/li>\n<li><span style=\"color: #000000;\">give it the coordinates corresponding to the center of a list of points with the \u00ab\u00a0public void centerPoint(java.util.List&lt;Points&gt; list)\u00a0\u00bb method found in the \u00ab\u00a0Points.java\u00a0\u00bb embedding class<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"color: #333333;\">In this case you want the center of the face so you will create a list of all the darts of the face by indicating the orbit and the first dart (the hook in this case): \u00ab\u00a0&lt;\u03b10,\u03b11,\u03b13&gt;_point(n0)\u00a0\u00bb.<\/span><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><span style=\"color: #000000;\">finally, return the instance of Points, apply, save and export<\/span><\/li>\n<\/ul>\n<figure id=\"attachment_462\" aria-describedby=\"caption-attachment-462\" style=\"width: 715px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-462 size-full\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/114.jpg\" alt=\"\" width=\"715\" height=\"292\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/114.jpg 715w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/114-300x123.jpg 300w\" sizes=\"(max-width: 715px) 100vw, 715px\" \/><figcaption id=\"caption-attachment-462\" class=\"wp-caption-text\">Screen 5.11: point embedding expression<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<ul>\n<li><span style=\"color: #000000;\">refresh the project and launch the viewer so you can test your rule on any object.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><strong>MULTIPLE HOOKS<\/strong><\/h3>\n<p>In the first lesson you used a rule called \u00ab\u00a0Sew3\u00a0\u00bb for which you had to select two darts to apply it. You will now rewrite the Sew3 rule yourself to see how to write a rule with more than one hook.<\/p>\n<ul>\n<li>open the editor and create a new rule called NewSew3 (see Screen\u00a0 5.12)<\/li>\n<li>place two nodes in the left pattern which should each match a volume face (so with the &lt;\u03b10,\u03b11&gt; orbit) and make them hooks<\/li>\n<li>place 3-loops on these nodes to match free faces in the 3rd dimension<\/li>\n<li>place the same two nodes in the right pattern and connect them with a 3-link instead of placing the 3-loops<\/li>\n<\/ul>\n<figure id=\"attachment_446\" aria-describedby=\"caption-attachment-446\" style=\"width: 863px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-446\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/111.jpg\" alt=\"\" width=\"863\" height=\"432\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/111.jpg 863w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/111-300x150.jpg 300w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/111-768x384.jpg 768w\" sizes=\"(max-width: 863px) 100vw, 863px\" \/><figcaption id=\"caption-attachment-446\" class=\"wp-caption-text\">Screen 5.12: NewSew3<\/figcaption><\/figure>\n<p>If two volume-faces are to be connected with 3-links to form a new face they must have the same position so, in case this is not the case before applying the operation, you must edit the point embedding of one of the nodes in the right pattern to make sure both volume-faces are in the same place.<\/p>\n<ul>\n<li>edit the point embedding of one of the two nodes in the right pattern so that the point embedding of that node has the same value as the point embedding of the other node (see Screen 5.13)<\/li>\n<\/ul>\n<figure id=\"attachment_447\" aria-describedby=\"caption-attachment-447\" style=\"width: 849px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-447\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/112.png\" alt=\"\" width=\"849\" height=\"178\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/112.png 849w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/112-300x63.png 300w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/112-768x161.png 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><figcaption id=\"caption-attachment-447\" class=\"wp-caption-text\">Screen 5.13: point embedding expression<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h3><strong>NO HOOKS<\/strong><\/h3>\n<p><span style=\"color: #0000ff;\"><div class=\"su-note\"  style=\"border-color:#e5e5e5;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#ffffff;border-color:#ffffff;color:#808080;\"><\/span><span style=\"color: #808080;\">Some rules have an empty left pattern which means they have no hooks and don&rsquo;t match a sub-graph. Their right pattern must be constant. In other words,\u00a0 the nodes in the right pattern all have &lt;&gt; orbits which is the only type of orbit with a constant value.<\/span><span style=\"color: #0000ff;\"><\/div><\/div><\/span><\/p>\n<p>You will now create a rule which creates a square out of nothing, without any hooks and without a left pattern.<\/p>\n<ul>\n<li>open the editor and create a new rule called \u00ab\u00a0CreateSquare\u00a0\u00bb (see Screen 5.14)<\/li>\n<li>place all eight nodes in the right pattern which are needed for a square and the appropriate links and loops<\/li>\n<\/ul>\n<figure id=\"attachment_570\" aria-describedby=\"caption-attachment-570\" style=\"width: 898px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" loading=\"lazy\" class=\"wp-image-570 size-full\" src=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/157.jpg\" alt=\"\" width=\"898\" height=\"677\" srcset=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/157.jpg 898w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/157-300x226.jpg 300w, http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-content\/uploads\/2018\/07\/157-768x579.jpg 768w\" sizes=\"(max-width: 898px) 100vw, 898px\" \/><figcaption id=\"caption-attachment-570\" class=\"wp-caption-text\">Screen 5.14: CreateSquare<\/figcaption><\/figure>\n<ul>\n<li>return an instance of Points for one node of each vertex in order to make a square<\/li>\n<li>add a color to one of the nodes of the right pattern<\/li>\n<li>apply, save and export the rule to try it in the modeler<\/li>\n<\/ul>\n<hr \/>\n<h3><strong>What have you learned ?<\/strong><\/h3>\n<ul>\n<li>What is the difference between implicit and explicit links in the pattern of a rule?<\/li>\n<li>How many darts are added when triangulating a triangular face?<\/li>\n<li>How do you delete an implicit link?<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; In this lesson you will learn how to transform the topological structure of an object by creating a graph in the right pattern of a rule. You will be using the same modeler as for all the previous lessons. &nbsp; SIMPLE TRANSFORMATION OF TOPOLOGICAL STRUCTURES You are going to learn how the left and &hellip; <a href=\"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/lesson-5-make-topological-transformations\/\" class=\"more-link\">Continuer la lecture de <span class=\"screen-reader-text\">Lesson 5: Design topological transformations<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-json\/wp\/v2\/pages\/243"}],"collection":[{"href":"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-json\/wp\/v2\/comments?post=243"}],"version-history":[{"count":33,"href":"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-json\/wp\/v2\/pages\/243\/revisions"}],"predecessor-version":[{"id":571,"href":"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-json\/wp\/v2\/pages\/243\/revisions\/571"}],"wp:attachment":[{"href":"http:\/\/xlim-sic.labo.univ-poitiers.fr\/jerboa\/doc\/wp-json\/wp\/v2\/media?parent=243"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}