Skip to content

Commit 544d88a

Browse files
authored
Merge pull request #179 from Geode-solutions/feat/meshes_validity
feat(Validity): Added validity checks for all meshes
2 parents ab74b6d + f6d60ae commit 544d88a

46 files changed

Lines changed: 2644 additions & 64 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bindings/python/src/inspection/topology/brep_topology.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,18 @@ namespace geode
4141
.def_readwrite( "unique_vertices_linked_to_multiple_corners",
4242
&BRepCornersTopologyInspectionResult::
4343
unique_vertices_linked_to_multiple_corners )
44+
.def_readwrite(
45+
"unique_vertices_linked_to_multiply_embedded_corner",
46+
&BRepCornersTopologyInspectionResult::
47+
unique_vertices_linked_to_multiply_embedded_corner )
4448
.def_readwrite(
4549
"unique_vertices_linked_to_not_internal_nor_boundary_corner",
4650
&BRepCornersTopologyInspectionResult::
4751
unique_vertices_linked_to_not_internal_nor_boundary_corner )
48-
.def_readwrite( "unique_vertices_liked_to_not_boundary_line_corner",
52+
.def_readwrite(
53+
"unique_vertices_linked_to_not_boundary_line_corner",
4954
&BRepCornersTopologyInspectionResult::
50-
unique_vertices_liked_to_not_boundary_line_corner )
55+
unique_vertices_linked_to_not_boundary_line_corner )
5156
.def( "string", &BRepCornersTopologyInspectionResult::string )
5257
.def( "inspection_type",
5358
&BRepCornersTopologyInspectionResult::inspection_type );

bindings/python/src/validity/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@
2121
add_geode_python_binding(
2222
NAME "py_validity"
2323
SOURCES
24-
"validity.cpp"
24+
"brep_validity.hpp"
25+
"edgedcurve_validity.hpp"
26+
"object_validity.hpp"
2527
"pointset_validity.hpp"
28+
"section_validity.hpp"
29+
"solid_validity.hpp"
30+
"surface_validity.hpp"
31+
"validity.cpp"
2632
DEPENDENCIES
2733
${PROJECT_NAME}::validity
2834
)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2019 - 2026 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
#include <string>
24+
25+
#include <geode/model/representation/core/brep.hpp>
26+
27+
#include <geode/inspector/validity/brep_validity.hpp>
28+
#include <geode/inspector/validity/object_validity.hpp>
29+
30+
namespace geode
31+
{
32+
void define_brep_validity( pybind11::module& module )
33+
{
34+
module.def( "is_brep_valid", &is_brep_valid );
35+
}
36+
} // namespace geode
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2019 - 2026 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
#include <string>
24+
25+
#include <geode/mesh/core/edged_curve.hpp>
26+
27+
#include <geode/inspector/validity/edgedcurve_validity.hpp>
28+
#include <geode/inspector/validity/object_validity.hpp>
29+
30+
namespace geode
31+
{
32+
void define_edged_curve_validity( pybind11::module& module )
33+
{
34+
module.def( "is_edged_curve_valid2D", &is_edged_curve_valid< 2 > );
35+
module.def( "is_edged_curve_valid3D", &is_edged_curve_valid< 3 > );
36+
}
37+
} // namespace geode
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2019 - 2026 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#pragma once
25+
26+
#include <string>
27+
28+
#include <geode/inspector/validity/object_validity.hpp>
29+
30+
namespace geode
31+
{
32+
inline void define_object_validity( pybind11::module& module )
33+
{
34+
pybind11::class_< ObjectValidity >( module, "ObjectValidity" )
35+
.def( "nb_issues", &ObjectValidity::nb_issues )
36+
.def( "string", &ObjectValidity::string )
37+
.def_readwrite( "invalidities", &ObjectValidity::invalidities );
38+
}
39+
} // namespace geode

bindings/python/src/validity/pointset_validity.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@
2424

2525
#include <geode/mesh/core/point_set.hpp>
2626

27+
#include <geode/inspector/validity/object_validity.hpp>
2728
#include <geode/inspector/validity/pointset_validity.hpp>
2829

2930
namespace geode
3031
{
3132
void define_point_set_validity( pybind11::module& module )
3233
{
33-
module.def( "pointset_invalidity2D", &pointset_invalidity< 2 > );
34-
module.def( "pointset_invalidity3D", &pointset_invalidity< 3 > );
34+
module.def( "is_pointset_valid2D", &is_pointset_valid< 2 > );
35+
module.def( "is_pointset_valid3D", &is_pointset_valid< 3 > );
3536
}
3637
} // namespace geode
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2019 - 2026 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
#include <string>
24+
25+
#include <geode/model/representation/core/section.hpp>
26+
27+
#include <geode/inspector/validity/object_validity.hpp>
28+
#include <geode/inspector/validity/section_validity.hpp>
29+
30+
namespace geode
31+
{
32+
void define_section_validity( pybind11::module& module )
33+
{
34+
module.def( "is_section_valid", &is_section_valid );
35+
}
36+
} // namespace geode
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2019 - 2026 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
#include <string>
24+
25+
#include <geode/mesh/core/solid_mesh.hpp>
26+
27+
#include <geode/inspector/validity/object_validity.hpp>
28+
#include <geode/inspector/validity/solid_validity.hpp>
29+
30+
namespace geode
31+
{
32+
void define_solid_mesh_validity( pybind11::module& module )
33+
{
34+
module.def( "is_solid_valid3D", &is_solid_valid< 3 > );
35+
}
36+
} // namespace geode
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2019 - 2026 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
#include <string>
24+
25+
#include <geode/mesh/core/surface_mesh.hpp>
26+
27+
#include <geode/inspector/validity/object_validity.hpp>
28+
#include <geode/inspector/validity/surface_validity.hpp>
29+
30+
namespace geode
31+
{
32+
void define_surface_mesh_validity( pybind11::module& module )
33+
{
34+
module.def( "is_surface_valid2D", &is_surface_valid< 2 > );
35+
module.def( "is_surface_valid3D", &is_surface_valid< 3 > );
36+
}
37+
} // namespace geode

bindings/python/src/validity/validity.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@
2525
#include "pybind11/pybind11.h"
2626
#include "pybind11/stl.h"
2727

28+
#include "brep_validity.hpp"
29+
#include "edgedcurve_validity.hpp"
30+
#include "object_validity.hpp"
2831
#include "pointset_validity.hpp"
32+
#include "section_validity.hpp"
33+
#include "solid_validity.hpp"
34+
#include "surface_validity.hpp"
2935

3036
PYBIND11_MODULE( opengeode_inspector_py_validity, module )
3137
{
@@ -34,5 +40,11 @@ PYBIND11_MODULE( opengeode_inspector_py_validity, module )
3440
module, "OpenGeodeInspectorValidityLibrary" )
3541
.def( "initialize",
3642
&geode::OpenGeodeInspectorValidityLibrary::initialize );
43+
geode::define_object_validity( module );
44+
geode::define_brep_validity( module );
45+
geode::define_edged_curve_validity( module );
3746
geode::define_point_set_validity( module );
47+
geode::define_section_validity( module );
48+
geode::define_solid_mesh_validity( module );
49+
geode::define_surface_mesh_validity( module );
3850
}

0 commit comments

Comments
 (0)