Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nef_3: e->incident_sface() != SFace_const_handle() assertion error. #7267

Closed
GilesBathgate opened this issue Feb 14, 2023 · 2 comments
Closed

Comments

@GilesBathgate
Copy link
Contributor

Issue Details

Following on the investigation in #7205 here is an example which can be built using the facet cycles method, but not with the polyhedron incremental builder. This example isn't closed i.e the is_closed check was removed, but I think it's worth documenting here:

Polyhedron polyhedron = {{{0,0,0},{0,10,0},{10,10,0},{10,0,0},{10,-10,0}},{{0,1,2},{0,3,4}}};
CGAL error: assertion violation!
Expression : e->incident_sface() != SFace_const_handle()
File       : /usr/include/CGAL/Nef_S2/SM_const_decorator.h
Line       : 331
Explanation: 
Refer to the bug-reporting instructions at https://www.cgal.org/bug_report.html
terminate called after throwing an instance of 'CGAL::Assertion_exception'
  what():  CGAL ERROR: assertion violation!
Expr: e->incident_sface() != SFace_const_handle()
File: /usr/include/CGAL/Nef_S2/SM_const_decorator.h
Line: 331

Environment

  • Operating system (Windows/Mac/Linux, 32/64 bits): Linux 64bit
  • Compiler: clang++ version 14.0.0
  • Release or debug mode: debug
  • Specific flags used (if any):
  • CGAL version: master
  • Boost version: 1.74.0
  • Other libraries versions if used (Eigen, TBB, etc.): None
@GilesBathgate
Copy link
Contributor Author

Also reported in #4210 and #4666

@GilesBathgate
Copy link
Contributor Author

This is a facet fan, that has a missing connecting facet leading to a non-manifold vertex.

A check for this condition can be written as follows (fans not fins):

bool all_vertices_manifold(const HalfedgeDS& hds)  {
	for(auto v=hds.vertices_begin(); v!=hds.vertices_end(); ++v) {
		if(v->vertex_degree()<=2) continue;
		unsigned borderEdges=0;
		auto b=v->vertex_begin(),e(b);
		CGAL_For_all(e,b) {
			if(e->is_border_edge())
				++borderEdges;
		}
		if(borderEdges>2) return false;
	}
	return true;
}

It doesn't check for fins, but Polyhedron_incremental_builder_3 doesn't allow them, So the test_facet function in builder can be used to detect them.

@GilesBathgate GilesBathgate changed the title Nef e->incident_sface() != SFace_const_handle() assertion error. Nef_3: e->incident_sface() != SFace_const_handle() assertion error. Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants