MoI discussion forum
MoI discussion forum

Full Version: Curves Modo<->MoI

From: mdesign
7 Sep 2019   [#1]
Do you know any method to import Curves from Modo to MoI. To do some retopo curves in Modo and next import it to MoI.

For now I converted curves to poly lines in Modo, next I`ve done extend edges to have polygon strip. Those polygon strips I exported as obj from Modo. In Moi I imported it as subd and deleted surface to have only pure curve.
I`m looking for faster workflow. Any tips?

It would be super if MoI would allow to import pure edges without polygons as subd obj. It would allow to import curves from Modo to MoI a bit faster (without making those polygon strips to cheat system ;) ).

Cheers!!!
From: PaQ
7 Sep 2019   [#2]
Hello,
I'm not really sure it will help you that much, but you can export nurbs curves from Houdini (indie) using the .igs format.
So it should be easy to convert you Modo polyline (according you find a way to import them in Houdini, my guess .obj should do it) ... but it's an extra software in the mix.





From: mdesign
7 Sep 2019   [#3] In reply to [#2]
Thanks PaQ.

It`s my workflow:

1) Controur tool or retopo curve



2) Extend edges to have poly strips and export as obj from Modo



3) import as subd obj to MoI


4) remove unwanted surfaces to left only demanded curves:



It`s a quite long I would like to get it faster without additional softwares. Only MoI and Modo.

Edit: I would like to have also some workflow to export curves from MoI and Import them to Modo. I`ve thought about some scripting to draw some curves but almost all formats are compiled and I can`t read points. DXF is open but I don`t understand it (yet).

Image Attachments:
01.png  02.png  03.png  04.png 


From: MarkBTomlinson
7 Sep 2019   [#4]
That is a pretty sweet workaround thanks Marcin!
From: Michael Gibson
7 Sep 2019   [#5] In reply to [#1]
Hi bartosh, what formats can Modo export its curves out to? Can you please post an example file that contains curves from Modo?

- Michael
From: mdesign
8 Sep 2019   [#6] In reply to [#5]
Modo can export obj,dxf, lxo, plt (i`m not sure is it 3d file).

I think best is obj. Modo changes curves to polygons (ngons) onfly during export to *.obj. During import n-gons with subd obj MoI crashes. I wish there would be option to import with subd obj only edges without surfaces and allow n-gons then. It would allow to import curves from Modo as obj files without changing it to polygon strips.







Is there eany way to export pure cruves from MoI to obj (as polyline with vertex in place of points)? Modo would convert that into same curves. It would allow both side import/export of Curves between Modo and MoI.

I`ve attached zip file with all files exported from Modo which can contain curves (or rather polyline).

Attachments:
curves.zip

Image Attachments:
curves_vs_polylines.jpg  how_looks_exported_obj_after_export_from_Modo.jpg 


From: Michael Gibson
8 Sep 2019   [#7] In reply to [#6]
Hi Bartosh, so the curves.dxf file does not load into any CAD programs I tested with which included MoI, Rhino, ViaCAD, Autodesk online viewer, and SolidWorks eDrawings viewer. I took a look at the file contents and it seems to be an invalid DXF file. It contains a POLYLINE entity with the flag on it set saying that it is a "polyface mesh" variant which is a way of storing an indexed polygon mesh in DXF with a list of vertices followed by faces (triangles and quads only) that hold index values to the vertex list. But this file contains only vertices and no faces.

For .obj, there are ways in the OBJ official spec to put curves in .obj files although it's rarely used, but the curves.obj file does not use those methods. It has 2 n-gon faces in them. Since a face in .obj is a closed object it is interpreted by the sub-d .obj importer as having a closing edge between the first and last vertex which then crosses over the other edges making a self-intersecting "bow-tie" type polygon. I'll see about getting the importer fixed in v5 for these but the fix will be to just ignore these malformed n-gons, not to make curves out of them.

There isn't any way for a regular .obj importer to know that these particular n-gons should be interpreted as open curves instead of as n-gons as they are specified in the file. Is your second screenshot what it looks like when you re-import the .obj file back into Modo? If so it's not making curves out of them right?

An additional complication is the type of curves that Modo is using in the first screenshot you show, those are a particular kind of curve called a "Catmull-Rom spline", they aren't NURBS curves. If you were to try and export just the control points of a MoI NURBS curve and use those same control points for a Modo Catmull-Rom curve it won't be in the same shape at all.

When you do the polygon strip method don't you get a different shape result than with the Catmull-Rom curves going through the same points? Notice in your first screenshot above how the curve goes right through each of those vertices, the curve shape is not shrunken and smoothed down inside of those points like sub-d smoothing or NURBS curves will be like.

- Michael
From: Michael Gibson
8 Sep 2019   [#8] In reply to [#6]
Hi Bartosh, so I'm a little confused about what you want to use, those Catmull-Rom curves in Modo are a totally different thing than a set of edges only in Modo right? Aren't those something like polygons with only 2 points in them?

What do you get if you try to export out the 2 point polygons rather than trying to export the Catmull-Rom curves?

- Michael
From: mdesign
8 Sep 2019   [#9]
M: "...If so it's not making curves out of them right?"

yes, that second image shows obj after reimporting obj to Modo (it can`t see it as curve) but there is converter inside Modo to convert polygon edges or polylines to Modo Curves.

Thanks for your effort with trying to solve this export/import problem.

Polylines (2- vertex polygons) are exported as n-gons with vertices.

So it`s suppose that my way to import those curves is good but not accurate (different curve shape) as you said before.

Thanks for your time once again.
From: amur (STEFAN)
8 Sep 2019   [#10]
Hi bartosh44,

why don't you use MoI to create the closed curves?

If you import you quad model into MoI v4 beta with subd2nurbs
you only need then to project some lines to your model ... ;-)

project

Regards
Stefan
From: Michael Gibson
8 Sep 2019   [#11] In reply to [#9]
Hi Bartosh, so just to clarify, those example files you posted previously were those saved from a Modo Catmull-Rom spline curve or were they exports of 2-vertex polylines?

What happens if you try to export a single line with just 2 vertices in it to .obj ?

Maybe it's possible to make a script that parses these particular .obj files in a different way than the regular .obj converter but I'm not sure how it could identify an open curve like in your first screenshot versus a closed loop. An n-gon in an .obj file is implicitly a closed thing, there isn't any way for it to be labeled that it's supposed to be treated as an open curve instead of a closed polygon. And then the results of making a NURBS control point curve through those points is going to look different than the Modo Catmull-Rom spline curve.

- Michael
From: mdesign
9 Sep 2019   [#12] In reply to [#11]
1) Those files was export of Curves (not 2-vertex polylines) but with polylines OBJ looks same.
2) Single line without polygon is a polyline. Polyline with two vertices is exported as pure vertices without edges.
3) I`ve thought about vertex ID but if you will edit a curve then a vertex order will be broken so it`s not a solution

I wanted to do in that way becouse I do retopo on the surface of big 3d scan data. I`ve thought that I could do curve retopo in Modo and next build patches in MoI.

Thanks Michael for that Subd feature. It`s fantastic and it`s super feature. Only for that one feature it`s worth to buy your wonderfull software.

As I wrote before I solved my way to import curves from Modo to MoI as polygon strips. Maybe it`s not 100% accurate but I think it`s good enough.

I would like to ask about second way (MoI->Modo). Why obj export can`t export MoI curve without surface as f.e. polyline? Of course I can do same trick in other way. Build surface only to cheat exporter and remove it in Modo to have polylines which can be coverted to curves.

Edit: I`m not super specific becouse I have my Modo based workflow and with that thread I`m trying to do research of potential possible changes in my current workflow.

Cheers!!!!
From: mdesign
9 Sep 2019   [#13] In reply to [#10]
Thanks for youe example. It was only example with those lines. I need Modo for retopo over 3d scans (5-10million polys). I`ve thought to import main features lines as curves to MoI but I can do this as subd polygon strips.
From: Michael Gibson
9 Sep 2019   [#14] In reply to [#12]
Hi Bartosh,

re:
> I would like to ask about second way (MoI->Modo). Why obj export can`t export MoI curve without surface
> as f.e. polyline?

Well, because it would be weird to do that, it's not supported by any programs to interpret an n-gon in an .obj file as if it was a curve.


> Of course I can do same trick in other way. Build surface only to cheat exporter and remove
> it in Modo to have polylines which can be coverted to curves

But this conversion doesn't work properly if I understand correctly. You're making a Catmull-Rom curve in Modo, the shape of the curve will be different than what it originally looked like in MoI.

Just taking the control points of a NURBS curve in MoI and then using those as the control points of a Catmull-Rom spline in Modo is not going to make the same curve shape.

Since Modo does not have a NURBS curve type in it, I don't really see how it's going to work to transfer a curve over to it without potentially weird mutations in shapes.

- Michael
From: mdesign
10 Sep 2019   [#15] In reply to [#14]
Thanks, Michael for your effort to explain this differences with curve shape. I think I understood it.