mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-11-13 23:50:09 +00:00
3c9673c447
- updated the edge-only and edge-corner shapes consistent with Catmark - moved the existing triangulated cube to loop_cube_asymmetric - added new loop_cube with symmetric triangulation and limit surface - added semi-sharp and inf-sharp variations of cube and icosahedron - added shapes with extra-ordinary interior and boundary vertices - added shapes with face-varying features similar to Catmark
292 lines
7.8 KiB
C++
292 lines
7.8 KiB
C++
//
|
|
// Copyright 2018 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_icos_semisharp =
|
|
"#\n"
|
|
"# Four shapes ordered left->right and top->bottom in the XZ and UV planes\n"
|
|
"#\n"
|
|
"# Shape 1: top-left\n"
|
|
"#\n"
|
|
"v -0.112012 0.000000 0.355702\n"
|
|
"v -0.112012 0.000000 1.144298\n"
|
|
"v -1.387988 0.000000 1.144298\n"
|
|
"v -1.387988 0.000000 0.355702\n"
|
|
"v -0.750000 -0.394298 1.387988\n"
|
|
"v -0.750000 0.394298 1.387988\n"
|
|
"v -0.750000 0.394298 0.112012\n"
|
|
"v -0.750000 -0.394298 0.112012\n"
|
|
"v -1.144298 -0.637988 0.750000\n"
|
|
"v -0.355702 -0.637988 0.750000\n"
|
|
"v -0.355702 0.637988 0.750000\n"
|
|
"v -1.144298 0.637988 0.750000\n"
|
|
"\n"
|
|
"vt 0.413636 0.783333\n"
|
|
"vt 0.377273 0.850000\n"
|
|
"vt 0.340909 0.783333\n"
|
|
"vt 0.377273 0.716667\n"
|
|
"vt 0.268182 0.783333\n"
|
|
"vt 0.304546 0.716667\n"
|
|
"vt 0.304546 0.850000\n"
|
|
"vt 0.122727 0.783333\n"
|
|
"vt 0.050000 0.783333\n"
|
|
"vt 0.086364 0.716667\n"
|
|
"vt 0.086364 0.850000\n"
|
|
"vt 0.450000 0.716667\n"
|
|
"vt 0.231818 0.716667\n"
|
|
"vt 0.195454 0.783333\n"
|
|
"vt 0.159091 0.716667\n"
|
|
"vt 0.195454 0.650000\n"
|
|
"vt 0.122727 0.650000\n"
|
|
"vt 0.268182 0.650000\n"
|
|
"vt 0.159091 0.850000\n"
|
|
"vt 0.413636 0.650000\n"
|
|
"vt 0.340909 0.650000\n"
|
|
"vt 0.231818 0.850000\n"
|
|
"\n"
|
|
"f 2/1 10/2 1/3 \n"
|
|
"f 1/3 11/4 2/1 \n"
|
|
"f 1/3 8/5 7/6 \n"
|
|
"f 1/3 7/6 11/4 \n"
|
|
"f 1/3 10/7 8/5 \n"
|
|
"f 5/8 2/9 6/10 \n"
|
|
"f 10/11 2/9 5/8 \n"
|
|
"f 2/1 11/4 6/12 \n"
|
|
"f 4/13 9/14 3/15 \n"
|
|
"f 3/15 12/16 4/13 \n"
|
|
"f 5/8 6/10 3/15 \n"
|
|
"f 3/15 9/14 5/8 \n"
|
|
"f 6/10 12/17 3/15 \n"
|
|
"f 7/6 8/5 4/13 \n"
|
|
"f 4/13 12/18 7/6 \n"
|
|
"f 4/13 8/5 9/14 \n"
|
|
"f 5/8 9/14 10/19 \n"
|
|
"f 6/12 11/4 12/20 \n"
|
|
"f 7/6 12/21 11/4 \n"
|
|
"f 8/5 10/22 9/14 \n"
|
|
"\n"
|
|
"t corner 1/1/0 4 2.5\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 2: top-right\n"
|
|
"#\n"
|
|
"v 1.387988 0.000000 0.355702\n"
|
|
"v 1.387988 0.000000 1.144298\n"
|
|
"v 0.112012 0.000000 1.144298\n"
|
|
"v 0.112012 0.000000 0.355702\n"
|
|
"v 0.750000 -0.394298 1.387988\n"
|
|
"v 0.750000 0.394298 1.387988\n"
|
|
"v 0.750000 0.394298 0.112012\n"
|
|
"v 0.750000 -0.394298 0.112012\n"
|
|
"v 0.355702 -0.637988 0.750000\n"
|
|
"v 1.144298 -0.637988 0.750000\n"
|
|
"v 1.144298 0.637988 0.750000\n"
|
|
"v 0.355702 0.637988 0.750000\n"
|
|
"\n"
|
|
"vt 0.913636 0.783333\n"
|
|
"vt 0.877273 0.850000\n"
|
|
"vt 0.840909 0.783333\n"
|
|
"vt 0.877273 0.716667\n"
|
|
"vt 0.768182 0.783333\n"
|
|
"vt 0.804546 0.716667\n"
|
|
"vt 0.804546 0.850000\n"
|
|
"vt 0.622727 0.783333\n"
|
|
"vt 0.550000 0.783333\n"
|
|
"vt 0.586364 0.716667\n"
|
|
"vt 0.586364 0.850000\n"
|
|
"vt 0.950000 0.716667\n"
|
|
"vt 0.731818 0.716667\n"
|
|
"vt 0.695454 0.783333\n"
|
|
"vt 0.659091 0.716667\n"
|
|
"vt 0.695454 0.650000\n"
|
|
"vt 0.622727 0.650000\n"
|
|
"vt 0.768182 0.650000\n"
|
|
"vt 0.659091 0.850000\n"
|
|
"vt 0.913636 0.650000\n"
|
|
"vt 0.840909 0.650000\n"
|
|
"vt 0.731818 0.850000\n"
|
|
"\n"
|
|
"f 14/23 22/24 13/25 \n"
|
|
"f 13/25 23/26 14/23 \n"
|
|
"f 13/25 20/27 19/28 \n"
|
|
"f 13/25 19/28 23/26 \n"
|
|
"f 13/25 22/29 20/27 \n"
|
|
"f 17/30 14/31 18/32 \n"
|
|
"f 22/33 14/31 17/30 \n"
|
|
"f 14/23 23/26 18/34 \n"
|
|
"f 16/35 21/36 15/37 \n"
|
|
"f 15/37 24/38 16/35 \n"
|
|
"f 17/30 18/32 15/37 \n"
|
|
"f 15/37 21/36 17/30 \n"
|
|
"f 18/32 24/39 15/37 \n"
|
|
"f 19/28 20/27 16/35 \n"
|
|
"f 16/35 24/40 19/28 \n"
|
|
"f 16/35 20/27 21/36 \n"
|
|
"f 17/30 21/36 22/41 \n"
|
|
"f 18/34 23/26 24/42 \n"
|
|
"f 19/28 24/43 23/26 \n"
|
|
"f 20/27 22/44 21/36 \n"
|
|
"\n"
|
|
"t corner 1/1/0 16 4.5\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 3: bottom-left\n"
|
|
"#\n"
|
|
"v -0.112012 0.000000 -1.144298\n"
|
|
"v -0.112012 0.000000 -0.355702\n"
|
|
"v -1.387988 0.000000 -0.355702\n"
|
|
"v -1.387988 0.000000 -1.144298\n"
|
|
"v -0.750000 -0.394298 -0.112012\n"
|
|
"v -0.750000 0.394298 -0.112012\n"
|
|
"v -0.750000 0.394298 -1.387988\n"
|
|
"v -0.750000 -0.394298 -1.387988\n"
|
|
"v -1.144298 -0.637988 -0.750000\n"
|
|
"v -0.355702 -0.637988 -0.750000\n"
|
|
"v -0.355702 0.637988 -0.750000\n"
|
|
"v -1.144298 0.637988 -0.750000\n"
|
|
"\n"
|
|
"vt 0.413636 0.283333\n"
|
|
"vt 0.377273 0.350000\n"
|
|
"vt 0.340909 0.283333\n"
|
|
"vt 0.377273 0.216667\n"
|
|
"vt 0.268182 0.283333\n"
|
|
"vt 0.304546 0.216667\n"
|
|
"vt 0.304546 0.350000\n"
|
|
"vt 0.122727 0.283333\n"
|
|
"vt 0.050000 0.283333\n"
|
|
"vt 0.086364 0.216667\n"
|
|
"vt 0.086364 0.350000\n"
|
|
"vt 0.450000 0.216667\n"
|
|
"vt 0.231818 0.216667\n"
|
|
"vt 0.195454 0.283333\n"
|
|
"vt 0.159091 0.216667\n"
|
|
"vt 0.195454 0.150000\n"
|
|
"vt 0.122727 0.150000\n"
|
|
"vt 0.268182 0.150000\n"
|
|
"vt 0.159091 0.350000\n"
|
|
"vt 0.413636 0.150000\n"
|
|
"vt 0.340909 0.150000\n"
|
|
"vt 0.231818 0.350000\n"
|
|
"\n"
|
|
"f 26/45 34/46 25/47 \n"
|
|
"f 25/47 35/48 26/45 \n"
|
|
"f 25/47 32/49 31/50 \n"
|
|
"f 25/47 31/50 35/48 \n"
|
|
"f 25/47 34/51 32/49 \n"
|
|
"f 29/52 26/53 30/54 \n"
|
|
"f 34/55 26/53 29/52 \n"
|
|
"f 26/45 35/48 30/56 \n"
|
|
"f 28/57 33/58 27/59 \n"
|
|
"f 27/59 36/60 28/57 \n"
|
|
"f 29/52 30/54 27/59 \n"
|
|
"f 27/59 33/58 29/52 \n"
|
|
"f 30/54 36/61 27/59 \n"
|
|
"f 31/50 32/49 28/57 \n"
|
|
"f 28/57 36/62 31/50 \n"
|
|
"f 28/57 32/49 33/58 \n"
|
|
"f 29/52 33/58 34/63 \n"
|
|
"f 30/56 35/48 36/64 \n"
|
|
"f 31/50 36/65 35/48 \n"
|
|
"f 32/49 34/66 33/58 \n"
|
|
"\n"
|
|
"t crease 2/1/0 25 29 4.5\n"
|
|
"t crease 2/1/0 29 26 4.5\n"
|
|
"t crease 2/1/0 26 32 4.5\n"
|
|
"t crease 2/1/0 32 33 4.5\n"
|
|
"t crease 2/1/0 33 25 4.5\n"
|
|
"\n"
|
|
"#\n"
|
|
"# Shape 4: bottom-right\n"
|
|
"#\n"
|
|
"v 1.387988 0.000000 -1.144298\n"
|
|
"v 1.387988 0.000000 -0.355702\n"
|
|
"v 0.112012 0.000000 -0.355702\n"
|
|
"v 0.112012 0.000000 -1.144298\n"
|
|
"v 0.750000 -0.394298 -0.112012\n"
|
|
"v 0.750000 0.394298 -0.112012\n"
|
|
"v 0.750000 0.394298 -1.387988\n"
|
|
"v 0.750000 -0.394298 -1.387988\n"
|
|
"v 0.355702 -0.637988 -0.750000\n"
|
|
"v 1.144298 -0.637988 -0.750000\n"
|
|
"v 1.144298 0.637988 -0.750000\n"
|
|
"v 0.355702 0.637988 -0.750000\n"
|
|
"\n"
|
|
"vt 0.913636 0.283333\n"
|
|
"vt 0.877273 0.350000\n"
|
|
"vt 0.840909 0.283333\n"
|
|
"vt 0.877273 0.216667\n"
|
|
"vt 0.768182 0.283333\n"
|
|
"vt 0.804546 0.216667\n"
|
|
"vt 0.804546 0.350000\n"
|
|
"vt 0.622727 0.283333\n"
|
|
"vt 0.550000 0.283333\n"
|
|
"vt 0.586364 0.216667\n"
|
|
"vt 0.586364 0.350000\n"
|
|
"vt 0.950000 0.216667\n"
|
|
"vt 0.731818 0.216667\n"
|
|
"vt 0.695454 0.283333\n"
|
|
"vt 0.659091 0.216667\n"
|
|
"vt 0.695454 0.150000\n"
|
|
"vt 0.622727 0.150000\n"
|
|
"vt 0.768182 0.150000\n"
|
|
"vt 0.659091 0.350000\n"
|
|
"vt 0.913636 0.150000\n"
|
|
"vt 0.840909 0.150000\n"
|
|
"vt 0.731818 0.350000\n"
|
|
"\n"
|
|
"f 38/67 46/68 37/69 \n"
|
|
"f 37/69 47/70 38/67 \n"
|
|
"f 37/69 44/71 43/72 \n"
|
|
"f 37/69 43/72 47/70 \n"
|
|
"f 37/69 46/73 44/71 \n"
|
|
"f 41/74 38/75 42/76 \n"
|
|
"f 46/77 38/75 41/74 \n"
|
|
"f 38/67 47/70 42/78 \n"
|
|
"f 40/79 45/80 39/81 \n"
|
|
"f 39/81 48/82 40/79 \n"
|
|
"f 41/74 42/76 39/81 \n"
|
|
"f 39/81 45/80 41/74 \n"
|
|
"f 42/76 48/83 39/81 \n"
|
|
"f 43/72 44/71 40/79 \n"
|
|
"f 40/79 48/84 43/72 \n"
|
|
"f 40/79 44/71 45/80 \n"
|
|
"f 41/74 45/80 46/85 \n"
|
|
"f 42/78 47/70 48/86 \n"
|
|
"f 43/72 48/87 47/70 \n"
|
|
"f 44/71 46/88 45/80 \n"
|
|
"\n"
|
|
"t crease 2/1/0 37 41 4.5\n"
|
|
"t crease 2/1/0 41 38 4.5\n"
|
|
"t crease 2/1/0 38 44 4.5\n"
|
|
"t crease 2/1/0 44 45 4.5\n"
|
|
"t crease 2/1/0 45 37 4.5\n"
|
|
"t crease 2/1/0 36 46 4.5\n"
|
|
"t crease 2/1/0 46 47 4.5\n"
|
|
"t crease 2/1/0 47 39 4.5\n"
|
|
"t crease 2/1/0 39 43 4.5\n"
|
|
"t crease 2/1/0 43 36 4.5\n"
|
|
"\n"
|
|
"t interpolateboundary 1/0/0 2\n"
|
|
"\n"
|
|
;
|