Skip to content

Commit

Permalink
Merge pull request #95 from redcarrera/20230817
Browse files Browse the repository at this point in the history
Document meaning of return values from bg_trimesh_solid
  • Loading branch information
starseeker authored Aug 17, 2023
2 parents a87b356 + c59dcc4 commit e118c7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions include/bg/trimesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ BG_EXPORT extern int bg_trimesh_manifold_closed(int vcnt, int fcnt, fastf_t *v,
BG_EXPORT extern int bg_trimesh_oriented(int vcnt, int fcnt, fastf_t *v, int *f);

/**
* Check if a mesh is topologically solid. True if the mesh is closed,
* manifold, and oriented.
* Check if a mesh is topologically solid. Returns TRUE if the mesh is
* NOT SOLID and FALSE if the mesh is SOLID. A FALSE outcome indicates
* the mesh satisfies all three criteria: Closed, Manifold, Oriented
*/
BG_EXPORT extern int bg_trimesh_solid(int vcnt, int fcnt, fastf_t *v, int *f, int **bedges);

Expand Down
3 changes: 2 additions & 1 deletion src/libbg/trimesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ bg_trimesh_solid(int vcnt, int fcnt, fastf_t *v, int *f, int **bedges)
bedge_cnt = bg_trimesh_solid2(vcnt, fcnt, v, f, NULL);
}

return bedge_cnt;
/* returns true when not solid */
return (bedge_cnt > 0) ? 1 : 0;
}

int
Expand Down

0 comments on commit e118c7d

Please sign in to comment.