Skip to content

Commit

Permalink
added intersect command
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLevy committed Feb 3, 2024
1 parent 6d6cd09 commit 9d461b0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/lib/OGF/mesh/commands/mesh_grob_surface_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,31 @@ namespace OGF {
result->update();
}

void MeshGrobSurfaceCommands::intersect(
bool remove_internal_shells,
bool simplify_coplanar_facets,
double coplanar_angle_tolerance,
bool interpolate_attributes
) {
MeshSurfaceIntersection intersection(*mesh_grob());
intersection.set_delaunay(true);
intersection.set_detect_intersecting_neighbors(true);
intersection.set_radial_sort(remove_internal_shells);
intersection.set_interpolate_attributes(interpolate_attributes);

intersection.intersect();
if(remove_internal_shells) {
intersection.remove_internal_shells();
}

if(simplify_coplanar_facets) {
intersection.simplify_coplanar_facets(coplanar_angle_tolerance);
}

show_mesh();
mesh_grob()->update();
}


void MeshGrobSurfaceCommands::remesh_smooth(
const NewMeshGrobName& surface_name_in,
Expand Down
16 changes: 16 additions & 0 deletions src/lib/OGF/mesh/commands/mesh_grob_surface_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,22 @@ namespace OGF {
bool post_process=false
);

/**
* \menu Boolean operations
* \brief Computes intersections in a surface mesh
* \param[in] remove_internal_shells keep only facets on external hull
* \param[in] simplify_coplanar_facets retriangulates planar zones
* \param[in] coplanar_angle_tolerance in degrees
* \param[in] interpolate_attributes interpolate facet corner
* attributes on generated intersections. Deactivates coplanar
* facets simplification if set.
*/
void intersect(
bool remove_internal_shells = true,
bool simplify_coplanar_facets = true,
double coplanar_angle_tolerance = 0.001,
bool interpolate_attributes = false
);

/**********************************************************/

Expand Down

0 comments on commit 9d461b0

Please sign in to comment.