mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2025-01-09 00:00:18 +00:00
89f00d3603
- added UVs to non-manifold shape sets for both Catmark and Loop - added UVs to the semi-sharp and inf-sharp variations of Catmark cubes
399 lines
9.0 KiB
C++
399 lines
9.0 KiB
C++
//
|
|
// Copyright 2019 DreamWorks Animation LLC.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "Apache License")
|
|
// with the following modification; you may not use this file except in
|
|
// compliance with the Apache License and the following modification to it:
|
|
// Section 6. Trademarks. is deleted and replaced with:
|
|
//
|
|
// 6. Trademarks. This License does not grant permission to use the trade
|
|
// names, trademarks, service marks, or product names of the Licensor
|
|
// and its affiliates, except as required to comply with Section 4(c) of
|
|
// the License and to reproduce the content of the NOTICE file.
|
|
//
|
|
// You may obtain a copy of the Apache License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the Apache License with the above modification is
|
|
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
// KIND, either express or implied. See the Apache License for the specific
|
|
// language governing permissions and limitations under the Apache License.
|
|
//
|
|
|
|
static const std::string loop_nonman_edges =
|
|
"#\n"
|
|
"# Nine shapes ordered left->right and top->bottom in the XZ plane\n"
|
|
"#\n"
|
|
"# Shape 1: top-left\n"
|
|
"#\n"
|
|
"v -1.75 0.0 1.083333\n"
|
|
"v -1.583333 0.0 1.25\n"
|
|
"v -1.416667 0.0 1.416667\n"
|
|
"v -1.25 0.0 1.583333\n"
|
|
"v -1.083333 0.0 1.416667\n"
|
|
"v -0.916667 0.0 1.25\n"
|
|
"v -0.75 0.0 1.083333\n"
|
|
"v -1.583333 0.0 0.916667\n"
|
|
"v -1.416667 0.0 1.083333\n"
|
|
"v -1.25 0.0 1.25\n"
|
|
"v -1.083333 0.0 1.083333\n"
|
|
"v -0.916667 0.0 0.916667\n"
|
|
"v -1.45 0.2 1.05\n"
|
|
"v -1.35 0.2 1.15\n"
|
|
"v -1.15 0.2 1.15\n"
|
|
"v -1.05 0.2 1.05\n"
|
|
"v -1.45 -0.2 1.05\n"
|
|
"v -1.35 -0.2 1.15\n"
|
|
"v -1.15 -0.2 1.15\n"
|
|
"v -1.05 -0.2 1.05\n"
|
|
"\n"
|
|
"vt 0.02 0.83\n"
|
|
"vt 0.07 0.88\n"
|
|
"vt 0.12 0.93\n"
|
|
"vt 0.17 0.98\n"
|
|
"vt 0.22 0.93\n"
|
|
"vt 0.27 0.88\n"
|
|
"vt 0.32 0.83\n"
|
|
"vt 0.07 0.78\n"
|
|
"vt 0.12 0.83\n"
|
|
"vt 0.17 0.88\n"
|
|
"vt 0.22 0.83\n"
|
|
"vt 0.27 0.78\n"
|
|
"vt 0.11 0.78\n"
|
|
"vt 0.14 0.78\n"
|
|
"vt 0.20 0.78\n"
|
|
"vt 0.23 0.78\n"
|
|
"vt 0.11 0.68\n"
|
|
"vt 0.14 0.68\n"
|
|
"vt 0.20 0.68\n"
|
|
"vt 0.23 0.68\n"
|
|
"vt 0.07 0.73\n"
|
|
"vt 0.12 0.73\n"
|
|
"vt 0.17 0.73\n"
|
|
"vt 0.22 0.73\n"
|
|
"vt 0.27 0.73\n"
|
|
"\n"
|
|
"f 1/1 8/8 2/2 \n"
|
|
"f 2/2 8/8 9/9 \n"
|
|
"f 2/2 9/9 3/3 \n"
|
|
"f 3/3 9/9 10/10\n"
|
|
"f 3/3 10/10 4/4 \n"
|
|
"f 4/4 10/10 5/5 \n"
|
|
"f 5/5 10/10 11/11\n"
|
|
"f 5/5 11/11 6/6 \n"
|
|
"f 6/6 11/11 12/12\n"
|
|
"f 6/6 12/12 7/7 \n"
|
|
"f 13/13 8/21 9/22\n"
|
|
"f 13/13 9/22 14/14\n"
|
|
"f 14/14 9/22 10/23\n"
|
|
"f 14/14 10/23 15/15\n"
|
|
"f 15/15 10/23 11/24\n"
|
|
"f 15/15 11/24 16/16\n"
|
|
"f 16/16 11/24 12/25\n"
|
|
"f 17/17 9/22 8/21\n"
|
|
"f 17/17 18/18 9/22\n"
|
|
"f 18/18 10/23 9/22\n"
|
|
"f 18/18 19/19 10/23\n"
|
|
"f 19/19 11/24 10/23\n"
|
|
"f 19/19 20/20 11/24\n"
|
|
"f 20/20 12/25 11/24\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 2: top-middle\n"
|
|
"#\n"
|
|
"v -0.333333 0.0 0.81698\n"
|
|
"v 0.0 0.0 0.81698\n"
|
|
"v 0.333333 0.0 0.81698\n"
|
|
"v -0.5 0.0 1.10566\n"
|
|
"v -0.166667 -0.25 1.10566\n"
|
|
"v 0.166667 -0.25 1.10566\n"
|
|
"v 0.5 0.0 1.10566\n"
|
|
"v -0.333333 0.0 1.39434\n"
|
|
"v 0.0 -0.25 1.39434\n"
|
|
"v 0.333333 0.0 1.39434\n"
|
|
"v -0.166667 0.0 1.68302\n"
|
|
"v 0.166667 0.0 1.68302\n"
|
|
"v 0.0 -0.50 1.25\n"
|
|
"\n"
|
|
"vt 0.40 0.68\n"
|
|
"vt 0.50 0.68\n"
|
|
"vt 0.60 0.68\n"
|
|
"vt 0.35 0.77\n"
|
|
"vt 0.45 0.77\n"
|
|
"vt 0.55 0.77\n"
|
|
"vt 0.65 0.77\n"
|
|
"vt 0.40 0.85\n"
|
|
"vt 0.50 0.85\n"
|
|
"vt 0.60 0.85\n"
|
|
"vt 0.45 0.93\n"
|
|
"vt 0.55 0.93\n"
|
|
"vt 0.50 1.00\n"
|
|
"vt 0.45 0.94\n"
|
|
"vt 0.55 0.94\n"
|
|
"\n"
|
|
"f 21/26 22/27 25/30\n"
|
|
"f 22/27 23/28 26/31\n"
|
|
"f 21/26 25/30 24/29\n"
|
|
"f 22/27 26/31 25/30\n"
|
|
"f 23/28 27/32 26/31\n"
|
|
"f 24/29 25/30 28/33\n"
|
|
"f 25/30 26/31 29/34\n"
|
|
"f 26/31 27/32 30/35\n"
|
|
"f 25/30 29/34 28/33\n"
|
|
"f 26/31 30/35 29/34\n"
|
|
"f 28/33 29/34 31/36\n"
|
|
"f 29/34 30/35 32/37\n"
|
|
"f 29/34 32/37 31/36\n"
|
|
"# Add face to existing manifold edge, making it non-manifold:\n"
|
|
"f 33/38 25/39 26/40\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 3: top-right\n"
|
|
"#\n"
|
|
"v 1.25 0.25 1.25\n"
|
|
"v 1.25 -0.25 1.25\n"
|
|
"v 1.25 0 1.75\n"
|
|
"v 0.9 0 1.6\n"
|
|
"v 0.75 0 1.25\n"
|
|
"v 0.9 0 0.9\n"
|
|
"v 1.25 0 0.75\n"
|
|
"v 1.6 0 0.9\n"
|
|
"v 1.75 0 1.25\n"
|
|
"v 1.6 0 1.6\n"
|
|
"\n"
|
|
"vt 0.68 0.74\n"
|
|
"vt 0.80 0.74\n"
|
|
"vt 0.74 0.68\n"
|
|
"vt 0.74 0.80\n"
|
|
"vt 0.85 0.74\n"
|
|
"vt 0.97 0.74\n"
|
|
"vt 0.91 0.68\n"
|
|
"vt 0.91 0.80\n"
|
|
"vt 0.68 0.91\n"
|
|
"vt 0.80 0.91\n"
|
|
"vt 0.74 0.85\n"
|
|
"vt 0.74 0.97\n"
|
|
"vt 0.85 0.91\n"
|
|
"vt 0.97 0.91\n"
|
|
"vt 0.91 0.85\n"
|
|
"vt 0.91 0.97\n"
|
|
"\n"
|
|
"f 34/41 35/42 36/44\n"
|
|
"f 35/42 34/41 40/43\n"
|
|
"f 34/45 35/46 37/48\n"
|
|
"f 35/46 34/45 41/47\n"
|
|
"f 34/49 35/50 38/52\n"
|
|
"f 35/50 34/49 42/51\n"
|
|
"f 34/53 35/54 39/56\n"
|
|
"f 35/54 34/53 43/55\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 4: center-left\n"
|
|
"#\n"
|
|
"v -1.70 0 -0.15\n"
|
|
"v -1.40 -0.2 -0.15\n"
|
|
"v -1.10 -0.2 -0.15\n"
|
|
"v -0.80 0 -0.15\n"
|
|
"v -1.55 0 0.15\n"
|
|
"v -1.25 -0.2 0.15\n"
|
|
"v -0.95 0 0.15\n"
|
|
"\n"
|
|
"vt 0.04 0.46\n"
|
|
"vt 0.12 0.46\n"
|
|
"vt 0.22 0.46\n"
|
|
"vt 0.31 0.46\n"
|
|
"vt 0.08 0.55\n"
|
|
"vt 0.17 0.55\n"
|
|
"vt 0.26 0.55\n"
|
|
"\n"
|
|
"f 44/57 45/58 48/61\n"
|
|
"f 45/58 46/59 49/62\n"
|
|
"f 46/59 47/60 50/63\n"
|
|
"f 45/58 49/62 48/61\n"
|
|
"f 46/59 50/63 49/62\n"
|
|
"# Add triangle with degenerate edge along existing edge:\n"
|
|
"f 46/59 46/59 49/62\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 5: center-middle\n"
|
|
"#\n"
|
|
"v -0.333333 0.0 -0.43302\n"
|
|
"v 0.0 0.0 -0.43302\n"
|
|
"v 0.333333 0.0 -0.43302\n"
|
|
"v -0.5 0.0 -0.14434\n"
|
|
"v -0.166667 -0.25 -0.14434\n"
|
|
"v 0.166667 -0.25 -0.14434\n"
|
|
"v 0.5 0.0 -0.14434\n"
|
|
"v -0.333333 0.0 0.14434\n"
|
|
"v 0.0 -0.25 0.14434\n"
|
|
"v 0.333333 0.0 0.14434\n"
|
|
"v -0.166667 0.0 0.43302\n"
|
|
"v 0.166667 0.0 0.43302\n"
|
|
"\n"
|
|
"vt 0.40 0.37\n"
|
|
"vt 0.50 0.37\n"
|
|
"vt 0.60 0.37\n"
|
|
"vt 0.35 0.46\n"
|
|
"vt 0.45 0.46\n"
|
|
"vt 0.55 0.46\n"
|
|
"vt 0.65 0.46\n"
|
|
"vt 0.40 0.54\n"
|
|
"vt 0.50 0.54\n"
|
|
"vt 0.60 0.54\n"
|
|
"vt 0.45 0.63\n"
|
|
"vt 0.55 0.63\n"
|
|
"\n"
|
|
"f 51/64 52/65 55/68\n"
|
|
"f 52/65 53/66 56/69\n"
|
|
"f 51/64 55/68 54/67\n"
|
|
"f 52/65 56/69 55/68\n"
|
|
"f 53/66 57/70 56/69\n"
|
|
"f 54/67 55/68 58/71\n"
|
|
"f 55/68 56/69 59/72\n"
|
|
"f 56/69 57/70 60/73\n"
|
|
"f 55/68 59/72 58/71\n"
|
|
"f 56/69 60/73 59/72\n"
|
|
"f 58/71 59/72 61/74\n"
|
|
"f 59/72 60/73 62/75\n"
|
|
"f 59/72 62/75 61/74\n"
|
|
"# Add a triangle with a degenerate edge to the interior:\n"
|
|
"f 55/68 56/69 56/69\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 6: center-right\n"
|
|
"#\n"
|
|
"v 0.916667 0.0 -0.43302\n"
|
|
"v 1.25 0.0 -0.43302\n"
|
|
"v 1.583333 0.0 -0.43302\n"
|
|
"v 0.75 0.0 -0.14434\n"
|
|
"v 1.083333 -0.25 -0.14434\n"
|
|
"v 1.416667 -0.25 -0.14434\n"
|
|
"v 1.75 0.0 -0.14434\n"
|
|
"v 0.916667 0.0 0.14434\n"
|
|
"v 1.25 -0.25 0.14434\n"
|
|
"v 1.583333 0.0 0.14434\n"
|
|
"v 1.083333 0.0 0.43302\n"
|
|
"v 1.416667 0.0 0.43302\n"
|
|
"\n"
|
|
"vt 0.73 0.37\n"
|
|
"vt 0.83 0.37\n"
|
|
"vt 0.93 0.37\n"
|
|
"vt 0.68 0.46\n"
|
|
"vt 0.78 0.46\n"
|
|
"vt 0.88 0.46\n"
|
|
"vt 0.98 0.46\n"
|
|
"vt 0.73 0.54\n"
|
|
"vt 0.83 0.54\n"
|
|
"vt 0.93 0.54\n"
|
|
"vt 0.78 0.63\n"
|
|
"vt 0.88 0.63\n"
|
|
"\n"
|
|
"f 63/76 64/77 67/80\n"
|
|
"f 64/77 65/78 68/81\n"
|
|
"f 63/76 67/80 66/79\n"
|
|
"f 64/77 68/81 67/80\n"
|
|
"f 65/78 69/82 68/81\n"
|
|
"f 66/79 67/80 70/83\n"
|
|
"f 67/80 68/81 71/84\n"
|
|
"f 68/81 69/82 72/85\n"
|
|
"f 67/80 71/84 70/83\n"
|
|
"f 68/81 72/85 71/84\n"
|
|
"f 70/83 71/84 73/86\n"
|
|
"f 71/84 72/85 74/87\n"
|
|
"f 71/84 74/87 73/86\n"
|
|
"# Add a completely degenerate triangle to the interior:\n"
|
|
"f 67/80 67/80 67/80\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 7: bottom-left\n"
|
|
"#\n"
|
|
"v -1.25 0.0 -1.25\n"
|
|
"\n"
|
|
"vt 0.12 0.12\n"
|
|
"vt 0.22 0.12\n"
|
|
"vt 0.17 0.22\n"
|
|
"\n"
|
|
"f 75/88 75/89 75/90\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 8: bottom-middle\n"
|
|
"#\n"
|
|
"v -0.5 0 -1.35\n"
|
|
"v -0.25 -0.1 -1.35\n"
|
|
"v 0 0 -1.35\n"
|
|
"v 0.25 -0.1 -1.35\n"
|
|
"v 0.5 0 -1.35\n"
|
|
"v -0.375 0 -1.15\n"
|
|
"v -0.125 -0.1 -1.15\n"
|
|
"v 0.125 -0.1 -1.15\n"
|
|
"v 0.375 0 -1.15\n"
|
|
"\n"
|
|
"vt 0.35 0.14\n"
|
|
"vt 0.43 0.14\n"
|
|
"vt 0.50 0.14\n"
|
|
"vt 0.57 0.14\n"
|
|
"vt 0.65 0.14\n"
|
|
"vt 0.39 0.20\n"
|
|
"vt 0.46 0.20\n"
|
|
"vt 0.54 0.20\n"
|
|
"vt 0.61 0.20\n"
|
|
"\n"
|
|
"f 76/91 77/92 81/96\n"
|
|
"f 77/92 82/97 81/96\n"
|
|
"# Reverse winding of the 3 middle faces:\n"
|
|
"f 82/97 78/93 77/92\n"
|
|
"f 82/97 83/98 78/93\n"
|
|
"f 83/98 79/94 78/93\n"
|
|
"f 79/94 84/99 83/98\n"
|
|
"f 79/94 80/95 84/99\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 9: bottom-right\n"
|
|
"#\n"
|
|
"v 0.916667 0.0 -1.68302\n"
|
|
"v 1.25 0.0 -1.68302\n"
|
|
"v 1.583333 0.0 -1.68302\n"
|
|
"v 0.75 0.0 -1.39434\n"
|
|
"v 1.083333 -0.25 -1.39434\n"
|
|
"v 1.416667 -0.25 -1.39434\n"
|
|
"v 1.75 0.0 -1.39434\n"
|
|
"v 0.916667 0.0 -1.10566\n"
|
|
"v 1.25 -0.25 -1.10566\n"
|
|
"v 1.583333 0.0 -1.10566\n"
|
|
"v 1.083333 0.0 -0.81698\n"
|
|
"v 1.416667 0.0 -0.81698\n"
|
|
"\n"
|
|
"vt 0.73 0.04\n"
|
|
"vt 0.83 0.04\n"
|
|
"vt 0.93 0.04\n"
|
|
"vt 0.68 0.13\n"
|
|
"vt 0.78 0.13\n"
|
|
"vt 0.88 0.13\n"
|
|
"vt 0.98 0.13\n"
|
|
"vt 0.73 0.21\n"
|
|
"vt 0.83 0.21\n"
|
|
"vt 0.93 0.21\n"
|
|
"vt 0.78 0.30\n"
|
|
"vt 0.88 0.30\n"
|
|
"\n"
|
|
"f 85/100 86/101 89/104\n"
|
|
"f 86/101 87/102 90/105\n"
|
|
"f 85/100 89/104 88/103\n"
|
|
"f 86/101 90/105 89/104\n"
|
|
"f 87/102 91/106 90/105\n"
|
|
"f 88/103 89/104 92/107\n"
|
|
"# Reverse the winding order of the interior face:\n"
|
|
"f 93/108 90/105 89/104\n"
|
|
"f 90/105 91/106 94/109\n"
|
|
"f 89/104 93/108 92/107\n"
|
|
"f 90/105 94/109 93/108\n"
|
|
"f 92/107 93/108 95/110\n"
|
|
"f 93/108 94/109 96/111\n"
|
|
"f 93/108 96/111 95/110\n"
|
|
"\n"
|
|
"t interpolateboundary 1/0/0 1\n"
|
|
"\n"
|
|
;
|