mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2025-01-09 00:00:18 +00:00
33ff2ec2f5
- added cases for x-ord boundaries and interior to match Loop - added cases for valence-2 interior and non-quad faces - updated all.h for the new additions
323 lines
7.0 KiB
C++
323 lines
7.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 catmark_val2_interior =
|
|
"#\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 0.75\n"
|
|
"v -1.42 0.0 0.75\n"
|
|
"v -1.08 0.0 0.75\n"
|
|
"v -0.75 0.0 0.75\n"
|
|
"v -0.75 0.0 1.08\n"
|
|
"v -0.75 0.0 1.42\n"
|
|
"v -0.75 0.0 1.75\n"
|
|
"v -1.08 0.0 1.75\n"
|
|
"v -1.42 0.0 1.75\n"
|
|
"v -1.75 0.0 1.75\n"
|
|
"v -1.75 0.0 1.42\n"
|
|
"v -1.75 0.0 1.08\n"
|
|
"v -1.42 0.0 1.08\n"
|
|
"v -1.08 0.0 1.08\n"
|
|
"v -1.08 0.0 1.42\n"
|
|
"v -1.42 0.0 1.42\n"
|
|
"v -1.25 -0.5 1.25\n"
|
|
"\n"
|
|
"vt -0.5 -0.5\n"
|
|
"vt -0.17 -0.5\n"
|
|
"vt 0.17 -0.5\n"
|
|
"vt 0.5 -0.5\n"
|
|
"vt 0.5 -0.17\n"
|
|
"vt 0.5 0.17\n"
|
|
"vt 0.5 0.5\n"
|
|
"vt 0.17 0.5\n"
|
|
"vt -0.17 0.5\n"
|
|
"vt -0.5 0.5\n"
|
|
"vt -0.5 0.17\n"
|
|
"vt -0.5 -0.17\n"
|
|
"vt -0.17 -0.17\n"
|
|
"vt 0.17 -0.17\n"
|
|
"vt 0.17 0.17\n"
|
|
"vt -0.17 0.17\n"
|
|
"vt 0.0 0.0 \n"
|
|
"\n"
|
|
"f 1/1 2/2 13/13 12/12\n"
|
|
"f 2/2 3/3 14/14 13/13\n"
|
|
"f 3/3 4/4 5/5 14/14\n"
|
|
"f 14/14 5/5 6/6 15/15\n"
|
|
"f 15/15 6/6 7/7 8/8\n"
|
|
"f 16/16 15/15 8/8 9/9\n"
|
|
"f 11/11 16/16 9/9 10/10\n"
|
|
"f 12/12 13/13 16/16 11/11\n"
|
|
"f 13/13 14/14 15/15 17/17\n"
|
|
"f 13/13 17/17 15/15 16/16\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 2: top-middle\n"
|
|
"#\n"
|
|
"v 0.0 -0.5 1.25\n"
|
|
"v 0.25 0.0 1.5\n"
|
|
"v -0.25 0.0 1.5\n"
|
|
"v -0.25 0.0 1.0\n"
|
|
"v 0.25 0.0 1.0\n"
|
|
"v 0.5 0.0 1.75\n"
|
|
"v -0.25 0.0 1.75\n"
|
|
"v -0.5 0.0 1.75\n"
|
|
"v -0.5 0.0 1.5\n"
|
|
"v -0.5 0.0 0.75\n"
|
|
"v 0.25 0.0 0.75\n"
|
|
"v 0.5 0.0 0.75\n"
|
|
"v 0.5 0.0 1.0\n"
|
|
"\n"
|
|
"vt 0 0\n"
|
|
"vt 0.25 0.25\n"
|
|
"vt -0.25 0.25\n"
|
|
"vt -0.25 -0.25\n"
|
|
"vt 0.25 -0.25\n"
|
|
"vt 0.5 0.5\n"
|
|
"vt -0.25 0.5\n"
|
|
"vt -0.5 0.5\n"
|
|
"vt -0.5 0.25\n"
|
|
"vt -0.5 -0.5\n"
|
|
"vt 0.25 -0.5\n"
|
|
"vt 0.5 -0.5\n"
|
|
"vt 0.5 -0.25\n"
|
|
"\n"
|
|
"f 18/18 19/19 20/20 21/21\n"
|
|
"f 18/18 21/21 22/22 19/19\n"
|
|
"f 19/19 23/23 24/24 20/20\n"
|
|
"f 20/20 24/24 25/25 26/26\n"
|
|
"f 20/20 26/26 27/27 21/21\n"
|
|
"f 21/21 27/27 28/28 22/22\n"
|
|
"f 22/22 28/28 29/29 30/30\n"
|
|
"f 22/22 30/30 23/23 19/19\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 3: top-right\n"
|
|
"#\n"
|
|
"v 1.25 -0.5 1.25\n"
|
|
"v 1.50 0.0 1.5 \n"
|
|
"v 1.0 0.0 1.5 \n"
|
|
"v 1.0 0.0 1.0 \n"
|
|
"v 1.5 0.0 1.0 \n"
|
|
"v 1.75 0.0 1.75\n"
|
|
"v 1.0 0.0 1.75\n"
|
|
"v 0.75 0.0 1.75\n"
|
|
"v 0.75 0.0 1.5 \n"
|
|
"v 0.75 0.0 0.75\n"
|
|
"v 1.5 0.0 0.75\n"
|
|
"v 1.75 0.0 0.75\n"
|
|
"v 1.75 0.0 1.0 \n"
|
|
"\n"
|
|
"vt 0 0\n"
|
|
"vt 0.25 0.25\n"
|
|
"vt -0.25 0.25\n"
|
|
"vt -0.25 -0.25\n"
|
|
"vt 0.25 -0.25\n"
|
|
"vt 0.5 0.5\n"
|
|
"vt -0.25 0.5\n"
|
|
"vt -0.5 0.5\n"
|
|
"vt -0.5 0.25\n"
|
|
"vt -0.5 -0.5\n"
|
|
"vt 0.25 -0.5\n"
|
|
"vt 0.5 -0.5\n"
|
|
"vt 0.5 -0.25\n"
|
|
"\n"
|
|
"f 31/31 32/32 33/33 34/34\n"
|
|
"f 31/31 34/34 35/35 32/32\n"
|
|
"f 32/32 36/36 37/37 33/33\n"
|
|
"f 33/33 37/37 38/38 39/39\n"
|
|
"f 33/33 39/39 40/40 34/34\n"
|
|
"f 34/34 40/40 41/41 35/35\n"
|
|
"f 35/35 41/41 42/42 43/43\n"
|
|
"f 35/35 43/43 36/36 32/32\n"
|
|
"\n"
|
|
"t crease 2/1/0 30 31 10.0\n"
|
|
"t crease 2/1/0 31 35 10.0\n"
|
|
"t crease 2/1/0 30 33 10.0\n"
|
|
"t crease 2/1/0 33 39 10.0\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 4: center-left\n"
|
|
"#\n"
|
|
"v -1.75 0.0 -0.5\n"
|
|
"v -1.08 0.0 -0.5\n"
|
|
"v -0.75 0.0 -0.5\n"
|
|
"v -1.42 -0.5 -0.17\n"
|
|
"v -1.75 0.0 0.17\n"
|
|
"v -1.08 0.0 0.17\n"
|
|
"v -1.75 0.0 0.5\n"
|
|
"v -0.75 0.0 0.5\n"
|
|
"\n"
|
|
"vt -1.75 -0.5\n"
|
|
"vt -1.08 -0.5\n"
|
|
"vt -0.75 -0.5\n"
|
|
"vt -1.42 -0.17\n"
|
|
"vt -1.75 0.17\n"
|
|
"vt -1.08 0.17\n"
|
|
"vt -1.75 0.5\n"
|
|
"vt -0.75 0.5\n"
|
|
"\n"
|
|
"f 44/44 45/45 49/49 47/47\n"
|
|
"f 45/45 46/46 51/51 49/49\n"
|
|
"f 44/44 47/47 49/49 48/48\n"
|
|
"f 48/48 49/49 51/51 50/50\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 5: center-middle\n"
|
|
"#\n"
|
|
"v -0.5 0.0 -0.5\n"
|
|
"v 0.0 0.0 -0.5\n"
|
|
"v 0.5 0.0 -0.5\n"
|
|
"v -0.5 0.0 0.0\n"
|
|
"v 0.0 0.0 0.0\n"
|
|
"v 0.5 0.0 0.0\n"
|
|
"v -0.5 0.0 0.5\n"
|
|
"v 0.0 0.0 0.5\n"
|
|
"v 0.5 0.0 0.5\n"
|
|
"v -0.1 0.1 -0.1\n"
|
|
"\n"
|
|
"vt -0.5 -0.5\n"
|
|
"vt 0.0 -0.5\n"
|
|
"vt 0.5 -0.5\n"
|
|
"vt -0.5 0.0\n"
|
|
"vt 0.0 0.0\n"
|
|
"vt 0.5 0.0\n"
|
|
"vt -0.5 0.5\n"
|
|
"vt 0.0 0.5\n"
|
|
"vt 0.5 0.5\n"
|
|
"vt -0.1 -0.1\n"
|
|
"\n"
|
|
"f 52/52 53/53 56/56 55/55\n"
|
|
"f 53/53 54/54 57/57 56/56\n"
|
|
"f 55/55 56/56 59/59 58/58\n"
|
|
"f 56/56 57/57 60/60 59/59\n"
|
|
"f 53/53 52/52 55/55 61/61\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 6: center-right\n"
|
|
"#\n"
|
|
"v 0.75 0.0 -0.5\n"
|
|
"v 1.75 0.0 -0.5\n"
|
|
"v 1.75 0.0 0.5\n"
|
|
"v 0.75 0.0 0.5\n"
|
|
"\n"
|
|
"vt 0.75 -0.5\n"
|
|
"vt 1.75 -0.5\n"
|
|
"vt 1.75 0.5\n"
|
|
"vt 0.75 0.5\n"
|
|
"\n"
|
|
"f 62/62 63/63 64/64 65/65\n"
|
|
"f 62/62 65/65 64/64 63/63\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 7: bottom-left\n"
|
|
"#\n"
|
|
"v -1.75 0.0 -1.75\n"
|
|
"v -1.25 0.0 -1.75\n"
|
|
"v -0.75 0.0 -1.75\n"
|
|
"v -1.25 -0.5 -1.25\n"
|
|
"v -1.75 0.0 -0.75\n"
|
|
"v -1.25 0.0 -0.75\n"
|
|
"v -0.75 0.0 -0.75\n"
|
|
"\n"
|
|
"vt -0.5 -0.5\n"
|
|
"vt 0.0 -0.5\n"
|
|
"vt 0.5 -0.5\n"
|
|
"vt 0.0 0.0\n"
|
|
"vt -0.5 0.5\n"
|
|
"vt 0.0 0.5\n"
|
|
"vt 0.5 0.5\n"
|
|
"\n"
|
|
"f 66/66 67/67 69/69 71/71 70/70\n"
|
|
"f 67/67 68/68 72/72 71/71 69/69\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 8: bottom-middle\n"
|
|
"#\n"
|
|
"v -0.5 0.0 -1.75\n"
|
|
"v 0.0 0.0 -1.75\n"
|
|
"v 0.0 -0.5 -1.75\n"
|
|
"v 0.5 0.0 -1.75\n"
|
|
"v -0.5 0.0 -0.75\n"
|
|
"v 0.0 0.0 -0.75\n"
|
|
"v 0.0 -0.5 -0.75\n"
|
|
"v 0.5 0.0 -0.75\n"
|
|
"\n"
|
|
"vt -0.5 -0.5\n"
|
|
"vt 0.0 -0.5\n"
|
|
"vt 0.0 -0.5\n"
|
|
"vt 0.5 -0.5\n"
|
|
"vt -0.5 0.5\n"
|
|
"vt 0.0 0.5\n"
|
|
"vt 0.0 0.5\n"
|
|
"vt 0.5 0.5\n"
|
|
"\n"
|
|
"f 73/73 74/74 75/75 79/79 78/78 77/77\n"
|
|
"f 80/80 78/78 79/79 75/75 74/74 76/76\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 9: bottom-right\n"
|
|
"#\n"
|
|
"v 1.75 -0.5 -0.75\n"
|
|
"v 1.25 -1.0 -0.75\n"
|
|
"v 0.75 -0.5 -0.75\n"
|
|
"v 1.75 -0.5 -1.75\n"
|
|
"v 0.75 -0.5 -1.75\n"
|
|
"v 1.75 0.5 -1.75\n"
|
|
"v 0.75 0.5 -1.75\n"
|
|
"v 1.75 0.5 -0.75\n"
|
|
"v 0.75 0.5 -0.75\n"
|
|
"\n"
|
|
"vt 0.375 0.000\n"
|
|
"vt 0.500 0.000\n"
|
|
"vt 0.625 0.000\n"
|
|
"vt 0.375 0.250\n"
|
|
"vt 0.625 0.250\n"
|
|
"vt 0.375 0.500\n"
|
|
"vt 0.625 0.500\n"
|
|
"vt 0.375 0.750\n"
|
|
"vt 0.500 0.750\n"
|
|
"vt 0.625 0.750\n"
|
|
"vt 0.375 1.000\n"
|
|
"vt 0.500 1.000\n"
|
|
"vt 0.625 1.000\n"
|
|
"vt 0.875 0.000\n"
|
|
"vt 0.875 0.250\n"
|
|
"vt 0.125 0.000\n"
|
|
"vt 0.125 0.250\n"
|
|
"\n"
|
|
"f 84/84 81/81 82/82 83/83 85/85\n"
|
|
"f 86/86 84/84 85/85 87/87\n"
|
|
"f 88/88 86/86 87/87 89/89\n"
|
|
"f 82/92 81/91 88/88 89/89 83/93\n"
|
|
"f 83/83 89/94 87/95 85/85\n"
|
|
"f 88/96 81/81 84/84 86/97\n"
|
|
"\n"
|
|
"t interpolateboundary 1/0/0 1\n"
|
|
"\n"
|
|
;
|