Export of polyline to obj crashes


Have problems with exporting ONLY line/polyline object to *.obj (Rhino 6 and Rhino 7).
It crashes with message: “The file writting plug-in failed”.

If I use same scene and just add any mesh (_SrfPt) export works. File containes the line and a mesh.

Ideas what can be wrong in first option (no mesh):

  • it crashes before dialog “Polygon Mesh Options”, so maybe error is inside dialog (that was idea, why I even tried to add aditional mesh to test at first place)

And I often have this use case, so just exporting with additional mesh and then deleting it inside seperate program (notepad, any other 3d program) is not acceptable solution.




Rhino 7 SR4 2021-3-8 (Rhino 7, 7.4.21067.13001, Git hash:master @ ed629035202f07e8b84a3ee211479ca20bb81b73)
License type: Commercial, build 2021-03-08
License details: Cloud Zoo

Windows 10.0.19042 SR0.0 or greater (Physical RAM: 32Gb)

Computer platform: DESKTOP 

Standard graphics configuration.
  Primary display and OpenGL: NVIDIA Quadro P400 (NVidia) Memory: 2GB, Driver date: 11-20-2020 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 457.49
> Accelerated graphics device with 4 adapter port(s)
    - Windows Main Display attached to adapter port #0
    - Secondary monitor attached to adapter port #1

OpenGL Settings
  Safe mode: Off
  Use accelerated hardware modes: On
  Redraw scene when viewports are exposed: On
  Anti-alias mode: 4x
  Mip Map Filtering: Linear
  Anisotropic Filtering Mode: High
  Vendor Name: NVIDIA Corporation
  Render version: 4.6
  Shading Language: 4.60 NVIDIA
  Driver Date: 11-20-2020
  Driver Version:
  Maximum Texture size: 32768 x 32768
  Z-Buffer depth: 24 bits
  Maximum Viewport size: 32768 x 32768
  Total Video Memory: 2 GB

Rhino plugins that do not ship with Rhino

Rhino plugins that ship with Rhino
  C:\Program Files\Rhino WIP\Plug-ins\Commands.rhp	"Commands"	7.4.21067.13001
  C:\Program Files\Rhino WIP\Plug-ins\rdk.rhp	"Renderer Development Kit"	
  C:\Program Files\Rhino WIP\Plug-ins\export_ACAD.rhp	"AutoCAD file export : export_ACAD"	
  C:\Program Files\Rhino WIP\Plug-ins\export_OBJ.rhp	"export_OBJ"	7.4.21067.13001
  C:\Program Files\Rhino WIP\Plug-ins\RhinoRenderCycles.rhp	"Rhino Render"	7.4.21067.13001
  C:\Program Files\Rhino WIP\Plug-ins\rdk_etoui.rhp	"RDK_EtoUI"	7.4.21067.13001
  C:\Program Files\Rhino WIP\Plug-ins\rdk_ui.rhp	"Renderer Development Kit UI"	
  C:\Program Files\Rhino WIP\Plug-ins\import_ACAD.rhp	"AutoCAD file import: import_ACAD"	
  C:\Program Files\Rhino WIP\Plug-ins\NamedSnapshots.rhp	"Snapshots"	
  C:\Program Files\Rhino WIP\Plug-ins\RhinoCycles.rhp	"RhinoCycles"	7.4.21067.13001
  C:\Program Files\Rhino WIP\Plug-ins\Toolbars\Toolbars.rhp	"Toolbars"	7.4.21067.13001
  C:\Program Files\Rhino WIP\Plug-ins\3dxrhino.rhp	"3Dconnexion 3D Mouse"	
  C:\Program Files\Rhino WIP\Plug-ins\Displacement.rhp	"Displacement"	

Thanks, Jure

Hi Jure - I tried exporting a single line here and didn’t run into this issue. Is it file-specific on your end?
Also, please run the Rhino SystemInfo command and copy-paste the result here.


Thanks for answer, writing additional details actually help me to found a solution.
On “OBJ Export Options” in “Geometry” tab one must choose correct surface options even if there is no surfaces at all. I think that option to use “NURBS objects” fixes everything. And thing that crashes is “Polygon mesh objects” especialy when there is none.

Still think that option “Polygon mesh objects” should not crash - but at least my case is covered.

And as subquestion - 2 point line is always represented as “cstype bspline”:

v 0 0 0
v 1 0 0
cstype bspline
deg 1
curv 0 1 5 6
parm u 0 0 1 1

I suppose ther is no option in dialog for compact most simple format (“l”):

v 0 0 0
v 1 0 0
l 0 1

Thanks, Jure

Hi Jure -

Technically, it does not crash, it fails. But, yes, based on what it says in that dialog box, I would expect that to work as well and put it on the list as RH-63530.

RH-63530 is fixed in the latest Rhino 7 Service Release Candidate

I see the bug has been fixed (thanks) but, as Jure already pointed out, the polyline is always exported as spline with deg=1 instead of a simple line.
I understand it is not a bug, but I would like to have the exported file with only vertex (“v”) and lines (“l”) because I am trying to use it in OpenFoam, which only supports lines, not spline.
So, is there a way to export as lines instead of spline?
If not possible in the current release, will it be possible in the future releases?

@tim - is this possible? Write polylines as obj polylines?
@dangeli.fabio - it looks like this is possible and should be added fairly soon
RH-64427 Add option to export polylines as a series of lines in OBJ


I’m having an issue in trying to export polylines as an .obj file.
I don’t know if it’s Rhino exporting or if the destination program is the issue on importing to .obj file.
But the end result is only the end points of the polyline showing up in the imported file.
I’ve tried the various settings in options prior to exporting, but no success.
I’ve tried re-importing into Rhino and it shows up as expected as full polylines.
Because of this, I suspect it’s not Rhino at all. But then again is there a way that Rhino saves out the polylines that Rhino recognizes but some other programs do not - having their own conventions for the obj format?
Any insights is appreciated.


Houdini. In thinking about a bit more, I think the issue is how Houdini contstructs polylines is different than Rhino.
With Houdini, points are like the ‘anchors’ from which vertices are attached. The primitives, in this case polylines are constructed from the vertices, which allow amongst other things allows their order(vertex) to be independantly changed without changing the points identifying ‘number’/position coordinates.
Polygons are constructed the same way.
I suspect in Rhino only the points are used and/or with the .obj format the same. The UV, vertex information only being used for things like texturing.
Hence, saving out to .obj saves the point and vertex information in a manner that houdini cannot recognize in order to construct the polylines.
However, oddly enough houdini can recognize and does create polygons(even though it’s done in the same manner as polylines) when exporting ‘mesh’(polygon) objects.
Most of this is speculation on my part.

@BabaJ I think in that case, you are better off asking this question in the Houdini forum

Am I correct though in thinking that in Rhino a polyline is created simply by ‘point to point’ ?
If so, is there a way to ‘add’ vertex data to a point?
That way I can check upon importing into Houdini to check what information is keep and what is not.

Being able to add vertex data to a point, also let’s me bring up another topic(that should be created as a separate post), and investigate creating some files for testing submitting to a 3d printing company whose ‘help’ is a bit vague when it comes to a specific material that allows color data to be printed.