mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-11-22 19:50:08 +00:00
Added new regression/shapes for Loop meshes with non-manifold topology:
- added two new sets of shapes exhibiting non-manifold vertices and edges - updated regression/shapes/all.h for inclusion by clients
This commit is contained in:
parent
dd1949ef74
commit
8cc30d4f0d
@ -118,6 +118,8 @@
|
||||
#include "loop_icosahedron.h"
|
||||
#include "loop_icos_infsharp.h"
|
||||
#include "loop_icos_semisharp.h"
|
||||
#include "loop_nonman_edges.h"
|
||||
#include "loop_nonman_verts.h"
|
||||
#include "loop_pole8.h"
|
||||
#include "loop_pole64.h"
|
||||
#include "loop_pole360.h"
|
||||
|
279
regression/shapes/loop_nonman_edges.h
Normal file
279
regression/shapes/loop_nonman_edges.h
Normal file
@ -0,0 +1,279 @@
|
||||
//
|
||||
// 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.583333 0.0 0.81698\n"
|
||||
"v -1.25 0.0 0.81698\n"
|
||||
"v -0.916667 0.0 0.81698\n"
|
||||
"v -1.75 0.0 1.10566\n"
|
||||
"v -1.416667 -0.25 1.10566\n"
|
||||
"v -1.083333 -0.25 1.10566\n"
|
||||
"v -0.75 0.0 1.10566\n"
|
||||
"v -1.583333 0.0 1.39434\n"
|
||||
"v -1.25 -0.25 1.39434\n"
|
||||
"v -0.916667 0.0 1.39434\n"
|
||||
"v -1.416667 0.0 1.68302\n"
|
||||
"v -1.083333 0.0 1.68302\n"
|
||||
"v -1.25 -0.50 1.25\n"
|
||||
"\n"
|
||||
"f 1 2 5\n"
|
||||
"f 2 3 6\n"
|
||||
"f 1 5 4\n"
|
||||
"f 2 6 5\n"
|
||||
"f 3 7 6\n"
|
||||
"f 4 5 8\n"
|
||||
"f 5 6 9\n"
|
||||
"f 6 7 10\n"
|
||||
"f 5 9 8\n"
|
||||
"f 6 10 9\n"
|
||||
"f 8 9 11\n"
|
||||
"f 9 10 12\n"
|
||||
"f 9 12 11\n"
|
||||
"# Add face to existing manifold edge, making it non-manifold:\n"
|
||||
"f 13 5 6\n"
|
||||
"\n"
|
||||
"#\n"
|
||||
"# Shape 2: top-middle\n"
|
||||
"#\n"
|
||||
"v -0.5 0.0 1.083333\n"
|
||||
"v -0.333333 0.0 1.25\n"
|
||||
"v -0.166667 0.0 1.416667\n"
|
||||
"v 0.0 0.0 1.583333\n"
|
||||
"v 0.166667 0.0 1.416667\n"
|
||||
"v 0.333333 0.0 1.25\n"
|
||||
"v 0.5 0.0 1.083333\n"
|
||||
"v -0.333333 0.0 0.916667\n"
|
||||
"v -0.166667 0.0 1.083333\n"
|
||||
"v 0.0 0.0 1.25\n"
|
||||
"v 0.166667 0.0 1.083333\n"
|
||||
"v 0.333333 0.0 0.916667\n"
|
||||
"v -0.2 0.2 1.05\n"
|
||||
"v -0.1 0.2 1.15\n"
|
||||
"v 0.1 0.2 1.15\n"
|
||||
"v 0.2 0.2 1.05\n"
|
||||
"v -0.2 -0.2 1.05\n"
|
||||
"v -0.1 -0.2 1.15\n"
|
||||
"v 0.1 -0.2 1.15\n"
|
||||
"v 0.2 -0.2 1.05\n"
|
||||
"\n"
|
||||
"f 14 21 15\n"
|
||||
"f 15 21 22\n"
|
||||
"f 15 22 16\n"
|
||||
"f 16 22 23\n"
|
||||
"f 16 23 17\n"
|
||||
"f 17 23 18\n"
|
||||
"f 18 23 24\n"
|
||||
"f 18 24 19\n"
|
||||
"f 19 24 25\n"
|
||||
"f 19 25 20\n"
|
||||
"f 26 21 22\n"
|
||||
"f 26 22 27\n"
|
||||
"f 27 22 23\n"
|
||||
"f 27 23 28\n"
|
||||
"f 28 23 24\n"
|
||||
"f 28 24 29\n"
|
||||
"f 29 24 25\n"
|
||||
"f 30 22 21\n"
|
||||
"f 30 31 22\n"
|
||||
"f 31 23 22\n"
|
||||
"f 31 32 23\n"
|
||||
"f 32 24 23\n"
|
||||
"f 32 33 24\n"
|
||||
"f 33 25 24\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"
|
||||
"f 34 35 36\n"
|
||||
"f 34 35 37\n"
|
||||
"f 34 35 38\n"
|
||||
"f 34 35 39\n"
|
||||
"f 35 34 40\n"
|
||||
"f 35 34 41\n"
|
||||
"f 35 34 42\n"
|
||||
"f 35 34 43\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"
|
||||
"f 44 45 48\n"
|
||||
"f 45 46 49\n"
|
||||
"f 46 47 50\n"
|
||||
"f 45 49 48\n"
|
||||
"f 46 50 49\n"
|
||||
"# Add triangle with degenerate edge along existing edge:\n"
|
||||
"f 46 46 49\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"
|
||||
"f 51 52 55\n"
|
||||
"f 52 53 56\n"
|
||||
"f 51 55 54\n"
|
||||
"f 52 56 55\n"
|
||||
"f 53 57 56\n"
|
||||
"f 54 55 58\n"
|
||||
"f 55 56 59\n"
|
||||
"f 56 57 60\n"
|
||||
"f 55 59 58\n"
|
||||
"f 56 60 59\n"
|
||||
"f 58 59 61\n"
|
||||
"f 59 60 62\n"
|
||||
"f 59 62 61\n"
|
||||
"# Add a triangle with a degenerate edge to the interior:\n"
|
||||
"f 55 56 56\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"
|
||||
"f 63 64 67\n"
|
||||
"f 64 65 68\n"
|
||||
"f 63 67 66\n"
|
||||
"f 64 68 67\n"
|
||||
"f 65 69 68\n"
|
||||
"f 66 67 70\n"
|
||||
"f 67 68 71\n"
|
||||
"f 68 69 72\n"
|
||||
"f 67 71 70\n"
|
||||
"f 68 72 71\n"
|
||||
"f 70 71 73\n"
|
||||
"f 71 72 74\n"
|
||||
"f 71 74 73\n"
|
||||
"# Add a completely degenerate triangle to the interior:\n"
|
||||
"f 67 67 67\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"#\n"
|
||||
"# Shape 7: bottom-left\n"
|
||||
"#\n"
|
||||
"v -1.25 0.0 -1.25\n"
|
||||
"\n"
|
||||
"f 1 1 1\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"
|
||||
"f 76 77 81\n"
|
||||
"f 77 82 81\n"
|
||||
"# Reverse winding of the 3 middle faces:\n"
|
||||
"f 82 78 77\n"
|
||||
"f 82 83 78\n"
|
||||
"f 83 79 78\n"
|
||||
"f 79 84 83\n"
|
||||
"f 79 80 84\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"
|
||||
"f 85 86 89\n"
|
||||
"f 86 87 90\n"
|
||||
"f 85 89 88\n"
|
||||
"f 86 90 89\n"
|
||||
"f 87 91 90\n"
|
||||
"f 88 89 92\n"
|
||||
"# Reverse the winding order of the interior face:\n"
|
||||
"f 93 90 89\n"
|
||||
"f 90 91 94\n"
|
||||
"f 89 93 92\n"
|
||||
"f 90 94 93\n"
|
||||
"f 92 93 95\n"
|
||||
"f 93 94 96\n"
|
||||
"f 93 96 95\n"
|
||||
"\n"
|
||||
"t interpolateboundary 1/0/0 1\n"
|
||||
"\n"
|
||||
;
|
122
regression/shapes/loop_nonman_verts.h
Normal file
122
regression/shapes/loop_nonman_verts.h
Normal file
@ -0,0 +1,122 @@
|
||||
//
|
||||
// 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_verts =
|
||||
"#\n"
|
||||
"# Four shapes ordered left->right and top->bottom in the XZ plane\n"
|
||||
"#\n"
|
||||
"# Shape 1: top-left\n"
|
||||
"#\n"
|
||||
"v -1.25 0.0 0.75\n"
|
||||
"v -0.75 -0.25 0.75\n"
|
||||
"v -0.25 0.0 0.75\n"
|
||||
"v -1.0 0.0 1.25\n"
|
||||
"v -0.5 0.0 1.25\n"
|
||||
"v -1.0 0.0 0.25\n"
|
||||
"v -0.5 0.0 0.25\n"
|
||||
"\n"
|
||||
"f 1 2 4\n"
|
||||
"f 2 5 4\n"
|
||||
"f 2 3 5\n"
|
||||
"f 2 6 7\n"
|
||||
"\n"
|
||||
"#\n"
|
||||
"# Shape 2: top-right\n"
|
||||
"#\n"
|
||||
"v 0.25 0.0 0.875\n"
|
||||
"v 0.75 -0.25 0.75\n"
|
||||
"v 1.25 0.0 0.875\n"
|
||||
"v 0.5 0.0 1.25\n"
|
||||
"v 1.0 0.0 1.25\n"
|
||||
"v 0.25 0.0 0.625\n"
|
||||
"v 0.5 0.0 0.25\n"
|
||||
"v 1.0 0.0 0.25\n"
|
||||
"v 1.25 0.0 0.625\n"
|
||||
"\n"
|
||||
"f 8 9 11\n"
|
||||
"f 9 12 11\n"
|
||||
"f 9 10 12\n"
|
||||
"f 9 13 14\n"
|
||||
"f 15 9 14\n"
|
||||
"f 15 16 9\n"
|
||||
"\n"
|
||||
"#\n"
|
||||
"# Shape 3: bottom-left\n"
|
||||
"#\n"
|
||||
"v -0.75 0.0 -0.75\n"
|
||||
"v -0.25 0.0 -1.0\n"
|
||||
"v -0.5 0.433013 -1.0\n"
|
||||
"v -1.0 0.433013 -1.0\n"
|
||||
"v -1.25 0.0 -1.0\n"
|
||||
"v -1.0 -0.433013 -1.0\n"
|
||||
"v -0.5 -0.433013 -1.0\n"
|
||||
"v -1.0 0.0 -0.5\n"
|
||||
"v -0.5 0.0 -0.5\n"
|
||||
"\n"
|
||||
"f 17 18 19\n"
|
||||
"f 17 19 20\n"
|
||||
"f 17 20 21\n"
|
||||
"f 17 21 22\n"
|
||||
"f 17 22 23\n"
|
||||
"f 17 23 18\n"
|
||||
"f 17 25 24\n"
|
||||
"\n"
|
||||
"#\n"
|
||||
"# Shape 4: bottom-right\n"
|
||||
"#\n"
|
||||
"v 0.75 0.0 -0.75\n"
|
||||
"v 1.25 0.0 -1.0\n"
|
||||
"v 1.0 0.433013 -1.0\n"
|
||||
"v 0.5 0.433013 -1.0\n"
|
||||
"v 0.25 0.0 -1.0\n"
|
||||
"v 0.5 -0.433013 -1.0\n"
|
||||
"v 1.0 -0.433013 -1.0\n"
|
||||
"v 1.25 0.0 -0.5\n"
|
||||
"v 1.0 0.433013 -0.5\n"
|
||||
"v 0.5 0.433013 -0.5\n"
|
||||
"v 0.25 0.0 -0.5\n"
|
||||
"v 0.5 -0.433013 -0.5\n"
|
||||
"v 1.0 -0.433013 -0.5\n"
|
||||
"\n"
|
||||
"f 26 27 28\n"
|
||||
"f 26 28 29\n"
|
||||
"f 26 29 30\n"
|
||||
"f 26 30 31\n"
|
||||
"f 26 31 32\n"
|
||||
"f 26 32 27\n"
|
||||
"f 26 34 33\n"
|
||||
"f 26 35 34\n"
|
||||
"f 26 36 35\n"
|
||||
"f 26 37 36\n"
|
||||
"f 26 38 37\n"
|
||||
"f 26 33 38\n"
|
||||
"\n"
|
||||
"#\n"
|
||||
"# Additional 'shape' 5: isolated non-manifold vertex in center\n"
|
||||
"#\n"
|
||||
"v 0 0 0\n"
|
||||
"\n"
|
||||
"t interpolateboundary 1/0/0 1\n"
|
||||
"\n"
|
||||
;
|
Loading…
Reference in New Issue
Block a user