mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-11-13 23:50:09 +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
477 lines
10 KiB
C++
477 lines
10 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 catmark_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.25 0.00 1.58\n"
|
|
"v -1.42 0.00 1.42\n"
|
|
"v -1.08 0.00 1.42\n"
|
|
"v -1.58 0.00 1.25\n"
|
|
"v -0.92 0.00 1.25\n"
|
|
"v -1.75 0.00 1.08\n"
|
|
"v -0.75 0.00 1.08\n"
|
|
"v -1.58 0.00 0.92\n"
|
|
"v -1.42 0.00 1.08\n"
|
|
"v -1.25 0.00 1.25\n"
|
|
"v -1.08 0.00 1.08\n"
|
|
"v -0.92 0.00 0.92\n"
|
|
"v -1.58 0.17 0.92\n"
|
|
"v -1.42 0.17 1.08\n"
|
|
"v -1.25 0.17 1.25\n"
|
|
"v -1.08 0.17 1.08\n"
|
|
"v -0.92 0.17 0.92\n"
|
|
"v -1.58 -0.17 0.92\n"
|
|
"v -1.42 -0.17 1.08\n"
|
|
"v -1.25 -0.17 1.25\n"
|
|
"v -1.08 -0.17 1.08\n"
|
|
"v -0.92 -0.17 0.92\n"
|
|
"\n"
|
|
"vt 0.05 0.83\n"
|
|
"vt 0.05 0.78\n"
|
|
"vt 0.10 0.83\n"
|
|
"vt 0.05 0.73\n"
|
|
"vt 0.15 0.83\n"
|
|
"vt 0.05 0.68\n"
|
|
"vt 0.20 0.83\n"
|
|
"vt 0.10 0.68\n"
|
|
"vt 0.10 0.73\n"
|
|
"vt 0.10 0.78\n"
|
|
"vt 0.15 0.78\n"
|
|
"vt 0.20 0.78\n"
|
|
"vt 0.05 0.88\n"
|
|
"vt 0.10 0.88\n"
|
|
"vt 0.15 0.88\n"
|
|
"vt 0.20 0.88\n"
|
|
"vt 0.25 0.88\n"
|
|
"vt 0.05 0.93\n"
|
|
"vt 0.10 0.93\n"
|
|
"vt 0.15 0.93\n"
|
|
"vt 0.20 0.93\n"
|
|
"vt 0.25 0.93\n"
|
|
"vt 0.05 0.98\n"
|
|
"vt 0.10 0.98\n"
|
|
"vt 0.15 0.98\n"
|
|
"vt 0.20 0.98\n"
|
|
"vt 0.25 0.98\n"
|
|
"\n"
|
|
"f 1/1 2/2 10/10 3/3 \n"
|
|
"f 2/2 4/4 9/9 10/10\n"
|
|
"f 4/4 6/6 8/8 9/9 \n"
|
|
"f 5/5 3/3 10/10 11/11\n"
|
|
"f 7/7 5/5 11/11 12/12\n"
|
|
"f 8/18 9/19 14/24 13/23\n"
|
|
"f 9/19 10/20 15/25 14/24\n"
|
|
"f 10/20 11/21 16/26 15/25\n"
|
|
"f 11/21 12/22 17/27 16/26\n"
|
|
"f 9/19 8/18 18/13 19/14\n"
|
|
"f 10/20 9/19 19/14 20/15\n"
|
|
"f 11/21 10/20 20/15 21/16\n"
|
|
"f 12/22 11/21 21/16 22/17\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 2: top-middle\n"
|
|
"#\n"
|
|
"v -0.50 0.00 0.75\n"
|
|
"v -0.17 0.00 0.75\n"
|
|
"v 0.17 0.00 0.75\n"
|
|
"v 0.50 0.00 0.75\n"
|
|
"v 0.50 0.00 1.08\n"
|
|
"v 0.50 0.00 1.42\n"
|
|
"v 0.50 0.00 1.75\n"
|
|
"v 0.17 0.00 1.75\n"
|
|
"v -0.17 0.00 1.75\n"
|
|
"v -0.50 0.00 1.75\n"
|
|
"v -0.50 0.00 1.42\n"
|
|
"v -0.50 0.00 1.08\n"
|
|
"v -0.17 -0.30 1.08\n"
|
|
"v 0.17 -0.30 1.08\n"
|
|
"v 0.17 -0.30 1.42\n"
|
|
"v -0.17 -0.30 1.42\n"
|
|
"v 0.00 -0.60 1.25\n"
|
|
"\n"
|
|
"vt 0.38 0.69\n"
|
|
"vt 0.46 0.69\n"
|
|
"vt 0.54 0.69\n"
|
|
"vt 0.62 0.69\n"
|
|
"vt 0.62 0.77\n"
|
|
"vt 0.62 0.85\n"
|
|
"vt 0.62 0.93\n"
|
|
"vt 0.54 0.93\n"
|
|
"vt 0.46 0.93\n"
|
|
"vt 0.38 0.93\n"
|
|
"vt 0.38 0.85\n"
|
|
"vt 0.38 0.77\n"
|
|
"vt 0.46 0.77\n"
|
|
"vt 0.54 0.77\n"
|
|
"vt 0.54 0.85\n"
|
|
"vt 0.46 0.85\n"
|
|
"vt 0.50 0.99\n"
|
|
"vt 0.48 0.95\n"
|
|
"vt 0.52 0.95\n"
|
|
"\n"
|
|
"f 23/28 24/29 35/40 34/39\n"
|
|
"f 24/29 25/30 36/41 35/40\n"
|
|
"f 25/30 26/31 27/32 36/41\n"
|
|
"f 36/41 27/32 28/33 37/42\n"
|
|
"f 37/42 28/33 29/34 30/35\n"
|
|
"f 38/43 37/42 30/35 31/36\n"
|
|
"f 33/38 38/43 31/36 32/37\n"
|
|
"f 34/39 35/40 38/43 33/38\n"
|
|
"f 35/40 36/41 37/42 38/43\n"
|
|
"\n"
|
|
"f 35/45 36/46 39/44\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 3: top-right\n"
|
|
"#\n"
|
|
"v 0.75 0.00 0.75\n"
|
|
"v 1.08 0.00 0.75\n"
|
|
"v 1.42 0.00 0.75\n"
|
|
"v 1.75 0.00 0.75\n"
|
|
"v 1.75 0.00 1.08\n"
|
|
"v 1.75 0.00 1.42\n"
|
|
"v 1.75 0.00 1.75\n"
|
|
"v 1.42 0.00 1.75\n"
|
|
"v 1.08 0.00 1.75\n"
|
|
"v 0.75 0.00 1.75\n"
|
|
"v 0.75 0.00 1.42\n"
|
|
"v 0.75 0.00 1.08\n"
|
|
"v 1.25 -0.30 1.08\n"
|
|
"v 1.42 -0.30 1.42\n"
|
|
"v 1.08 -0.30 1.42\n"
|
|
"\n"
|
|
"vt 0.68 0.68\n"
|
|
"vt 0.78 0.68\n"
|
|
"vt 0.88 0.68\n"
|
|
"vt 0.98 0.68\n"
|
|
"vt 0.98 0.78\n"
|
|
"vt 0.98 0.88\n"
|
|
"vt 0.98 0.98\n"
|
|
"vt 0.88 0.98\n"
|
|
"vt 0.78 0.98\n"
|
|
"vt 0.68 0.98\n"
|
|
"vt 0.68 0.88\n"
|
|
"vt 0.68 0.78\n"
|
|
"vt 0.78 0.78\n"
|
|
"vt 0.88 0.78\n"
|
|
"vt 0.88 0.88\n"
|
|
"vt 0.78 0.88\n"
|
|
"\n"
|
|
"f 40/47 41/48 52/59 51/58\n"
|
|
"f 41/48 42/49 52/60 52/59\n"
|
|
"f 42/49 43/50 44/51 52/60\n"
|
|
"f 52/60 44/51 45/52 53/61\n"
|
|
"f 53/61 45/52 46/53 47/54\n"
|
|
"f 54/62 53/61 47/54 48/55\n"
|
|
"f 50/57 54/62 48/55 49/56\n"
|
|
"f 51/58 52/59 54/62 50/57\n"
|
|
"\n"
|
|
"f 52/59 52/60 53/61 54/62\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 4: center-left\n"
|
|
"#\n"
|
|
"v -1.75 0.00 -0.50\n"
|
|
"v -1.42 0.00 -0.50\n"
|
|
"v -1.08 0.00 -0.50\n"
|
|
"v -0.75 0.00 -0.50\n"
|
|
"v -0.75 0.00 -0.17\n"
|
|
"v -0.75 0.00 0.17\n"
|
|
"v -0.75 0.00 0.50\n"
|
|
"v -1.08 0.00 0.50\n"
|
|
"v -1.42 0.00 0.50\n"
|
|
"v -1.75 0.00 0.50\n"
|
|
"v -1.75 0.00 0.17\n"
|
|
"v -1.75 0.00 -0.17\n"
|
|
"v -1.25 -0.30 -0.17\n"
|
|
"v -1.25 -0.30 0.17\n"
|
|
"\n"
|
|
"vt 0.02 0.35\n"
|
|
"vt 0.12 0.35\n"
|
|
"vt 0.22 0.35\n"
|
|
"vt 0.32 0.35\n"
|
|
"vt 0.32 0.45\n"
|
|
"vt 0.32 0.55\n"
|
|
"vt 0.32 0.65\n"
|
|
"vt 0.22 0.65\n"
|
|
"vt 0.12 0.65\n"
|
|
"vt 0.02 0.65\n"
|
|
"vt 0.02 0.55\n"
|
|
"vt 0.02 0.45\n"
|
|
"vt 0.12 0.45\n"
|
|
"vt 0.22 0.45\n"
|
|
"vt 0.22 0.55\n"
|
|
"vt 0.12 0.55\n"
|
|
"\n"
|
|
"f 55/63 56/64 67/75 66/74\n"
|
|
"f 56/64 57/65 67/76 67/75\n"
|
|
"f 57/65 58/66 59/67 67/76\n"
|
|
"f 67/76 59/67 60/68 68/77\n"
|
|
"f 68/77 60/68 61/69 62/70\n"
|
|
"f 68/78 68/77 62/70 63/71\n"
|
|
"f 65/73 68/78 63/71 64/72\n"
|
|
"f 66/74 67/75 68/78 65/73\n"
|
|
"\n"
|
|
"f 67/75 67/76 68/77 68/78\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 5: center-middle\n"
|
|
"#\n"
|
|
"v -0.50 0.00 -0.50\n"
|
|
"v -0.17 0.00 -0.50\n"
|
|
"v 0.17 0.00 -0.50\n"
|
|
"v 0.50 0.00 -0.50\n"
|
|
"v 0.50 0.00 -0.17\n"
|
|
"v 0.50 0.00 0.17\n"
|
|
"v 0.50 0.00 0.50\n"
|
|
"v 0.17 0.00 0.50\n"
|
|
"v -0.17 0.00 0.50\n"
|
|
"v -0.50 0.00 0.50\n"
|
|
"v -0.50 0.00 0.17\n"
|
|
"v -0.50 0.00 -0.17\n"
|
|
"v 0.00 -0.30 -0.17\n"
|
|
"v -0.17 -0.30 0.17\n"
|
|
"\n"
|
|
"vt 0.35 0.35\n"
|
|
"vt 0.45 0.35\n"
|
|
"vt 0.55 0.35\n"
|
|
"vt 0.65 0.35\n"
|
|
"vt 0.65 0.45\n"
|
|
"vt 0.65 0.55\n"
|
|
"vt 0.65 0.65\n"
|
|
"vt 0.55 0.65\n"
|
|
"vt 0.45 0.65\n"
|
|
"vt 0.35 0.65\n"
|
|
"vt 0.35 0.55\n"
|
|
"vt 0.35 0.45\n"
|
|
"vt 0.45 0.45\n"
|
|
"vt 0.55 0.45\n"
|
|
"vt 0.55 0.55\n"
|
|
"vt 0.45 0.55\n"
|
|
"\n"
|
|
"f 69/79 70/80 81/91 80/90\n"
|
|
"f 70/80 71/81 81/92 81/91\n"
|
|
"f 71/81 72/82 73/83 81/92\n"
|
|
"f 81/92 73/83 74/84 81/93\n"
|
|
"f 81/93 74/84 75/85 76/86\n"
|
|
"f 82/94 81/93 76/86 77/87\n"
|
|
"f 79/89 82/94 77/87 78/88\n"
|
|
"f 80/90 81/91 82/94 79/89\n"
|
|
"\n"
|
|
"f 81/91 81/92 81/93 82/94\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 6: center-right\n"
|
|
"#\n"
|
|
"v 0.75 0.00 -0.50\n"
|
|
"v 1.08 0.00 -0.50\n"
|
|
"v 1.42 0.00 -0.50\n"
|
|
"v 1.75 0.00 -0.50\n"
|
|
"v 1.75 0.00 -0.17\n"
|
|
"v 1.75 0.00 0.17\n"
|
|
"v 1.75 0.00 0.50\n"
|
|
"v 1.42 0.00 0.50\n"
|
|
"v 1.08 0.00 0.50\n"
|
|
"v 0.75 0.00 0.50\n"
|
|
"v 0.75 0.00 0.17\n"
|
|
"v 0.75 0.00 -0.17\n"
|
|
"v 1.25 -0.40 0.00\n"
|
|
"v 1.42 -0.20 -0.17\n"
|
|
"v 1.08 -0.20 0.17\n"
|
|
"\n"
|
|
"vt 0.68 0.35\n"
|
|
"vt 0.78 0.35\n"
|
|
"vt 0.88 0.35\n"
|
|
"vt 0.98 0.35\n"
|
|
"vt 0.98 0.45\n"
|
|
"vt 0.98 0.55\n"
|
|
"vt 0.98 0.65\n"
|
|
"vt 0.88 0.65\n"
|
|
"vt 0.78 0.65\n"
|
|
"vt 0.68 0.65\n"
|
|
"vt 0.68 0.55\n"
|
|
"vt 0.68 0.45\n"
|
|
"vt 0.78 0.45\n"
|
|
"vt 0.88 0.45\n"
|
|
"vt 0.88 0.55\n"
|
|
"vt 0.78 0.55\n"
|
|
"\n"
|
|
"f 83/95 84/96 95/107 94/106\n"
|
|
"f 84/96 85/97 96/108 95/107\n"
|
|
"f 85/97 86/98 87/99 96/108\n"
|
|
"f 96/108 87/99 88/100 95/109\n"
|
|
"f 95/109 88/100 89/101 90/102\n"
|
|
"f 97/110 95/109 90/102 91/103\n"
|
|
"f 93/105 97/110 91/103 92/104\n"
|
|
"f 94/106 95/107 97/110 93/105\n"
|
|
"\n"
|
|
"f 95/107 96/108 95/109 97/110\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 7: bottom-left\n"
|
|
"#\n"
|
|
"v -1.75 0.00 -1.75\n"
|
|
"v -1.42 0.00 -1.75\n"
|
|
"v -1.08 0.00 -1.75\n"
|
|
"v -0.75 0.00 -1.75\n"
|
|
"v -0.75 0.00 -1.42\n"
|
|
"v -0.75 0.00 -1.08\n"
|
|
"v -0.75 0.00 -0.75\n"
|
|
"v -1.08 0.00 -0.75\n"
|
|
"v -1.42 0.00 -0.75\n"
|
|
"v -1.75 0.00 -0.75\n"
|
|
"v -1.75 0.00 -1.08\n"
|
|
"v -1.75 0.00 -1.42\n"
|
|
"v -1.25 -0.30 -1.25\n"
|
|
"\n"
|
|
"vt 0.02 0.02\n"
|
|
"vt 0.12 0.02\n"
|
|
"vt 0.22 0.02\n"
|
|
"vt 0.32 0.02\n"
|
|
"vt 0.32 0.12\n"
|
|
"vt 0.32 0.22\n"
|
|
"vt 0.32 0.32\n"
|
|
"vt 0.22 0.32\n"
|
|
"vt 0.12 0.32\n"
|
|
"vt 0.02 0.32\n"
|
|
"vt 0.02 0.22\n"
|
|
"vt 0.02 0.12\n"
|
|
"vt 0.12 0.12\n"
|
|
"vt 0.22 0.12\n"
|
|
"vt 0.22 0.22\n"
|
|
"vt 0.12 0.22\n"
|
|
"\n"
|
|
"f 98/111 99/112 110/123 109/122\n"
|
|
"f 99/112 100/113 110/124 110/123\n"
|
|
"f 100/113 101/114 102/115 110/124\n"
|
|
"f 110/124 102/115 103/116 110/125\n"
|
|
"f 110/125 103/116 104/117 105/118\n"
|
|
"f 110/126 110/125 105/118 106/119\n"
|
|
"f 108/121 110/126 106/119 107/120\n"
|
|
"f 109/122 110/123 110/126 108/121\n"
|
|
"\n"
|
|
"f 110/123 110/124 110/125 110/126\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 8: bottom-middle\n"
|
|
"#\n"
|
|
"v -0.50 0.00 -1.75\n"
|
|
"v -0.17 0.00 -1.75\n"
|
|
"v 0.17 0.00 -1.75\n"
|
|
"v 0.50 0.00 -1.75\n"
|
|
"v 0.50 0.00 -1.42\n"
|
|
"v 0.50 0.00 -1.08\n"
|
|
"v 0.50 0.00 -0.75\n"
|
|
"v 0.17 0.00 -0.75\n"
|
|
"v -0.17 0.00 -0.75\n"
|
|
"v -0.50 0.00 -0.75\n"
|
|
"v -0.50 0.00 -1.08\n"
|
|
"v -0.50 0.00 -1.42\n"
|
|
"v -0.17 -0.30 -1.42\n"
|
|
"v 0.17 -0.30 -1.42\n"
|
|
"v 0.17 -0.30 -1.08\n"
|
|
"v -0.17 -0.30 -1.08\n"
|
|
"\n"
|
|
"vt 0.35 0.02\n"
|
|
"vt 0.45 0.02\n"
|
|
"vt 0.55 0.02\n"
|
|
"vt 0.65 0.02\n"
|
|
"vt 0.65 0.12\n"
|
|
"vt 0.65 0.22\n"
|
|
"vt 0.65 0.32\n"
|
|
"vt 0.55 0.32\n"
|
|
"vt 0.45 0.32\n"
|
|
"vt 0.35 0.32\n"
|
|
"vt 0.35 0.22\n"
|
|
"vt 0.35 0.12\n"
|
|
"vt 0.45 0.12\n"
|
|
"vt 0.55 0.12\n"
|
|
"vt 0.55 0.22\n"
|
|
"vt 0.45 0.22\n"
|
|
"\n"
|
|
"f 111/127 112/128 123/139 122/138\n"
|
|
"f 112/128 113/129 124/140 123/139\n"
|
|
"f 113/129 114/130 115/131 124/140\n"
|
|
"f 124/140 115/131 116/132 125/141\n"
|
|
"f 125/141 116/132 117/133 118/134\n"
|
|
"f 126/142 125/141 118/134 119/135\n"
|
|
"f 121/137 126/142 119/135 120/136\n"
|
|
"f 122/138 123/139 126/142 121/137\n"
|
|
"\n"
|
|
"f 126/142 125/141 124/140 123/139\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 9: bottom-right\n"
|
|
"#\n"
|
|
"v 1.2500 -0.5000 -1.45\n"
|
|
"v 1.6035 -0.3535 -1.45\n"
|
|
"v 1.7500 0.0000 -1.45\n"
|
|
"v 1.6035 0.3535 -1.45\n"
|
|
"v 1.2500 0.5000 -1.45\n"
|
|
"v 0.8965 0.3535 -1.45\n"
|
|
"v 0.7500 0.0000 -1.45\n"
|
|
"v 0.8965 -0.3535 -1.45\n"
|
|
"v 1.2500 -0.5000 -1.05\n"
|
|
"v 1.6035 -0.3535 -1.05\n"
|
|
"v 1.7500 0.0000 -1.05\n"
|
|
"v 1.6035 0.3535 -1.05\n"
|
|
"v 1.2500 0.5000 -1.05\n"
|
|
"v 0.8965 0.3535 -1.05\n"
|
|
"v 0.7500 0.0000 -1.05\n"
|
|
"v 0.8965 -0.3535 -1.05\n"
|
|
"\n"
|
|
"vt 0.8300 0.0450\n"
|
|
"vt 0.9184 0.0816\n"
|
|
"vt 0.9550 0.1700\n"
|
|
"vt 0.9184 0.2584\n"
|
|
"vt 0.8300 0.2950\n"
|
|
"vt 0.7416 0.2584\n"
|
|
"vt 0.7050 0.1700\n"
|
|
"vt 0.7416 0.0816\n"
|
|
"vt 0.8300 0.1075\n"
|
|
"vt 0.8742 0.1258\n"
|
|
"vt 0.8925 0.1700\n"
|
|
"vt 0.8742 0.2142\n"
|
|
"vt 0.8300 0.2325\n"
|
|
"vt 0.7858 0.2142\n"
|
|
"vt 0.7675 0.1700\n"
|
|
"vt 0.7858 0.1258\n"
|
|
"\n"
|
|
"f 127/143 135/151 136/152 128/144\n"
|
|
"f 128/144 136/152 137/153 129/145\n"
|
|
"f 129/145 137/153 138/154 130/146\n"
|
|
"f 130/146 138/154 139/155 131/147\n"
|
|
"f 131/147 132/148 140/156 139/155\n"
|
|
"f 132/148 133/149 141/157 140/156\n"
|
|
"f 133/149 134/150 142/158 141/157\n"
|
|
"f 134/150 127/143 135/151 142/158\n"
|
|
"\n"
|
|
"t interpolateboundary 1/0/0 1\n"
|
|
"\n"
|
|
;
|