Tips for OBJ/LWO export?  1-20  21-32

Next
 From:  jason
3793.1 
I'm fairly new to MOI, and I'm having a little trouble converting some IGS files into usable OBJs or LWOs for some virtual product shots.

I think the problem is that I'm just not very clear on how, if at all, I can modify the IGS file inside of MOI to have a little more control over poly-flow and topology upon export.

Here's an example - fairly simple base model:



Here's how the wireshade of the poly version inside MOI:



This is how the object appears in Lightwave (with the vertex normal map active). It's difficult to see in the small screen shot, but I end up with a ton of little hairline gaps between polys that are quite visible in the renders.



I can minimize the appearance of these artifacts with a dense enough mesh, but then mapping and surfacing becomes very messy - particularly with these models where the curvature usually dictates a change in surface material.

I've tried a few things I've seen mentioned (such as joining surfaces that I want to be contiguous in the poly mesh), and I've fiddled with the export settings in every way I can, but I always wind up with almost the exact same problems. I think I'm just missing something...

Any help would be really appreciated.

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3793.2 In reply to 3793.1 
Hi jason, so those kinds of cracks can happen when you only have individual separate surfaces that just happen to be sitting next to each other instead of joined surfaces that are actually topologically connected to one another with a shared common edge.

When you have a connected joined edge, MoI will do extra work in those spots to make sure that the generated meshes have the same vertex structure along that edge to make a "watertight" mesh without cracks.

If they are just separate surfaces, they get meshed without any knowledge of one another and that means the mesh vertices that are created on each one are not necessarily in the same spots, and mesh vertices not in the same spots between 2 pieces makes for little cracks like that.

IGS files most often contain all separate surfaces, so those need to get joined together into connected pieces to get the best mesh generation.

MoI will actually try to automatically join those surfaces together when importing IGES files, unless you have disabled the setting for it which is under Options > Import/Export > IGES options > "Join surfaces on import". So the first thing to do is to take a look at that option and make sure it is turned on.

But also looking at the grid in your screenshot, it looks like your model may be at a pretty large scale which can be a problem. MoI's joining process will join edges that are within 0.005 units apart from one another. If you have models created at a large numeric size, like several thousand units in size or something like that, it's possible that the gaps between the pieces are also at a larger scale than 0.005 units and that can prevent joining from working.

If that's the case and the model is not joining on import properly, then you'll want to try scaling the model down in MoI and then using the Join command on the surfaces to get them joined together.

To scale the surfaces, first do a Ctrl+A to select everything, then run the Transform > Scale command. In the upper-right corner of the window you will see a prompt for what the command is expecting for you to input, it will say "Pick origin point". Type in 0 and push Enter to specify the 0,0,0 point as the origin point of the scale. Then at the second prompt type in 0.01 and push enter. That will scale your model to 1/100 of its previous size. Then use Edit/Join to see if it will join together into one piece.

Another thing that can help to see if things are joining properly or not is to set up the following on a shortcut key:

script:var gd = moi.geometryDatabase; gd.deselectAll(); var breps = gd.getObjects().getBreps(); for ( var i = 0; i < breps.length; ++i ) breps.item(i).getNakedEdges().setProperty( 'selected', true );

That script will select all "naked" edges in the model - naked edges are edges that belong to only 1 surface instead of being joined and shared between 2 surfaces. So running that script will help you to see which edges can potentially make mesh cracks and still need joining together.

To set up the keyboard shortcut, go to Options> Shortcut keys and push the Add button to put in a new empty entry at the top of the list. For the key part put in whatever key you want to trigger the script, like maybe N for naked edges. Then for the Command part paste in the above script. Then when you push N you will get the naked edges highlighted.

Hope this helps!

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  jason
3793.3 In reply to 3793.2 
Wow, thanks very much for all the tips, Michael. I'll give these a go and see if I have some luck. Interesting to note the scale issue in particular, which I would have never noticed, as I've only really had issues converting models from this same client.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  solex (DSOLITO)
3793.4 In reply to 3793.3 
I had a problem with a solidworks igs exported file. Some edges were "naked"
I changed the export to STEP and it was OK and in one solid. The scale of the model was too big but I didn't take attention because I use MOI just for solid > polygon conversion.
Before changing my file format, I tried to join my surface but with no luck. So the 0.005 limitation is probably the reason.
I will try it again (altough step seems to be the best format to import nurbs files from SW - no need to join surfaces during the import process).

Thank you again for this piece of soft. The mesh process is just fabulous!
(I bought earlier polytrans, but I don't use it anymore;-)

Hope to see a import process using multi-core/multi-thread cpu.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3793.5 In reply to 3793.3 
Hi jason,

> as I've only really had issues converting models
> from this same client.

Probably that one particular client is building things at a somewhat unusually large scale or they are using somewhat looser tolerance settings in the program that they are building it in, making gaps between pieces that are larger than MoI's join tolerance.

But in either case doing a scale down followed by join can help, because when you scale objects down the gaps between surfaces also shrink and once they get below 0.005 units then they should get joined when using the Edit / Join command.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3793.6 In reply to 3793.4 
Hi solex,

> Before changing my file format, I tried to join my surface
> but with no luck. So the 0.005 limitation is probably the
> reason.

Yup, probably that was the case. Probably it could have been joined after scaling the object down somewhat smaller.

It's kind of hard to just automatically increase the joining tolerance to something too large because that can cause edges to get joined together that should not be on parts that have lots of little pieces in them.


> (altough step seems to be the best format to import nurbs
> files from SW - no need to join surfaces during the import
> process)

Yeah probably STEP is better to start with. It does maintain the edge connection information in the STEP file so that avoids needing to do any joining.

Sometimes there can be other different issues with STEP files though, because STEP files only contain the 3D curves for the trimming edges and that leaves the UV space part of the trimming curves to be calculated by MoI, and in certain cases that can be a kind of difficult calculation.

So if it is possible I'd recommend requesting more than 1 file format from your clients, like both STEP and IGES files instead of only 1 format.

Unfortunately each format has its own kind of quirks so there is not 1 single format that is automatically guaranteed to be the best in every single case.


> Thank you again for this piece of soft. The mesh
> process is just fabulous!

You're welcome, I'm glad that it is useful for you!


> Hope to see a import process using multi-core/multi-thread cpu.

I use a library to do IGES, STEP, and SAT imports, so getting multi-core working for depends on support for that being added to the library. That might happen eventually but it may take a while.

But something that should happen sooner than that is improving the import process by making something like a progress bar so you can see what is going on rather than just having the screen frozen while it is busy working on the import.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
3793.7 In reply to 3793.5 
WHen i bring stuff over from another Cad/Cam package i use, even though it was set to "Inches" in the other package, it comes in as "Millimeters" and the object is very huge in the viewport... I first change the model back to inches and it drops back down to size again....

We have discussed this before Michael. Something about the other app (which I believe is working with mm as a native internal unit) that doesnt transfer over properly....

FYI
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3793.8 In reply to 3793.7 
Hi Burr, I kind of vaguely remember something about that, it was something specific to that one program right?

If you want to make me a sample file (just a box or sphere or whatever), I can take a look at it again just to make sure I'm not missing something on MoI's side with the units setting. Also it would be good to test it with a few other programs and see if they all see the units as being in mm as well or if they see inches...

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
3793.9 In reply to 3793.8 
Hi Michael... Yeah, pretty sure it is the other program.. I opened it in the demo of turbocad and it was mm also..

Here is a stp and an igs file of a default box at 2 inches... I think they are using harmoneyware translators too!

Some interesting observations...

BobCad is more of a cnc toolpathing program than a cad package.. It's viewport is primitive. I think it is more geared towards working with it's ucs system, integrating it with the toolpathing and output stuff..

They have a "part" system and a "default". Default is whats always set, and part is "current document". So you can change all kinds of settings and prefs on the current document, without affecting the next one you open.. It is also allowing opening a file I made, on your computer, and all the system prefs and units and such will change on your computer for that one file, then go back to default for next doc.. It's kindof like if I set a bunch of prefs in MoI.. Background color.. Line colors etc, etc.. Then you open my MoI file and all those background colors and prefs would be set in your MoI...It's kindof shocking and wierd when you open a file from some guy that likes "pink for Solids" lol

WHen I change the unit system in BobCad, the "VIEWPORT AND UCS GRID" change.. The object doesnt change... (In moi, the object is actually changed/scaled)

In BobCad, the units are set to whatever the default system units are set at.. Almost like "no unit specified in the file?"...So I can open either of these as whatever my systems units are set at....

I know... It's kindof odd...

Anyway, thanks for looking...

EDITED: 19 Jun 2012 by BURRMAN

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3793.10 In reply to 3793.9 
Hi Burr, thanks for posting the sample files. I tried importing them in a couple of other programs too, like Alibre, Rhino, and ViaCAD, and all give the same results with seeing the file's units as being in mm.

So as best I can tell, that's just something that BobCAD decides to do, it seems to decide to only want to write IGES and STEP files with millimeter units instead of what your current BobCAD units are. Maybe there is an option in there somewhere to tell it to stop doing that and use your current units instead of only mm?

Anyway, it's not actually particularly harmful because like you said it actually preserves the proper size of your object. It wrote out your box with 2 inch sides as a box with 50.8 mm sides, and 2 inches does equal 50.8 mm, so the actual size is still maintained.

> (In moi, the object is actually changed/scaled)

Yeah, there is a setting for this so you can decide if you want objects scaled numerically when units change or not so as to maintain the same physically measured size. That's under Options > General > "Unit options" button.



Another way you can do things if you like is to use File > Import to bring the file in, rather than using File > Open.

When you "Open" a file, it means that you are also bringing in some settings from that file like the unit system that it was using.

But when you "Import" a file, it will keep your current settings (and other geometry as well) intact and if the imported file is in different units it will scale it into the current unit system (unless you turn off the option for doing that, it's also under Options > General > "Unit options" button).

So for example if you start up MoI, then set your units to Inches, then do a File > Import of one of your example files there, you will then end up with a 2 inch cube and won't need to alter any units setting since the imported geometry will adapt to your current unit setting rather than the setting being changed.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Micha
3793.11 In reply to 3793.10 
Hello Michael,

I hope it's ok to jump in this thread. Could you create an option that allow meshing like surfaces are joined? Maybe something like an internal join is done, but the created mesh is without additional "joins". It would be a dream. From time to time I run in the problem, that I mesh an object what needs different materials at different parts of the object. My current workaround is: I joint the object, mesh it and extract the needed mesh parts in Rhino again.

Micha

Visualisation for Designer and Architects | http://www.simulacrum.de
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BurrMan
3793.12 In reply to 3793.10 
Hi Michael,
"Import" does indeed bring it in as inches!!! (I would have sworn I tested everything...:o)

Thanks for looking and the help..
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  solex (DSOLITO)
3793.13 
Hi Michael

>But something that should happen sooner than that is improving the import process by making something like a progress bar so you can see what is going on rather than just having the screen frozen while it is busy working on the import.

It was my request in the french forum. Happy to see that it is in the pipe.

By the way, were do you find time to reply to all of us and continue programming?
Are you alone? Did you receive some request from big companies to buy yours?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3793.14 In reply to 3793.11 
Hi Micha,

> Could you create an option that allow meshing
> like surfaces are joined?

That would be difficult to do it that way, because joining is a quite intensive process, there is a lot of searching and distance measurement that happens in joining, because you can't just join any 2 naked edges together, you only want to have edges that are close by each other to get joined. That determination involves a lot of calculation.

So that's why joining is a separate process from meshing.

But if I understand what you want, you can use the already existing weld option to do what you need.


> Maybe something like an internal join is done, but the
> created mesh is without additional "joins".

You can turn off the welding option to make the generated mesh work like that. The option is here:



When you have a joined object, if you uncheck that "Weld vertices along edges" option, it will still produce a watertight no-crack mesh but the mesh will be clustered into separate non-connected (non-connected in a topological sense, but actually physically touching in location) sets of vertices with one set for each original surface. This will then allow you to use your polygon modeler's mesh processing functions to separate the mesh into individual objects.

In Rhino v1 there was a command called ExplodeMesh which would do this job of breaking a mesh into separate objects, with one object for each connected cluster of vertices. This seems to have been removed in later Rhino versions though, and I'm not sure if there is a replacement for it. The regular Rhino Explode seems like it will do it for meshes that have sharp edges in it (but then making a group out of the pieces??) but not if the pieces are smooth where they are next to one another or something like that.


> It would be a dream. From time to time I run in the
> problem, that I mesh an object what needs different materials
> at different parts of the object.

Yes, that is a major limitation of Rhino that it does not allow you to easily select individual faces out of a joined solid and apply different materials to them.

MoI itself does not have this limitation - you can select faces within a solid in MoI and apply different styles to them, and those will become different material assignments when you export to OBJ format.

- Michael

EDITED: 30 Sep 2010 by MICHAEL GIBSON

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3793.15 In reply to 3793.13 
Hi solex,

> By the way, were do you find time to reply to all
> of us and continue programming? <....>

Well, it helps that I type fast! :)

But actually answering questions in the forum is an important method for my information gathering which ultimately guides the programming. It helps me to understand what things people are getting confused by and what features in particular would help out the most.

I know it may sound strange, but it can actually even be helpful for programming to go more slowly in some ways. One of the ways that software can get messed up is if it gets a lot of stuff built along a certain direction and then later on with a large body of stuff it is hard to change that direction or change some of the initial assumptions and stuff like that.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3793.16 In reply to 3793.11 
Hi Micha, also if you can't find a way in Rhino to break a mesh apart into connected pieces, you can use this utility instead:

http://moi3d.com/download/SeparateOBJ.zip

To use that, export your joined objects from MoI to an OBJ file but make sure to turn the welding option off.

Then run that SeparateOBJ.exe utility on that file, and it will edit the OBJ file to break it into chunks like that.

Then when you load it into Rhino after that, you will have a watertight mesh without cracks but with a separate mesh object for each original surface in the solid.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  jason
3793.17 
Thanks for all the tips, guys. They've helped me get much cleaner meshes into Lightwave.

However, I'm still having some issues with some of the objects. When pulled into Lightwave Modeler, the object looks generally fine (except for the fact that I get a very large number of flipped polys initially).



When I do a quick, no-frills render though, I get this:



There's all kinds of odd tearing and gapping, but only upon render.

Does anyone have any idea what might be causing this?

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3793.18 In reply to 3793.17 
Hi jason,

> (except for the fact that I get a very large
> number of flipped polys initially).

This could mean that you've still got pieces that have not been joined to each other.

What happens if you run the "select naked edges" script that was posted previously in this thread (here: http://moi3d.com/forum/index.php?webtag=MOI&msg=3793.2), do any of the edges highlight? If so then that means those edges are not joined edges between 2 pieces.

Or another way this can happen is if your object is not a completely closed solid - when an object does not define a completely closed sealed volume, it can possibly have polys oriented in either direction, it's only for closed solids that polygons will automatically be oriented to the outside of the object. You can use the Flip command in MoI in cases like this to reverse the positive normal direction for an object that is not a closed solid. But also it can be easiest if you just turn on double-sided rendering so that it doesn't make any difference.


> There's all kinds of odd tearing and gapping, but only upon render.
>
> Does anyone have any idea what might be causing this?

It's a bit hard to see the artifacts clearly, could you zoom in one one area there to show them a bit better? Are they actually holes, or is it a problem with shading?

Shading problems could be from problems with vertex normals or sometimes from self-shadowing artifacts. Do they go away if you turn off shadow rendering?

Could you possibly post (or e-mail to me at moi@moi3d.com) a small part of the model where you've got those artifacts happening so I can examine the geometry?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3793.19 In reply to 3793.17 
Hi Jason, also which version of LightWave are you using?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  jason
3793.20 In reply to 3793.19 
I'm using 9.6, Michael.

I'm away from my machine at the moment, but I will supply you with a little more detail shortly...
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
Show messages:  1-20  21-32