UV Mapping a swept "pipe" - Solidworks meshing workflow

Started by Luke Wright, February 27, 2018, 09:38:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Luke Wright

I have a swept "pipe" shape created in Solidworks that I have brought into Keyshot, both natively and in a variety of other formates (STL, STEP, and Parasolid). See first image below.


I'd like to apply a texture to this "pipe" that follows the contour of its path. Not unlike this garden hose, see second image below.


However, that is not the result that I get in Keyshot, regardless of the mapping option I use. See third image below.


I gather that this is a function of how Solidworks generates its meshes, something that we now have the option to mess with in SW2018 (called "ConvertMesh Bodies"). But the results of this option are useless in my case. See fourth image below.


I'm looking for solutions to this: other softwares, obscure file formats, Amazonian snake oils, whatever. How are you all solving these problems?

Disclaimers:
1. This is my first posting on this forum, so forgive my formatting errors
2. I apologize if this has been covered already, I have spent 8 full hours reading through forums without any reasonable answers. It, therefore, is a topic that deserves more attention.



DMerz III

 :) I have run into this before, let me save you some time! It isn't going to happen, at least not as you think it will.

If you want to try the new Triplanar mapping type in Keyshot, you might get halfway there (there will be seams in the texture, but you can softly blend them together). If you don' t want that, it is best if you just model the pipe polygonally in a program like Blender 3D (free) or Maya/3DsMax (not free unless you're a student), Cinema4D, or even Modo (not free).

From there you'll get an easy to unwrap piece of geometry, which you will unwrap inside of said program, import that geometry into Keyshot and then you can take advantage of the UV mapping type.

Trying to cut a seam along a mesh that was originally generated in a NURBs modeling software is not worth the pain and inevitable failure.

TLRD; Download Blender from Blender.org , learn how to sweep along a curve, convert that to a mesh, create a seam, unwrap, export geometry. You're done.

Best of luck!

Luke Wright

Thanks DMerz III!

Funny, that's exactly what I've been doing since posting this (great minds and all that...). I was trying to avoid the time and mental overhead of learning yet another software, but now that I'm dipping my toes into Blender, I can see numerous applications for it.

I will post my results.

DMerz III

Quote from: Luke Wright on February 27, 2018, 12:59:51 PM
Thanks DMerz III!

Funny, that's exactly what I've been doing since posting this (great minds and all that...). I was trying to avoid the time and mental overhead of learning yet another software, but now that I'm dipping my toes into Blender, I can see numerous applications for it.

I will post my results.

Please do, I was in your shoes not too long ago, Blender opened the door to a lot more possibility. It does have a good steep learning curve, but after about 20 hours in the program, suddenly it just clicks and so much makes sense, weird feeling when it happens. I highly recommend to anyone in need of a starting point to look at Blender Guru's Beginner Tutorial Series. It is by far the best 'beginner' series I've come across for free, and once you're done, you'll still be a newbie, but you will have gained confidence to keep learning. 

Ultimately, I've been working on a website to create tutorials and guides for these types of situations, there are not many resources for designers who are used to NURBs modeling, yet need to render or visualize a problem you're encountering. Just haven't gotten far enough, but the UV mapping part is definitely a good starting point.

Luke Wright

Blender, is it fare to criticize free software? It's a clunky program, but it got the job done.

First image is the tube I made in Blender.

Second image is that tube made into a mesh, that I "unwrapped"

Third image is the magical result in Keyshot.








Luke Wright

I need to find a way to accurately size this tube and position it in my scene, I'm assuming this can be done in Blender? I have a long ways to go...

Anything and everything you could want to know about how to use Blender is easy to find, but if anyone wants the exact workflow for what I did, I would be happy to post it, including links to the help articles I used.

Thanks, DMerz III, for the encouragement, I look forward to your tutorials.


DMerz III

 :D great job, you figured that out faster than I would have when I started. In terms of getting scale accurate, here's my advice, you'll want to go to Blender > Scene Tab > Set the Units to Metric.

In your 3D View, if you hit 'N' you'll get properties, and in there you'll see dimensions and also scale. If you scale anything in blender, you'll always want to do 'ctrl+A' and hit Apply Scale, this will make sure your dimensions stay 1 to 1 (there's a longer explanation there, but because everything works off of math, having a scale of 1.0 regardless of your actual dimensions is the way to go).  When you export, I recommend you use FBX. The reason you'll want to do your dimensions in metric is because FBX only works in metric units, and there will be less confusion there if you stick with that. Otherwise you can export to OBJ, but there's a little more work to do in order to make proper scale in Keyshot on your import.

Hope some of that is helpful?

Esben Oxholm

Quote from: Luke Wright on February 27, 2018, 02:01:11 PM
I need to find a way to accurately size this tube and position it in my scene, I'm assuming this can be done in Blender?

With KeyShot 7 you can export your KeyShot scene as fbx, open it in Blender (assuming it can open fbx's), create your pipe in blender in relation to the imported scene, export the pipe as fbx, import fbx tube into your original KeyShot scene making sure 'Keep original' under 'Location' is selected. This way it should fit exactly as you want it to.

Hope it helps,

mattjgerard

Quote from: Esben Oxholm on February 28, 2018, 12:37:45 PM
With KeyShot 7 you can export your KeyShot scene as fbx, open it in Blender (assuming it can open fbx's), create your pipe in blender in relation to the imported scene, export the pipe as fbx, import fbx tube into your original KeyShot scene making sure 'Keep original' under 'Location' is selected. This way it should fit exactly as you want it to.

This is exactly my workflow for running wires and cables in my scenes, of which I do very often. Works fantastic.

Luke Wright

Wow, Esben, thanks for the response.

You taught me everything I know about the material graph. Keep up the good work on YouTube!


Luke Wright

Simple UV Mapping work-flow for Solidworks jockeys:

1. Create your object in SW
2. Export said object as an STL, using the coarsest settings you can get away with (options menu). Too fine a mesh will create a tangle of polylines that will be a nightmare to deal with in Blender.
3. Import the STL into Blender and follow Blender Guru's YouTube tutorial called "Blender Beginners UV Unwrapping Tutorial"
4. Export your newly unwrapped object as an OBJ file from Blender
5. Open the OBJ in Keyshot, apply your textures, and voila!

Things to note:
1. Maintain consistent units in each of the softwares, otherwise your scale will be off.
2. If the scale is off when you import into Keyshot, import your OBJ into SW to find out what scale factor you will need and then apply it in Keyshot.
3. Importing the OBJ into SW, then exporting it as an STL, then importing it into Keyshot will negate all your hard work. I'm not sure why I thought that was a good idea.
4. Place your seam (in Blender) where it will be hidden.
5. Use the "Solid" option for the Viewport Shading (Blender) when selecting edges for the split, "Wireframe" will make your eyes cross.

I hope this helps someone out there and saves them time.

DMerz III


Esben Oxholm

Quote from: Luke Wright on March 01, 2018, 08:14:04 AM
Wow, Esben, thanks for the response.
You taught me everything I know about the material graph. Keep up the good work on YouTube!

Thanks, buddy! I'll do my best to keep'em coming :)

INNEO_MWo

In some cases it is possible to use UV mapping for single objects directly imported from Solidworks. Attached you'll find a Keyshot 7.2 KSP and a SWX 2013 Part with a single sweep. But the usage is limited to a few situations.
In SWX the sweep needs a single spline as a trajectory / path.

By the way: creo parametric files can be handled the same way. Even sketches and datum curves have to be copied curves with approximation. And this can be used with boundary blends, or sweeps and blend sweeps.

But keep pushing your Blender skills (I would like too, if I have the time!)


Cheers
Marco