Skip to content

Commit aeda0c7

Browse files
authored
Merge pull request #926 from Geode-solutions/fix/split_along_mesh_elements
fix(CutAlongInternalSurfaces): Renamed class to SplitAlongBlockMeshBo…
2 parents 4f8e54d + 9560b9e commit aeda0c7

File tree

9 files changed

+114
-88
lines changed

9 files changed

+114
-88
lines changed

include/geode/mesh/helpers/detail/cut_along_solid_facets.h renamed to include/geode/mesh/helpers/detail/split_along_solid_facets.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ namespace geode
4242
{
4343
namespace detail
4444
{
45-
class opengeode_mesh_api CutAlongSolidFacets
45+
class opengeode_mesh_api SplitAlongSolidFacets
4646
{
4747
public:
48-
CutAlongSolidFacets(
48+
SplitAlongSolidFacets(
4949
const SolidMesh3D& mesh, SolidMeshBuilder3D& builder );
50-
~CutAlongSolidFacets();
50+
~SplitAlongSolidFacets();
5151

5252
/*
53-
* Cuts the solid along given facets, and returns the mapping on
53+
* Splits the solid along given facets, and returns the mapping on
5454
* vertices and facets.
5555
*/
56-
MeshesElementsMapping cut_solid_along_facets(
56+
MeshesElementsMapping split_solid_along_facets(
5757
absl::Span< const PolyhedronFacet > facets_list );
5858

5959
private:

include/geode/model/helpers/detail/cut_along_internal_surfaces.h renamed to include/geode/model/helpers/detail/split_along_block_mesh_borders.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,30 @@ namespace geode
4040
{
4141
namespace detail
4242
{
43-
class opengeode_model_api CutAlongInternalSurfaces
43+
class opengeode_model_api SplitAlongBlockMeshBorders
4444
{
4545
public:
46-
CutAlongInternalSurfaces( const BRep& model, BRepBuilder& builder );
47-
~CutAlongInternalSurfaces();
46+
SplitAlongBlockMeshBorders(
47+
const BRep& model, BRepBuilder& builder );
48+
~SplitAlongBlockMeshBorders();
4849

49-
/* Cuts the blocks along internal surfaces, and returns pairs of
50+
/* Splits the blocks along internal surfaces, facets without
51+
* adjacencies and non manifold vertices, and returns pairs of
5052
* component mesh vertices where the blocks vertices were split
5153
* (first the initial cmv of the vertices, second the cmv of the
5254
* newly created vertex)
5355
*/
5456
std::vector< std::pair< ComponentMeshVertex, ComponentMeshVertex > >
55-
cut_all_blocks();
57+
split_all_blocks();
5658

57-
/* Cuts the block along internal surfaces, and returns pairs of
59+
/* Splits the block along internal surfaces, facets without
60+
* adjacencies and non manifold vertices, and returns pairs of
5861
* component mesh vertices where the block vertices were split
5962
* (first the initial id of the vertices, second the id of the newly
6063
* created vertex)
6164
*/
6265
std::vector< std::pair< ComponentMeshVertex, ComponentMeshVertex > >
63-
cut_block( const Block3D& block );
66+
split_block( const Block3D& block );
6467

6568
private:
6669
IMPLEMENTATION_MEMBER( impl_ );

include/geode/model/helpers/detail/cut_along_internal_lines.h renamed to include/geode/model/helpers/detail/split_along_surface_mesh_borders.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,29 @@ namespace geode
3838
namespace detail
3939
{
4040
template < typename Model >
41-
class CutAlongInternalLines
41+
class SplitAlongSurfaceMeshBorders
4242
{
4343
public:
44-
CutAlongInternalLines( Model& model );
45-
CutAlongInternalLines(
44+
SplitAlongSurfaceMeshBorders( Model& model );
45+
SplitAlongSurfaceMeshBorders(
4646
const Model& model, typename Model::Builder& builder );
47-
~CutAlongInternalLines();
47+
~SplitAlongSurfaceMeshBorders();
4848

49-
/* Cuts the surfaces along internal lines, and returns pairs of
49+
/* Splits the surfaces along internal lines, and returns pairs of
5050
* component mesh vertices where the surfaces vertices were split
5151
* (first the initial cmv of the vertices, second the cmv of the
5252
* newly created vertex)
5353
*/
5454
std::vector< std::pair< ComponentMeshVertex, ComponentMeshVertex > >
55-
cut_all_surfaces();
55+
split_all_surfaces();
5656

57-
/* Cuts the surface along internal lines, and returns pairs of
57+
/* Splits the surface along internal lines, and returns pairs of
5858
* component mesh vertices where the surface vertices were split
5959
* (first the initial id of the vertices, second the id of the newly
6060
* created vertex)
6161
*/
6262
std::vector< std::pair< ComponentMeshVertex, ComponentMeshVertex > >
63-
cut_surface( const Surface< Model::dim >& surface );
63+
split_surface( const Surface< Model::dim >& surface );
6464

6565
private:
6666
IMPLEMENTATION_MEMBER( impl_ );

src/geode/mesh/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ add_geode_library(
117117
"helpers/detail/component_identifier.cpp"
118118
"helpers/detail/create_mesh.cpp"
119119
"helpers/detail/curve_merger.cpp"
120-
"helpers/detail/cut_along_solid_facets.cpp"
120+
"helpers/detail/split_along_solid_facets.cpp"
121121
"helpers/detail/debug.cpp"
122122
"helpers/detail/element_identifier.cpp"
123123
"helpers/detail/solid_merger.cpp"
@@ -299,7 +299,7 @@ add_geode_library(
299299
"core/detail/geode_elements.h"
300300
"core/detail/vertex_cycle.h"
301301
"helpers/detail/curve_merger.h"
302-
"helpers/detail/cut_along_solid_facets.h"
302+
"helpers/detail/split_along_solid_facets.h"
303303
"helpers/detail/component_identifier.h"
304304
"helpers/detail/create_mesh.h"
305305
"helpers/detail/debug.h"

src/geode/mesh/helpers/detail/cut_along_solid_facets.cpp renamed to src/geode/mesh/helpers/detail/split_along_solid_facets.cpp

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
*/
2323

24-
#include <geode/mesh/helpers/detail/cut_along_solid_facets.h>
24+
#include <geode/mesh/helpers/detail/split_along_solid_facets.h>
2525

2626
#include <geode/basic/attribute_manager.h>
2727
#include <geode/basic/pimpl_impl.h>
@@ -39,7 +39,7 @@ namespace geode
3939
{
4040
namespace detail
4141
{
42-
class CutAlongSolidFacets::Impl
42+
class SplitAlongSolidFacets::Impl
4343
{
4444
struct SolidInfo
4545
{
@@ -58,7 +58,7 @@ namespace geode
5858
{
5959
}
6060

61-
MeshesElementsMapping cut_solid_along_facets(
61+
MeshesElementsMapping split_solid_along_facets(
6262
absl::Span< const PolyhedronFacet > facets_list )
6363
{
6464
bool facets_enabled = solid_.are_facets_enabled();
@@ -96,11 +96,11 @@ namespace geode
9696
{
9797
builder_.unset_polyhedron_adjacent( solid_facet );
9898
builder_.unset_polyhedron_adjacent( adj.value() );
99-
for( const auto vertex_id :
100-
solid_.polyhedron_facet_vertices( solid_facet ) )
101-
{
102-
info.vertices_to_check[vertex_id] = true;
103-
}
99+
}
100+
for( const auto vertex_id :
101+
solid_.polyhedron_facet_vertices( solid_facet ) )
102+
{
103+
info.vertices_to_check[vertex_id] = true;
104104
}
105105
}
106106
for( const auto polyhedron_id : Range{ solid_.nb_polyhedra() } )
@@ -142,7 +142,7 @@ namespace geode
142142
auto nb_polyhedra_around = polyhedra_around.size();
143143
OPENGEODE_ASSERT(
144144
nb_polyhedra_around <= all_polyhedra_around.size(),
145-
"[CutAlongSolidFacets] Wrong size comparison" );
145+
"[SplitAlongSolidFacets] Wrong size comparison" );
146146
/// Already processed polyhedra
147147
PolyhedraAroundVertex processed_polyhedra;
148148
while( nb_polyhedra_around != all_polyhedra_around.size() )
@@ -187,7 +187,7 @@ namespace geode
187187
}
188188
OPENGEODE_ASSERT(
189189
!solid_.polyhedra_around_vertex( vertex_id ).empty(),
190-
"[BRepFromMeshBuilder::cut_block_by_surfaces] Lost "
190+
"[BRepFromMeshBuilder::split_block_by_surfaces] Lost "
191191
"polyhedron around vertex" );
192192
return new_vertex_id;
193193
}
@@ -234,16 +234,17 @@ namespace geode
234234
}
235235

236236
ElementsMapping final_facets_mapping(
237-
const ElementsMapping& solid2cut_mapping,
237+
const ElementsMapping& solid2split_mapping,
238238
absl::Span< const index_t > clean_mapping ) const
239239
{
240240
ElementsMapping facets_mapping;
241-
for( const auto& solid2cut : solid2cut_mapping.in2out_map() )
241+
for( const auto& solid2split :
242+
solid2split_mapping.in2out_map() )
242243
{
243-
for( const auto facet_after_cut : solid2cut.second )
244+
for( const auto facet_after_split : solid2split.second )
244245
{
245-
facets_mapping.map(
246-
solid2cut.first, clean_mapping[facet_after_cut] );
246+
facets_mapping.map( solid2split.first,
247+
clean_mapping[facet_after_split] );
247248
}
248249
}
249250
return facets_mapping;
@@ -288,16 +289,17 @@ namespace geode
288289
}
289290

290291
ElementsMapping final_edges_mapping(
291-
const ElementsMapping& solid2cut_mapping,
292+
const ElementsMapping& solid2split_mapping,
292293
absl::Span< const index_t > clean_mapping ) const
293294
{
294295
ElementsMapping edges_mapping;
295-
for( const auto& solid2cut : solid2cut_mapping.in2out_map() )
296+
for( const auto& solid2split :
297+
solid2split_mapping.in2out_map() )
296298
{
297-
for( const auto edge_after_cut : solid2cut.second )
299+
for( const auto edge_after_split : solid2split.second )
298300
{
299-
edges_mapping.map(
300-
solid2cut.first, clean_mapping[edge_after_cut] );
301+
edges_mapping.map( solid2split.first,
302+
clean_mapping[edge_after_split] );
301303
}
302304
}
303305
return edges_mapping;
@@ -308,18 +310,18 @@ namespace geode
308310
SolidMeshBuilder3D& builder_;
309311
};
310312

311-
CutAlongSolidFacets::CutAlongSolidFacets(
313+
SplitAlongSolidFacets::SplitAlongSolidFacets(
312314
const SolidMesh3D& mesh, SolidMeshBuilder3D& builder )
313315
: impl_{ mesh, builder }
314316
{
315317
}
316318

317-
CutAlongSolidFacets::~CutAlongSolidFacets() {}
319+
SplitAlongSolidFacets::~SplitAlongSolidFacets() {}
318320

319-
MeshesElementsMapping CutAlongSolidFacets::cut_solid_along_facets(
321+
MeshesElementsMapping SplitAlongSolidFacets::split_solid_along_facets(
320322
absl::Span< const PolyhedronFacet > facets_list )
321323
{
322-
return impl_->cut_solid_along_facets( facets_list );
324+
return impl_->split_solid_along_facets( facets_list );
323325
}
324326
} // namespace detail
325327
} // namespace geode

src/geode/model/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ add_geode_library(
4141
"helpers/surface_radial_sort.cpp"
4242
"helpers/ray_tracing.cpp"
4343
"helpers/detail/build_model_boundaries.cpp"
44-
"helpers/detail/cut_along_internal_lines.cpp"
45-
"helpers/detail/cut_along_internal_surfaces.cpp"
44+
"helpers/detail/split_along_surface_mesh_borders.cpp"
45+
"helpers/detail/split_along_block_mesh_borders.cpp"
4646
"mixin/builder/blocks_builder.cpp"
4747
"mixin/builder/block_collections_builder.cpp"
4848
"mixin/builder/corners_builder.cpp"
@@ -163,8 +163,8 @@ add_geode_library(
163163
"representation/io/geode/geode_section_output.h"
164164
ADVANCED_HEADERS
165165
"helpers/detail/build_model_boundaries.h"
166-
"helpers/detail/cut_along_internal_lines.h"
167-
"helpers/detail/cut_along_internal_surfaces.h"
166+
"helpers/detail/split_along_surface_mesh_borders.h"
167+
"helpers/detail/split_along_block_mesh_borders.h"
168168
"mixin/core/detail/components_storage.h"
169169
"mixin/core/detail/count_relationships.h"
170170
"mixin/core/detail/mesh_storage.h"

0 commit comments

Comments
 (0)