Skip to content

Commit

Permalink
Merge branch 'next' of github.com:Geode-solutions/OpenGeode into feat…
Browse files Browse the repository at this point in the history
…/cut_along_solid_facets
  • Loading branch information
MelchiorSchuh committed May 17, 2024
2 parents 944de9e + ad9e07e commit 0749021
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
7 changes: 4 additions & 3 deletions cmake/CppTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ function(add_geode_library)
)
endforeach()
set(PROJECT_LIB_NAME ${PROJECT_NAME}::${GEODE_LIB_NAME})
set(VERSION_RC_FILE ${PROJECT_BINARY_DIR}/${GEODE_LIB_FOLDER}/version.rc)
if(EXISTS ${VERSION_RC_FILE})
set(VERSION_RC_FILE_IN ${PROJECT_SOURCE_DIR}/cmake/version.rc.in)
if(EXISTS ${VERSION_RC_FILE_IN})
message(STATUS "Configuring version.rc")
set(VERSION_RC_FILE ${PROJECT_BINARY_DIR}/${GEODE_LIB_FOLDER}/version.rc)
configure_file(
${PROJECT_SOURCE_DIR}/cmake/version.rc.in
${VERSION_RC_FILE_IN}
${VERSION_RC_FILE}
@ONLY
)
Expand Down
20 changes: 12 additions & 8 deletions src/geode/mesh/core/solid_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,21 @@ namespace
const geode::SolidMesh< dimension >& solid,
const std::array< geode::index_t, 2 >& vertices )
{
for( const auto& polyhedron :
solid.polyhedra_around_vertex( vertices[0] ) )
for( const auto vertex : vertices )
{
for( const auto& edge_vertices :
solid.polyhedron_edges_vertices( polyhedron.polyhedron_id ) )
for( const auto& polyhedron :
solid.polyhedra_around_vertex( vertex ) )
{
if( vertices == edge_vertices
|| ( vertices[0] == edge_vertices[1]
&& vertices[1] == edge_vertices[0] ) )
for( const auto& edge_vertices :
solid.polyhedron_edges_vertices(
polyhedron.polyhedron_id ) )
{
return polyhedron.polyhedron_id;
if( vertices == edge_vertices
|| ( vertices[0] == edge_vertices[1]
&& vertices[1] == edge_vertices[0] ) )
{
return polyhedron.polyhedron_id;
}
}
}
}
Expand Down
12 changes: 4 additions & 8 deletions src/geode/mesh/helpers/detail/cut_along_solid_facets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

#include <geode/mesh/helpers/detail/cut_along_solid_facets.h>

// #include <async++.h>

// #include <absl/memory/memory.h>

#include <geode/basic/attribute_manager.h>
#include <geode/basic/pimpl_impl.h>

Expand Down Expand Up @@ -93,7 +89,7 @@ namespace geode
absl::Span< const PolyhedronFacet > facets_list )
{
SolidInfo info{ solid_.nb_vertices() };
for( const auto solid_facet : facets_list )
for( const auto& solid_facet : facets_list )
{
if( const auto adj =
solid_.polyhedron_adjacent_facet( solid_facet ) )
Expand All @@ -112,7 +108,7 @@ namespace geode
for( const auto local_vertex_id : LRange{
solid_.nb_polyhedron_vertices( polyhedron_id ) } )
{
PolyhedronVertex vertex{ polyhedron_id,
const PolyhedronVertex vertex{ polyhedron_id,
local_vertex_id };
const auto vertex_id =
solid_.polyhedron_vertex( vertex );
Expand Down Expand Up @@ -233,7 +229,7 @@ namespace geode
.value(),
facet_id );
}
auto old2new = facets_builder.delete_isolated_facets();
const auto old2new = facets_builder.delete_isolated_facets();
return final_facets_mapping( facets_mapping, old2new );
}

Expand Down Expand Up @@ -287,7 +283,7 @@ namespace geode
solid_edges.edge_from_vertices( edge_vertices ).value(),
edge_id );
}
auto old2new = edges_builder.delete_isolated_edges();
const auto old2new = edges_builder.delete_isolated_edges();
return final_edges_mapping( edges_mapping, old2new );
}

Expand Down

0 comments on commit 0749021

Please sign in to comment.