Error in stl2vrml conversion

1 view (last 30 days)
Matthias
Matthias on 9 Nov 2012
Edited: varun rao on 6 Sep 2015
Hi
I'm trying to build a virtual world from a .STL assemly and I am getting the following error:
"STLB__ASM__216.00.01.1000" is not a valid VRML identifier.
Using the command:
>> stl2vrml('KneeBrace_full_assembly.stl','virtualworlds')
in the forlder where the .STL file is located. the folder virtualworlds also already exists.
Googling the error also doesn't reveal any results.
Any thoughts on what might be the problem?
Best

Answers (1)

Jan Danek
Jan Danek on 15 Nov 2012
Edited: Jan Danek on 15 Nov 2012
Hi Matthias,
The reason for the error is that the STL file contained the string "STLB__ASM__216.00.01.1000" in the solid name field. This field is used by STL2VRML function to define the corresponding VRML object DEF name - and dots (".", 0x2e) are not allowed in VRML97 DEF names.
1. I assume that your STL file is an ASCII STL file. Open the file in any plain text editor (for instance MATLAB Editor) and replace dots in the name at the first line of the file with something else, I suggest underlines (_).
Most probably, your first line looks like this:
solid STLB__ASM__216.00.01.1000
Change it to:
solid STLB__ASM__216_00_01_1000
(Or, better, to something meaningful for you, like: solid Flywheel_1 )
Valid characters for VRML node names are described in the end of A.3 Appendix of the VRML97 standard:
Of course, you can correct the file also by making sure that your CAD tool doesn't export STL files with dots in solid names.
2. I would like to ask you a favour - please let me know which software, and under which circumstances exported your STL files with dots in solid names. We need this information so that we can make STL2VRML more robust. For instance, I am interested if the "STLB__ASM__216.00.01.1000" name directly corresponds to some CAD part name, etc.
Good luck and thank you for your diagnostic info.
Jan
  1 Comment
varun rao
varun rao on 6 Sep 2015
Solid parts which are downloaded from grabcad website have this problem. After making the change from STLB ASM 218.00.00.0000 to solid STLB_ASM_218_00_00_0000, I am getting one more error saying 'Product of known dimensions, 12, not divisible into total number of elements, 596882'. Please let me know how to solve this.

Sign in to comment.

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!