I am getting floating-point invalid operation exceptions using the openNURBS 8 library. The same code runs without issue using the openNURBS 7 library.
I am compiling 64-bit debug using Visual Studio 2017. The exception is turned off by default so you’ll need to enable the exception or check your output window to confirm.
Issue 2 - opennurbs_bounding_box.cpp::ON_BoundingBox::IsNotEmpty(); line 2159
What I do is this:
ONW_Model model = new ONW_Model;
FILE archive_fp = ON::OpenFile(L"C:\Somewhere\v2_HumanHead1.3dm", L"rb");
ON_BinaryFile archive(ON::archive_mode::read3dm, archive_fp);
bool rc = model->model.Read(archive);
It looks to me like ON_BoundingBox::IsNotEmpty() is being called for a bounding box with min=(nan,nan,nan), max=(nan,nan,nan) and this causes a floating-point invalid operation exception.
When I run the example_read.exe program, the exception is not observed.
example_read.exe and st7rhino.dll pretty much do the same thing. It is when I call LoadLibrary that the Issue 1 exception occurs and then LoadLibrary returns a zero handle. If I patch the opennurbs code to avoid doing floating point operations on nan values, I get Issue 2 later on downstream. It occurs on many of the provided example files including v2_HumanHead1.3dm.
Hi Dale,
I am compiling a DLL in VS2019 that statically links to the openNURBS toolkit. The purpose of this dll is to provide a C interface to the openNURBS toolkit which is callable from Delphi programming language.
I have done further testing and have found that when I load the dll from a Visual Studio compiled console application, the exception is not thrown. When I load the same dll from a Delphi compiled console application, the exception is thrown and LoadLibrary returns 0.