Skip to content
New issue

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

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

Already on GitHub? # to your account

Rhino Export Hangs: "s.materials().count is not a function" #459

Closed
jlpoolen opened this issue Apr 7, 2024 · 2 comments
Closed

Rhino Export Hangs: "s.materials().count is not a function" #459

jlpoolen opened this issue Apr 7, 2024 · 2 comments

Comments

@jlpoolen
Copy link

jlpoolen commented Apr 7, 2024

Describe the bug
Attempt to export a model loaded in Online 3D Viewer results in never-ending "Exporting" hourglass.

Firefox: 123.0.1 (64-bit)

ryzdesk /home/jlpoole/Downloads/3dviewer # eix -I firefox
[I] www-client/firefox-bin
Available versions:
(esr)  115.8.0^s
(rapid) 123.0.1^s
{+alsa +ffmpeg +gmp-autoupdate +pulseaudio selinux wayland L10N="ach af an ar ast az be bg bn br bs ca ca-valencia cak cs cy da de dsb el en-CA en-GB eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy ga gd gl gn gu he hi hr hsb hu hy ia id is it ja ka kab kk km kn ko lij lt lv mk mr ms my nb ne nl nn oc pa pl pt-BR pt-PT rm ro ru sco si sk sl son sq sr sv ta te th tl tr trs uk ur uz vi xh zh-CN zh-TW"}
Installed versions:  123.0.1(rapid)^s(07:31:18 AM 03/19/2024)(alsa ffmpeg gmp-autoupdate pulseaudio wayland -selinux L10N="-ach -af -an -ar -ast -az -be -bg -bn -br -bs -ca -ca-valencia -cak -cs -cy -da -de -dsb -el -en-CA -en-GB -eo -es-AR -es-CL -es-ES -es-MX -et -eu -fa -ff -fi -fr -fy -ga -gd -gl -gn -gu -he -hi -hr -hsb -hu -hy -ia -id -is -it -ja -ka -kab -kk -km -kn -ko -lij -lt -lv -mk -mr -ms -my -nb -ne -nl -nn -oc -pa -pl -pt-BR -pt-PT -rm -ro -ru -sco -si -sk -sl -son -sq -sr -sv -ta -te -th -tl -tr -trs -uk -ur -uz -vi -xh -zh-CN -zh-TW")
Homepage:            https://www.mozilla.com/firefox
Description:         Firefox Web Browser

Online3DViewer version:

janus /usr/local/src/Online3DViewer #  git --no-pager log -1
commit 4ad94bbb924b05317fd0d89b0debce9b8c871563 (HEAD -> master, tag: 0.12.0, origin/master, origin/HEAD)
Author: kovacsv <viktorkovacs@gmail.com>
Date:   Wed Dec 27 07:53:41 2023 +0100

    Export lines to obj.
janus /usr/local/src/Online3DViewer # date
Sun Apr  7 04:20:28 PM PDT 2024
janus /usr/local/src/Online3DViewer #

To Reproduce
Using a Kicad project (files available in KiCad folder, I exported the project as a step file: https://salemdata.us/3dviewerbug/issues/rhino_export/test2.step

I loaded the step file (from the machine, not by the above URL) into Oline3DViewer within Firefox above (running on a Gentoo Linux VM w/32 CPUS, 64 GB ram) and it took took 55 seconds. (See tables below of other formats.)

I then attempted to export as a Rhino file:
tvnviewer_2024-04-07_16-17-00
and the export just hung:
tvnviewer_2024-04-07_16-17-21
After waiting for a few minutes, I check the JavaScript console and found:


ncaught (in promise) TypeError: s.materials().count is not a function
    ExportRhinoContent exporter3dm.js:87
    EnumerateTransformedMeshInstances exportermodel.js:128
    EnumerateMeshInstances exportermodel.js:110
    EnumerateMeshInstances model.js:201
    Enumerate node.js:143
    Enumerate node.js:145
    Enumerate node.js:145
    EnumerateMeshInstances model.js:196
    EnumerateMeshInstances exportermodel.js:103
    EnumerateTransformedMeshInstances exportermodel.js:112
    ExportRhinoContent exporter3dm.js:52
    ExportContent exporter3dm.js:26
    promise callback*ExportContent/< exporter3dm.js:24
    promise callback*ExportContent exporter3dm.js:23
    Export exporterbase.js:59
    Export exporter.js:46
    ExportModel exportdialog.js:93
    Ao taskrunner.js:61
    setTimeout handler*Ao taskrunner.js:60
    ExportModel exportdialog.js:92
    ExportFormat exportdialog.js:185
    onClick exportdialog.js:157
    n dialog.js:172
    n dialog.js:171
    Init dialog.js:184
    Open exportdialog.js:145
    zy exportdialog.js:200
    InitToolbar website.js:722
    v website.js:612

All of the files are available for download at: https://salemdata.us/3dviewerbug/issues/rhino_export/

Expected behavior
Successful export (which I was able to perform in all other formats using the default settings of the Export Dialog window).
Screenshots

See above.

An FYI:

After loading my step file, I testing exports in all format to see what the file sizes would be. I then loaded the export files and timed how long they took. All, but the Step file, loaded in about 1 second. The Step file took 55 seconds.

File		     Time to Appear in Viewer
=================    ===============
test2.step			55 seconds
model.bim			1 second
model_ObjFileFormat_Text.off	1 second
model_gITF_bin.glb		1 second
model_gITF_text.zip 		1 second	
model_polygon_bin.ply		1 second
model_polygon_text.ply		1 second
model_stereo_binary.stl		1 second
model_stereo_text.stl		1 second
model_Wavefront.zip		1 second

Files sorted by size

19699492 Apr  7 15:17 model_stereo_text.stl
14495443 Apr  7 15:37 model.bim
11841511 Apr  7 15:53 test2.step
5395342  Apr  7 15:19 model_polygon_text.ply
5395200  Apr  7 15:22 model_ObjFileFormat_Text.off
4424484  Apr  7 15:17 model_stereo_binary.stl
3688780  Apr  7 15:21 model_gITF_bin.glb
2335759  Apr  7 15:20 model_polygon_bin.ply
1560445  Apr  7 15:17 model_Wavefront.zip
578453   Apr  7 15:21 model_gITF_text.zip

I'm providing the above as a person new to your project and unfamiliar with the various format may wonder if there is an advantage to exporting over one format vs. another. Clearly, there is a substantial file size difference, so if I were to stage a file on my server so it could be referenced by a URL, I'd select the smallest one absent any noticeable differences in the rendering of the 3D model.
Note: this circuit board is defective -- the JST-XH connector is reversed!

@jlpoolen
Copy link
Author

jlpoolen commented Apr 7, 2024

The ability to export Rhino is not of any importance to me. It's just that as I was undertaking a survey of export types, I ran into this bug which ought to be registered as an Issue.

@kovacsv
Copy link
Owner

kovacsv commented Apr 27, 2024

Thanks for the report, it's fixed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants