solvespace / solvespace

Parametric 2d/3d CAD
http://solvespace.com/
GNU General Public License v3.0
3.25k stars 486 forks source link

export-mesh issues cause assertion failure #170

Open wpwrak opened 7 years ago

wpwrak commented 7 years ago

Trying to "solvespace-cli export-mesh" an-top.slvs as of https://gitlab.com/anelok/mexp/commit/1cf3d328df77497d4b42a87b494eba6533d139c1

Produces a number of complaints about the mesh (expected), then an abort, apparently as a result of the reporting, not mesh generation itself:

solvespace-cli export-mesh an-top.slvs -o an-top.stl
Missing (absent) translation for group-name'#references'
Missing (absent) translation for group-name'sketch-in-plane'
Generate::REGEN (for bounding box) took 51 ms
Generate::REGEN took 87 ms
Vector::WithMagnitude(1) of zero vector!
Vector::WithMagnitude(1) of zero vector!
Generate::ALL (for bounding box) took 58 ms
Generate::ALL took 179 ms
Generate::ALL took 174 ms
error box: The mesh is self-intersecting (NOT okay, invalid).

The mesh has naked edges (NOT okay, invalid).

201 problematic edges, bad.

The model contains 356 triangles, from 74 surfaces.
File /home/3d/solvespace/src/platform/headless.cpp, line 237, function DoMessageBox:
Assertion 'Not implemented' failed: ((false) == false).
Backtrace:
 0: solvespace-cli(_ZN10SolveSpace14assert_failureEPKcjS1_S1_S1_+0x78) [0x55db8f97e162]
 1: solvespace-cli(_ZN10SolveSpace11OpenWebsiteEPKc+0) [0x55db8fab68a7]
 2: solvespace-cli(+0x24d292) [0x55db8fa43292]
 3: solvespace-cli(_ZN10SolveSpace5ErrorEPKcz+0xb6) [0x55db8fa4335f]
 4: solvespace-cli(_ZN10SolveSpace12SolveSpaceUI14ShowNakedEdgesEb+0x192) [0x55db8fab4c46]
 5: solvespace-cli(_ZN10SolveSpace12SolveSpaceUI12ExportMeshToERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x117) [0x55db8f985589]
 6: solvespace-cli(+0x183fce) [0x55db8f979fce]
 7: solvespace-cli(+0x185d72) [0x55db8f97bd72]
 8: solvespace-cli(_ZNKSt8functionIFvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEclES7_+0x49) [0x55db8f97cdef]
 9: solvespace-cli(+0x184e88) [0x55db8f97ae88]
10: solvespace-cli(main+0x8a) [0x55db8f97b0c7]
11: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1) [0x7fd6538ae3f1]
12: solvespace-cli(_start+0x2a) [0x55db8f978f5a]
Aborted
whitequark commented 7 years ago

This is not "really" a bug in the sense that I'm aware of this behavior, most of SolveSpace's codebase is just not adjusted for CLI yet.

For now I suggest not exporting invalid meshes, since they're likely to cause bugs in the slicer anyhow :)