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

2020.12.RC2 Truncated console output on CGAL error. #3532

Closed
MichaelAtOz opened this issue Dec 12, 2020 · 6 comments
Closed

2020.12.RC2 Truncated console output on CGAL error. #3532

MichaelAtOz opened this issue Dec 12, 2020 · 6 comments

Comments

@MichaelAtOz
Copy link
Member

MichaelAtOz commented Dec 12, 2020

No description provided.

@MichaelAtOz
Copy link
Member Author

Oops - tip don't press Enter after typing the title...

Forum.

RC2. Render with CGAL error does not report cache stats or render time.

Parsing design (AST generation)...
Saved backup file: C:/Users/MeB/Documents/OpenSCAD/backups/adrianv-path_sweep-backup-AncrtKeh.scad
Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
ERROR: CGAL error in CGALUtils::applyUnion3D: CGAL ERROR: assertion violation! Expr: G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1) File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_S2/SM_overlayer.h Line: 303, location unknown 
UI-WARNING: No top level geometry to render location unknown 

2019.05

Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
ERROR: CGAL error in CGALUtils::applyBinaryOperator union: CGAL ERROR: assertion violation! Expr: G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1) File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_S2/SM_overlayer.h Line: 303
Geometries in cache: 9
Geometry cache size in bytes: 1971896
CGAL Polyhedrons in cache: 1
CGAL cache size in bytes: 0
Total rendering time: 0 hours, 0 minutes, 4 seconds
Rendering finished.

@MichaelAtOz
Copy link
Member Author

Also should it say 'location unknown'?
UI-WARNING: No top level geometry to render location unknown

@rcolyer
Copy link
Member

rcolyer commented Dec 16, 2020

It appears the old code flow went through applyOperator(...) which starts with a nullptr CGAL_Nef_polyhedron*, allocates it upon adding the first item, built it up gradually, and then upon encountering an error returned the partially constructed result. The new code instead appears to go through the new applyUnion3D, constructs a priority_queue, and then only constructs a CGAL_Nef_polyhedron to return if it completes the process successfully. Otherwise it returns a nullptr. Then I suppose the stats are then not available if there's no top level geometry. Given that it's a failure to perform the operation, I'm not sure that there's any advantage to returning a partially constructed result as was done previously.

@MichaelAtOz
Copy link
Member Author

Those stats are the cache, not the last rendered object.
I believe cache will be built, up to that point, even if the global render asserts.
Time is useful even if it fails.

A successful render shows:

Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
Geometries in cache: 2
Geometry cache size in bytes: 3184
CGAL Polyhedrons in cache: 1
CGAL cache size in bytes: 22096
Total rendering time: 0:00:00.270
   Top level object is a 3D object:
   Simple:        yes
   Vertices:       16
   Halfedges:      48
   Edges:          24
   Halffacets:     20
   Facets:         10
   Volumes:         2
Rendering finished.

Those after the time are the object.

@MichaelAtOz
Copy link
Member Author

Also, I have a console scraper, which is not used much, but having consistent output, such as 'Total rendering time...' & 'Rendering finished.' is much easier to parse.

@MichaelAtOz
Copy link
Member Author

The new code instead appears to go through the new applyUnion3D, constructs a priority_queue, and then only constructs a CGAL_Nef_polyhedron to return if it completes the process successfully. Otherwise it returns a nullptr.

I'm not a deep C programmer, but I think the old code returned an empty object not a nullptr

CGAL_Nef_polyhedron *N = CGALUtils::applyOperator(children, op);
// FIXME: Clarify when we can return nullptr and what that means
if (!N) N = new CGAL_Nef_polyhedron;
return ResultObject(N);

I'm not a good Git driver either, so I'm not sure how to reference the commit, here goes this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants